summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-07-03 16:13:59 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-07-03 16:13:59 +0100
commit2e8fc41613083f9cb8a3b34d4d1f5345b08a0289 (patch)
treeac8279f5028bf63b98090c3f6d40ce282d544412
parente9a09047681b1c36f447d22ee11b68439aa0c84d (diff)
eolian: add support for monospace highlights in docs
-rw-r--r--src/bin/eolian/docs_generator.c10
-rw-r--r--src/tests/eolian/data/struct.eo1
-rw-r--r--src/tests/eolian/data/struct_ref.c4
3 files changed, 12 insertions, 3 deletions
diff --git a/src/bin/eolian/docs_generator.c b/src/bin/eolian/docs_generator.c
index 41b506d95a..5d872d3af1 100644
--- a/src/bin/eolian/docs_generator.c
+++ b/src/bin/eolian/docs_generator.c
@@ -34,7 +34,7 @@ _append_section(const char *desc, int ind, int curl, Eina_Strbuf *buf,
34 if (*desc == '\\') 34 if (*desc == '\\')
35 { 35 {
36 desc++; 36 desc++;
37 if (*desc != '@') 37 if ((*desc != '@') && (*desc != '$'))
38 eina_strbuf_append_char(wbuf, '\\'); 38 eina_strbuf_append_char(wbuf, '\\');
39 eina_strbuf_append_char(wbuf, *desc++); 39 eina_strbuf_append_char(wbuf, *desc++);
40 } 40 }
@@ -46,6 +46,14 @@ _append_section(const char *desc, int ind, int curl, Eina_Strbuf *buf,
46 else 46 else
47 eina_strbuf_append_char(wbuf, '@'); 47 eina_strbuf_append_char(wbuf, '@');
48 } 48 }
49 else if (*desc == '$')
50 {
51 desc++;
52 if (isalpha(*desc))
53 eina_strbuf_append(wbuf, "@c ");
54 else
55 eina_strbuf_append_char(wbuf, '@');
56 }
49 while (*desc && !isspace(*desc)) 57 while (*desc && !isspace(*desc))
50 eina_strbuf_append_char(wbuf, *desc++); 58 eina_strbuf_append_char(wbuf, *desc++);
51 int limit = DOC_LIMIT(ind); 59 int limit = DOC_LIMIT(ind);
diff --git a/src/tests/eolian/data/struct.eo b/src/tests/eolian/data/struct.eo
index 6b33952e4b..c59c5163e2 100644
--- a/src/tests/eolian/data/struct.eo
+++ b/src/tests/eolian/data/struct.eo
@@ -17,6 +17,7 @@ struct @extern Not.Generated {
17class Struct { 17class Struct {
18 methods { 18 methods {
19 foo { 19 foo {
20 [[Foo docs. This is $monospace.]]
20 params { 21 params {
21 idx: int; 22 idx: int;
22 } 23 }
diff --git a/src/tests/eolian/data/struct_ref.c b/src/tests/eolian/data/struct_ref.c
index 455d60ac6f..85e8b5b320 100644
--- a/src/tests/eolian/data/struct_ref.c
+++ b/src/tests/eolian/data/struct_ref.c
@@ -31,9 +31,9 @@ typedef struct _Opaque Opaque;
31EAPI const Eo_Class *struct_class_get(void) EINA_CONST; 31EAPI const Eo_Class *struct_class_get(void) EINA_CONST;
32 32
33/** 33/**
34 * No description supplied. 34 * @brief Foo docs. This is @c monospace.
35 * 35 *
36 * @param[in] idx No description supplied. 36 * @param[in] idx
37 */ 37 */
38EOAPI char * struct_foo(int idx); 38EOAPI char * struct_foo(int idx);
39 39