forked from enlightenment/efl
mono-docs: Indicate when a class is BETA
Summary: The mono generator adds a <remarks> section to all BETA classes with an explanatory text. These tags are understood by DocFX and Monodevelop. On top of this, this commit modifies the DocFX template to give the Remarks section a more prominent place in the page. Test Plan: Render docs, Beta classes should have a big blue box with a remark about the class being Beta and dangerous. Reviewers: lauromoura, vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9381
This commit is contained in:
parent
3eb7b3793b
commit
5585420e85
|
@ -3,6 +3,12 @@
|
||||||
<h1 id="{{id}}" data-uid="{{uid}}" class="text-break">{{>partials/title}}</h1>
|
<h1 id="{{id}}" data-uid="{{uid}}" class="text-break">{{>partials/title}}</h1>
|
||||||
<div class="markdown level0 summary">{{{summary}}}</div>
|
<div class="markdown level0 summary">{{{summary}}}</div>
|
||||||
<div class="markdown level0 conceptual">{{{conceptual}}}</div>
|
<div class="markdown level0 conceptual">{{{conceptual}}}</div>
|
||||||
|
{{#remarks}}
|
||||||
|
<div class="remarks">
|
||||||
|
<h5 id="{{id}}_remarks"><strong>{{__global.remarks}}</strong></h5>
|
||||||
|
{{{remarks}}}
|
||||||
|
</div>
|
||||||
|
{{/remarks}}
|
||||||
{{#inClass}}
|
{{#inClass}}
|
||||||
<div class="inheritance">
|
<div class="inheritance">
|
||||||
<h5>{{__global.inheritance}}</h5>
|
<h5>{{__global.inheritance}}</h5>
|
||||||
|
@ -82,10 +88,6 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{/syntax.typeParameters.0}}
|
{{/syntax.typeParameters.0}}
|
||||||
{{#remarks}}
|
|
||||||
<h5 id="{{id}}_remarks"><strong>{{__global.remarks}}</strong></h5>
|
|
||||||
<div class="markdown level0 remarks">{{{remarks}}}</div>
|
|
||||||
{{/remarks}}
|
|
||||||
{{#example.0}}
|
{{#example.0}}
|
||||||
<h5 id="{{id}}_examples"><strong>{{__global.examples}}</strong></h5>
|
<h5 id="{{id}}_examples"><strong>{{__global.examples}}</strong></h5>
|
||||||
{{/example.0}}
|
{{/example.0}}
|
||||||
|
|
|
@ -143,10 +143,6 @@
|
||||||
<h5 class="overrides">{{__global.overrides}}</h5>
|
<h5 class="overrides">{{__global.overrides}}</h5>
|
||||||
<div><xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/></div>
|
<div><xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/></div>
|
||||||
{{/overridden}}
|
{{/overridden}}
|
||||||
{{#remarks}}
|
|
||||||
<h5 id="{{id}}_remarks">{{__global.remarks}}</h5>
|
|
||||||
<div class="markdown level1 remarks">{{{remarks}}}</div>
|
|
||||||
{{/remarks}}
|
|
||||||
{{#example.0}}
|
{{#example.0}}
|
||||||
<h5 id="{{id}}_examples">{{__global.examples}}</h5>
|
<h5 id="{{id}}_examples">{{__global.examples}}</h5>
|
||||||
{{/example.0}}
|
{{/example.0}}
|
||||||
|
|
|
@ -995,3 +995,9 @@ div.embeddedvideo iframe {
|
||||||
|
|
||||||
.mainContainer[dir='rtl'] main ul[role="tablist"] {
|
.mainContainer[dir='rtl'] main ul[role="tablist"] {
|
||||||
margin: 0; }
|
margin: 0; }
|
||||||
|
|
||||||
|
.remarks {
|
||||||
|
background-color: #c0c0ff;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <Eina.h>
|
#include <Eina.h>
|
||||||
|
|
||||||
static const std::string BETA_REF_SUFFIX = " (object still in beta stage)";
|
static const std::string BETA_REF_SUFFIX = " (object still in beta stage)";
|
||||||
|
static const std::string BETA_SUMMARY_REMARKS = "This is a \\<b\\>BETA\\</b\\> class. It can be modified or removed in the future. Do not use it for product development.";
|
||||||
|
|
||||||
namespace eolian_mono {
|
namespace eolian_mono {
|
||||||
|
|
||||||
|
@ -390,6 +391,11 @@ struct documentation_generator
|
||||||
{
|
{
|
||||||
if (!generate(sink, klass.documentation, context)) return false;
|
if (!generate(sink, klass.documentation, context)) return false;
|
||||||
|
|
||||||
|
if (klass.is_beta)
|
||||||
|
{
|
||||||
|
if (!generate_tag(sink, "remarks", BETA_SUMMARY_REMARKS, context)) return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::string klass_name = name_helpers::klass_full_concrete_or_interface_name(klass);
|
std::string klass_name = name_helpers::klass_full_concrete_or_interface_name(klass);
|
||||||
return generate_tag_example(sink, klass_name, context);
|
return generate_tag_example(sink, klass_name, context);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue