summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-07-23 20:58:42 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-07-23 21:53:01 +0200
commit7c030aa57e0141bd5802b7201f31b9bd7b138a0f (patch)
treea2160e8a5408a5b94295c4fd088ea294326f51e6 /src/bin
parentd20b8ad42adf8ce6968fc39c38960cf933218780 (diff)
mono-docs: Indicate when methods and properties are BETA
Summary: Previous commit added a <remarks> section to BETA classes. Methods (and properties) cannot have <remarks> section so a bit of bold text is added instead to their summary. Depends on D9380 Test Plan: Generate docs and observe beta methods and properties have a note regarding their betaness in the summary. Reviewers: lauromoura, vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9382
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index 26e5645eb2..93bc42ef4b 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -12,7 +12,9 @@
12#include <Eina.h> 12#include <Eina.h>
13 13
14static const std::string BETA_REF_SUFFIX = " (object still in beta stage)"; 14static const std::string BETA_REF_SUFFIX = " (object still in beta stage)";
15static 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."; 15static const std::string BETA_CLASS_REMARK = "This is a \\<b\\>BETA\\</b\\> class. It can be modified or removed in the future. Do not use it for product development.";
16static const std::string BETA_PROPERTY_REMARK = "\n\n\\<b\\>This is a BETA property\\</b\\>. It can be modified or removed in the future. Do not use it for product development.";
17static const std::string BETA_METHOD_REMARK = "\n\n\\<b\\>This is a BETA method\\</b\\>. It can be modified or removed in the future. Do not use it for product development.";
16 18
17namespace eolian_mono { 19namespace eolian_mono {
18 20
@@ -393,7 +395,7 @@ struct documentation_generator
393 395
394 if (klass.is_beta) 396 if (klass.is_beta)
395 { 397 {
396 if (!generate_tag(sink, "remarks", BETA_SUMMARY_REMARKS, context)) return false; 398 if (!generate_tag(sink, "remarks", BETA_CLASS_REMARK, context)) return false;
397 } 399 }
398 400
399 std::string klass_name = name_helpers::klass_full_concrete_or_interface_name(klass); 401 std::string klass_name = name_helpers::klass_full_concrete_or_interface_name(klass);
@@ -403,7 +405,17 @@ struct documentation_generator
403 template<typename OutputIterator, typename Context> 405 template<typename OutputIterator, typename Context>
404 bool generate(OutputIterator sink, attributes::property_def const& prop, Context const& context) const 406 bool generate(OutputIterator sink, attributes::property_def const& prop, Context const& context) const
405 { 407 {
406 if (!generate(sink, prop.documentation, context)) 408 std::string tail_text = "";
409
410 if (!prop.klass.is_beta)
411 {
412 if ((prop.setter.is_engaged() && prop.setter->is_beta) ||
413 (prop.getter.is_engaged() && prop.getter->is_beta))
414 {
415 tail_text = BETA_PROPERTY_REMARK;
416 }
417 }
418 if (!generate(sink, prop.documentation, context, tail_text))
407 return false; 419 return false;
408 420
409 std::string text; 421 std::string text;
@@ -434,16 +446,21 @@ struct documentation_generator
434 template<typename OutputIterator, typename Context> 446 template<typename OutputIterator, typename Context>
435 bool generate_property(OutputIterator sink, attributes::function_def const& func, Context const& context) const 447 bool generate_property(OutputIterator sink, attributes::function_def const& func, Context const& context) const
436 { 448 {
449 std::string tail_text = "";
450 if (!func.klass.is_beta && func.is_beta)
451 {
452 tail_text = BETA_METHOD_REMARK;
453 }
437 454
438 // First, try the get/set specific documentation 455 // First, try the get/set specific documentation
439 if (!func.documentation.summary.empty()) 456 if (!func.documentation.summary.empty())
440 { 457 {
441 if (!generate(sink, func.documentation, context)) 458 if (!generate(sink, func.documentation, context, tail_text))
442 return false; 459 return false;
443 } 460 }
444 else // fallback to common property documentation 461 else // fallback to common property documentation
445 { 462 {
446 if (!generate(sink, func.property_documentation, context)) 463 if (!generate(sink, func.property_documentation, context, tail_text))
447 return false; 464 return false;
448 } 465 }
449 466
@@ -463,7 +480,13 @@ struct documentation_generator
463 template<typename OutputIterator, typename Context> 480 template<typename OutputIterator, typename Context>
464 bool generate_function(OutputIterator sink, attributes::function_def const& func, Context const& context) const 481 bool generate_function(OutputIterator sink, attributes::function_def const& func, Context const& context) const
465 { 482 {
466 if (!generate(sink, func.documentation, context)) 483 std::string tail_text = "";
484 if (!func.klass.is_beta && func.is_beta)
485 {
486 tail_text = BETA_METHOD_REMARK;
487 }
488
489 if (!generate(sink, func.documentation, context, tail_text))
467 return false; 490 return false;
468 491
469 for (auto&& param : func.parameters) 492 for (auto&& param : func.parameters)
@@ -486,11 +509,12 @@ struct documentation_generator
486 } 509 }
487 510
488 template<typename OutputIterator, typename Context> 511 template<typename OutputIterator, typename Context>
489 bool generate(OutputIterator sink, attributes::documentation_def const& doc, Context const& context) const 512 bool generate(OutputIterator sink, attributes::documentation_def const& doc, Context const& context, std::string tail_text = "") const
490 { 513 {
491 std::string str = doc.full_text; 514 std::string str = doc.full_text;
492 if (!doc.since.empty()) 515 if (!doc.since.empty())
493 str += "\n(Since EFL " + doc.since + ")"; 516 str += "\n(Since EFL " + doc.since + ")";
517 str += tail_text;
494 return generate_tag_summary(sink, str, context); 518 return generate_tag_summary(sink, str, context);
495 } 519 }
496 520