From 845f6440b8d2a672769f553a45aa1406c17d4c4f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 20 Jan 2022 15:20:01 -0500 Subject: xmls, html group text output (bullets & indents) --- src/doc_reform/io_out/sqlite.d | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'src/doc_reform/io_out/sqlite.d') 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, "$1"); 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"┃

%s

┃", @@ -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"┃

%s

┃", obj.metainfo.is_a, -- cgit v1.2.3