summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-10-09 16:18:14 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-10-09 16:18:30 +0200
commit9dcfe4bbbce4bef369d4ab7cd23f5c3a61d3a73d (patch)
tree2d7b3f94b78642bfa6b76d10aee36b9c4f6225ba /src/bin
parent86191b02c78348608652fcbd3c834060815107a3 (diff)
mono-docs: Merge Property and getter/setter docs
Summary: Property docs, when present, should always be included in Property and Accessor (setter and getter) docs. Accessor docs, when present, should be included in their accessor method, and also in the property method, as a side note. This patch does just that. Depends on D10285 Ref T8309 Test Plan: Generate docs and take a look at `Efl.Ui.Calendar`, for example, which has a bit of everything. Reviewers: lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8309 Differential Revision: https://phab.enlightenment.org/D10298
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index 0bdfbda..7bcdfc5 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -437,20 +437,24 @@ struct documentation_generator
437 template<typename OutputIterator, typename Context> 437 template<typename OutputIterator, typename Context>
438 bool generate(OutputIterator sink, attributes::property_def const& prop, Context const& context) const 438 bool generate(OutputIterator sink, attributes::property_def const& prop, Context const& context) const
439 { 439 {
440 std::string tail_text = ""; 440 // Generate docs by merging Property, Accessor, Since and Beta pieces.
441 441 std::string text = prop.documentation.full_text;
442 if (!prop.documentation.since.empty())
443 text += "\\<br/\\>\nSince EFL " + prop.documentation.since + ".";
444 if (prop.setter.is_engaged() && !prop.setter->documentation.full_text.empty())
445 text += "\\<br/\\>\n\\<b\\>Note on writing:\\</b\\> " + prop.setter->documentation.full_text;
446 if (prop.getter.is_engaged() && !prop.getter->documentation.full_text.empty())
447 text += "\\<br/\\>\n\\<b\\>Note on reading:\\</b\\> " + prop.getter->documentation.full_text;
442 if (!prop.klass.is_beta) 448 if (!prop.klass.is_beta)
443 { 449 {
444 if ((prop.setter.is_engaged() && prop.setter->is_beta) || 450 if ((prop.setter.is_engaged() && prop.setter->is_beta) ||
445 (prop.getter.is_engaged() && prop.getter->is_beta)) 451 (prop.getter.is_engaged() && prop.getter->is_beta))
446 { 452 text += BETA_PROPERTY_REMARK;
447 tail_text = BETA_PROPERTY_REMARK;
448 }
449 } 453 }
450 if (!generate(sink, prop.documentation, context, tail_text)) 454 if (!generate_tag_summary(sink, text, context))
451 return false; 455 return false;
452 456
453 std::string text; 457 text = "";
454 if (prop.setter.is_engaged()) 458 if (prop.setter.is_engaged())
455 text = prop.setter->parameters[0].documentation.full_text; 459 text = prop.setter->parameters[0].documentation.full_text;
456 else if (prop.getter.is_engaged()) 460 else if (prop.getter.is_engaged())
@@ -478,21 +482,18 @@ struct documentation_generator
478 template<typename OutputIterator, typename Context> 482 template<typename OutputIterator, typename Context>
479 bool generate_property(OutputIterator sink, attributes::function_def const& func, Context const& context) const 483 bool generate_property(OutputIterator sink, attributes::function_def const& func, Context const& context) const
480 { 484 {
481 std::string tail_text = ""; 485 if (!func.documentation.full_text.empty() ||
482 if (!func.klass.is_beta && func.is_beta) 486 !func.property_documentation.full_text.empty())
483 {
484 tail_text = BETA_METHOD_REMARK;
485 }
486
487 // First, try the get/set specific documentation
488 if (!func.documentation.summary.empty())
489 {
490 if (!generate(sink, func.documentation, context, tail_text))
491 return false;
492 }
493 else // fallback to common property documentation
494 { 487 {
495 if (!generate(sink, func.property_documentation, context, tail_text)) 488 // Generate docs by merging Property, Accessor, Since and Beta pieces.
489 std::string text = func.property_documentation.full_text;
490 if (!func.property_documentation.since.empty())
491 text += "\\<br/\\>\nSince EFL " + func.property_documentation.since + ".";
492 if (!func.documentation.full_text.empty())
493 text += "\\<br/\\>\n\\<b\\>Note:\\</b\\> " + func.documentation.full_text;
494 if (!func.klass.is_beta && func.is_beta)
495 text += BETA_METHOD_REMARK;
496 if (!generate_tag_summary(sink, text, context))
496 return false; 497 return false;
497 } 498 }
498 499