_append_section(const char *desc, int ind, int curl, Eina_Strbuf *buf,
Eina_Strbuf *wbuf, Eina_Bool use_legacy)
{
+ Eina_Bool try_note = EINA_TRUE;
while (*desc)
{
eina_strbuf_reset(wbuf);
while (*desc && isspace(*desc) && (*desc != '\n'))
eina_strbuf_append_char(wbuf, *desc++);
+ if (try_note)
+ {
+#define CHECK_NOTE(str) !strncmp(desc, str ": ", sizeof(str ": ") - 1)
+ if (CHECK_NOTE("Note"))
+ {
+ eina_strbuf_append(wbuf, "@note ");
+ desc += sizeof("Note:");
+ }
+ else if (CHECK_NOTE("Warning"))
+ {
+ eina_strbuf_append(wbuf, "@warning ");
+ desc += sizeof("Warning:");
+ }
+#undef CHECK_NOTE
+ try_note = EINA_FALSE;
+ }
if (*desc == '\\')
{
desc++;
_indent_line(buf, ind);
eina_strbuf_append(buf, " *\n");
desc++;
+ try_note = EINA_TRUE;
}
curl = _indent_line(buf, ind) + 3;
eina_strbuf_append(buf, " * ");
[[This is struct Foo.
It does stuff.
+ Note: This is a note.
+
This is a longer description for struct Foo.
+ Warning: This is a warning. You can only use Warning: and
+ Note: at the beginning of a paragraph.
+
This is another paragraph.
@since 1.66
/**
* @brief This is struct Foo. It does stuff.
*
+ * @note This is a note.
+ *
* This is a longer description for struct Foo.
*
+ * @warning This is a warning. You can only use Warning: and Note: at the
+ * beginning of a paragraph.
+ *
* This is another paragraph.
*
* @since 1.66
/**
* @brief This is struct Foo. It does stuff.
*
+ * @note This is a note.
+ *
* This is a longer description for struct Foo.
*
+ * @warning This is a warning. You can only use Warning: and Note: at the
+ * beginning of a paragraph.
+ *
* This is another paragraph.
*
* @since 1.66
fail_if(strcmp(eolian_documentation_summary_get(doc),
"This is struct Foo. It does stuff."));
fail_if(strcmp(eolian_documentation_description_get(doc),
+ "Note: This is a note.\n\n"
"This is a longer description for struct Foo.\n\n"
+ "Warning: This is a warning. You can only use Warning: "
+ "and Note: at the beginning of a paragraph.\n\n"
"This is another paragraph."));
fail_if(strcmp(eolian_documentation_since_get(doc),
"1.66"));