summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-12-10 16:16:46 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-12-10 16:16:46 +0100
commit7ad8efdfac0fe2fc2252695ac10635ce3c0ac800 (patch)
tree15f4631894b8a30be0ac243f1242e6f16717b1b4
parenta8d7816782a1f48c12f2387a85168175f5baf7e2 (diff)
WIP: Special formatting of lists using regexpsdevs/xartigas/eolian_mono_list_formatting
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index 0a2179b..312c136 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -23,6 +23,7 @@
23#include "name_helpers.hh" 23#include "name_helpers.hh"
24#include "generation_contexts.hh" 24#include "generation_contexts.hh"
25#include "blacklist.hh" 25#include "blacklist.hh"
26#include <regex>
26 27
27#include <Eina.h> 28#include <Eina.h>
28 29
@@ -250,6 +251,7 @@ struct documentation_generator
250 name_tail = token_text.substr(token_text.length() - 4, 4); 251 name_tail = token_text.substr(token_text.length() - 4, 4);
251 } 252 }
252 ::Eolian_Doc_Token_Type token_type = ::eolian_doc_token_type_get(&token); 253 ::Eolian_Doc_Token_Type token_type = ::eolian_doc_token_type_get(&token);
254 std::regex rgx("(^|\n)( *)- ([a-zA-Z_]*):");
253 switch(token_type) 255 switch(token_type)
254 { 256 {
255 case ::EOLIAN_DOC_TOKEN_TEXT: 257 case ::EOLIAN_DOC_TOKEN_TEXT:
@@ -259,6 +261,8 @@ struct documentation_generator
259 if ((previous_token_type == ::EOLIAN_DOC_TOKEN_REF) && 261 if ((previous_token_type == ::EOLIAN_DOC_TOKEN_REF) &&
260 (token_text.substr(0, 2) == "()")) 262 (token_text.substr(0, 2) == "()"))
261 token_text = token_text.substr(2, token_text.length() - 2); 263 token_text = token_text.substr(2, token_text.length() - 2);
264 // Special formatting for lists starting with a monospaced word: Replace by Bold.
265 token_text = std::regex_replace(token_text, rgx, "$2- <b>$3</b>:");
262 new_text += token_text; 266 new_text += token_text;
263 break; 267 break;
264 case ::EOLIAN_DOC_TOKEN_REF: 268 case ::EOLIAN_DOC_TOKEN_REF: