diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2022-01-20 15:20:01 -0500 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2022-01-21 09:20:00 -0500 |
commit | 845f6440b8d2a672769f553a45aa1406c17d4c4f (patch) | |
tree | 4c0c0360922170f8b3c01c6a3199b9cdece92716 /src/doc_reform/io_out/sqlite.d | |
parent | org files naming, minor (diff) |
xmls, html group text output (bullets & indents)
Diffstat (limited to 'src/doc_reform/io_out/sqlite.d')
-rw-r--r-- | src/doc_reform/io_out/sqlite.d | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d index 58f8dd9..c1b55de 100644 --- a/src/doc_reform/io_out/sqlite.d +++ b/src/doc_reform/io_out/sqlite.d @@ -294,6 +294,57 @@ template SQLiteFormatAndLoadObject() { .replaceAll(rgx.inline_cite, "<cite>$1</cite>"); return _txt; } + string inline_grouped_text_bullets_indents(M,O)( + M doc_matters, + const O obj, + string _txt, + string _suffix = ".html", + string _xml_type = "seg", + ) { + static auto rgx = RgxO(); + if (obj.metainfo.is_a == "group") { + _txt = (_txt) + .replaceAll(rgx.grouped_para_indent_1, + " ") + .replaceAll(rgx.grouped_para_indent_2, + " ") + .replaceAll(rgx.grouped_para_indent_3, + " ") + .replaceAll(rgx.grouped_para_indent_4, + " ") + .replaceAll(rgx.grouped_para_indent_5, + " ") + .replaceAll(rgx.grouped_para_indent_6, + " ") + .replaceAll(rgx.grouped_para_indent_7, + " ") + .replaceAll(rgx.grouped_para_indent_8, + " ") + .replaceAll(rgx.grouped_para_indent_9, + " ") + .replaceAll(rgx.grouped_para_indent_hang, " ") + .replaceAll(rgx.grouped_para_bullet, "● ") + .replaceAll(rgx.grouped_para_bullet_indent_1, + " ● ") + .replaceAll(rgx.grouped_para_bullet_indent_2, + " ● ") + .replaceAll(rgx.grouped_para_bullet_indent_3, + " ● ") + .replaceAll(rgx.grouped_para_bullet_indent_4, + " ● ") + .replaceAll(rgx.grouped_para_bullet_indent_5, + " ● ") + .replaceAll(rgx.grouped_para_bullet_indent_6, + " ● ") + .replaceAll(rgx.grouped_para_bullet_indent_7, + " ● ") + .replaceAll(rgx.grouped_para_bullet_indent_8, + " ● ") + .replaceAll(rgx.grouped_para_bullet_indent_9, + " ● "); + } + return _txt; + } string inline_images(M,O)( M doc_matters, const O obj, @@ -457,6 +508,9 @@ template SQLiteFormatAndLoadObject() { const O obj, string _txt, ) { + if (obj.metainfo.is_a == "group") { + _txt = inline_grouped_text_bullets_indents(doc_matters, obj, _txt, xml_type); + } _txt = inline_images(doc_matters, obj, _txt, xml_type); _txt = inline_links(doc_matters, obj, _txt, xml_type); _txt = inline_notes_scroll(doc_matters, obj, _txt); @@ -527,6 +581,7 @@ template SQLiteFormatAndLoadObject() { assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "group"); string _txt = munge_html(doc_matters, obj); + _txt = inline_markup(doc_matters, obj, _txt); string o = format(q"┃<p class="%s"> %s </p>┃", @@ -544,6 +599,7 @@ template SQLiteFormatAndLoadObject() { assert(obj.metainfo.is_of_type == "block"); assert(obj.metainfo.is_a == "block"); string _txt = munge_html(doc_matters, obj); + _txt = inline_markup(doc_matters, obj, _txt); string o = format(q"┃ <p class="%s">%s</p>┃", obj.metainfo.is_a, |