From 5585420e858bbb17ae3b7cc599b4a0f2eb178075 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Tue, 23 Jul 2019 16:38:04 +0200 Subject: [PATCH] mono-docs: Indicate when a class is BETA Summary: The mono generator adds a 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 --- .../default_efl/partials/class.header.tmpl.partial | 10 ++++++---- doc/docfx/default_efl/partials/class.tmpl.partial | 4 ---- doc/docfx/default_efl/styles/docfx.css | 6 ++++++ src/bin/eolian_mono/eolian/mono/documentation.hh | 6 ++++++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/doc/docfx/default_efl/partials/class.header.tmpl.partial b/doc/docfx/default_efl/partials/class.header.tmpl.partial index f6bff1af39..18c6dc7341 100644 --- a/doc/docfx/default_efl/partials/class.header.tmpl.partial +++ b/doc/docfx/default_efl/partials/class.header.tmpl.partial @@ -3,6 +3,12 @@

{{>partials/title}}

{{{summary}}}
{{{conceptual}}}
+{{#remarks}} +
+
{{__global.remarks}}
+{{{remarks}}} +
+{{/remarks}} {{#inClass}}
{{__global.inheritance}}
@@ -82,10 +88,6 @@ {{/syntax.typeParameters.0}} -{{#remarks}} -
{{__global.remarks}}
-
{{{remarks}}}
-{{/remarks}} {{#example.0}}
{{__global.examples}}
{{/example.0}} diff --git a/doc/docfx/default_efl/partials/class.tmpl.partial b/doc/docfx/default_efl/partials/class.tmpl.partial index ae9de66364..75bfce0e9b 100644 --- a/doc/docfx/default_efl/partials/class.tmpl.partial +++ b/doc/docfx/default_efl/partials/class.tmpl.partial @@ -143,10 +143,6 @@
{{__global.overrides}}
{{/overridden}} -{{#remarks}} -
{{__global.remarks}}
-
{{{remarks}}}
-{{/remarks}} {{#example.0}}
{{__global.examples}}
{{/example.0}} diff --git a/doc/docfx/default_efl/styles/docfx.css b/doc/docfx/default_efl/styles/docfx.css index f94c4b0377..81beac718e 100644 --- a/doc/docfx/default_efl/styles/docfx.css +++ b/doc/docfx/default_efl/styles/docfx.css @@ -995,3 +995,9 @@ div.embeddedvideo iframe { .mainContainer[dir='rtl'] main ul[role="tablist"] { margin: 0; } + +.remarks { + background-color: #c0c0ff; + border-radius: 6px; + padding: 6px; +} diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh index a672d209b4..26e5645eb2 100644 --- a/src/bin/eolian_mono/eolian/mono/documentation.hh +++ b/src/bin/eolian_mono/eolian/mono/documentation.hh @@ -12,6 +12,7 @@ #include static const std::string BETA_REF_SUFFIX = " (object still in beta stage)"; +static const std::string BETA_SUMMARY_REMARKS = "This is a \\BETA\\ class. It can be modified or removed in the future. Do not use it for product development."; namespace eolian_mono { @@ -390,6 +391,11 @@ struct documentation_generator { 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); return generate_tag_example(sink, klass_name, context); }