diff options
-rw-r--r-- | org/default_misc.org | 10 | ||||
-rw-r--r-- | org/meta_abstraction.org | 35 | ||||
-rw-r--r-- | src/doc_reform/meta/defaults.d | 10 | ||||
-rw-r--r-- | src/doc_reform/meta/metadoc_from_src.d | 35 | ||||
-rw-r--r-- | src/doc_reform/output/defaults.d | 10 |
5 files changed, 71 insertions, 29 deletions
diff --git a/org/default_misc.org b/org/default_misc.org index d4576a6..a811b91 100644 --- a/org/default_misc.org +++ b/org/default_misc.org @@ -224,8 +224,17 @@ template InternalMarkup() { static struct InlineMarkup { auto en_a_o = "【"; auto en_a_c = "】"; auto en_b_o = "〖"; auto en_b_c = "〗"; + auto ff_o = "┨"; auto ff_c = "┣"; // fontface auto lnk_o = "┥"; auto lnk_c = "┝"; auto url_o = "┤"; auto url_c = "├"; + auto emph = "*"; + auto bold = "!"; + auto italic = "/"; + auto underscore = "_"; + auto superscript = "^"; + auto subscript = ","; + auto mono = "■"; + auto cite = "‖"; auto mark_internal_site_lnk = "¤"; auto nbsp = "░"; auto br_line = "┘"; @@ -239,7 +248,6 @@ template InternalMarkup() { auto tc_o = "┏"; auto tc_c = "┚"; auto tc_p = "┆"; - auto mono = "■"; auto img = "☼"; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index 9721918..bf67dcc 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -414,10 +414,11 @@ static auto ocn_emit(int ocn_status_flag) { } static auto inline_markup_faces(L)(L line) { static auto rgx = Rgx(); - line = replaceAll!(m => "■┨" ~ m[2] ~ "┣■")(line, rgx.inline_mark_mono); - line = replaceAll!(m => "‖┨" ~ m[2] ~ "┣‖")(line, rgx.inline_mark_cite); + static auto mkup = InlineMarkup(); + line = replaceAll!(m => mkup.mono ~ mkup.ff_o ~ m[2] ~ mkup.ff_c ~ mkup.mono)(line, rgx.inline_mark_mono); + line = replaceAll!(m => mkup.cite ~ mkup.ff_o ~ m[2] ~ mkup.ff_c ~ mkup.cite)(line, rgx.inline_mark_cite); foreach (regx; [rgx.inline_mark_emphasis, rgx.inline_mark_bold, rgx.inline_mark_underscore, rgx.inline_mark_italics, rgx.inline_mark_superscript, rgx.inline_mark_subscript, rgx.inline_mark_strike, rgx.inline_mark_insert]) { - line = replaceAll!(m => m[1] ~ "┨" ~ m[2] ~ "┣"~ m[1])(line, regx); + line = replaceAll!(m => m[1] ~ mkup.ff_o ~ m[2] ~ mkup.ff_c ~ m[1])(line, regx); } return line; } @@ -663,7 +664,7 @@ continue; #+name: abs_in_loop_body_non_code_obj #+BEGIN_SRC d -line = line.inline_markup_faces; +line = line.inline_markup_faces; // by text line (rather than by text object), linebreaks in para problematic #+END_SRC ***** in section (biblio, glossary, blurb) +(block group)+ [+1] :block:active: @@ -1608,7 +1609,7 @@ foreach (entry; biblio_ordered) { "%s \"%s\"%s%s%s%s%s%s%s%s%s.", ((entry["author"].str.empty) ? entry["editor"].str : entry["author"].str), entry["fulltitle"].str, - ((entry["journal"].str.empty) ? "" : ", /┨" ~ entry["journal"].str ~ "┣/"), + ((entry["journal"].str.empty) ? "" : ", " ~ mkup.italic ~ mkup.ff_o ~ entry["journal"].str ~ mkup.ff_c ~ mkup.italic), ((entry["volume"].str.empty) ? "" : ", " ~ entry["volume"].str), ((entry["in"].str.empty) ? "" : ", " ~ entry["in"].str), ((!(entry["author"].str.empty) && (!(entry["editor"].str.empty))) ? entry["editor"].str : ""), @@ -2426,6 +2427,9 @@ if (the_document_body_section.length > 1) { tag_assoc[(obj.metainfo.identifier)]["seg_lv1_to_4"] = obj.tags.epub_segment_anchor_tag_is; } + if (obj.metainfo.is_a != "code") { + obj.text = obj.text.inline_markup_faces; + } if (obj.metainfo.is_a == "heading") { debug(dom) { writeln(obj.text); @@ -2476,6 +2480,7 @@ if (the_endnotes_section.length > 1) { dom_structure_markedup_tags_status = dom_structure_markedup_tags_status_buffer.dup; dom_structure_collapsed_tags_status = dom_structure_collapsed_tags_status_buffer.dup; foreach (ref obj; the_endnotes_section) { + obj.text = obj.text.inline_markup_faces; if (obj.metainfo.is_a == "heading") { debug(dom) { writeln(obj.text); @@ -2675,6 +2680,9 @@ if (the_bookindex_section.length > 1) { /+ optional only one 1~ level +/ if (the_blurb_section.length > 1) { foreach (ref obj; the_blurb_section) { + if (obj.metainfo.is_a != "code") { + obj.text = obj.text.inline_markup_faces; + } if (obj.metainfo.is_a == "heading") { debug(dom) { writeln(obj.text); @@ -5000,12 +5008,13 @@ auto font_faces_line(T)( T textline, ) { static auto rgx = Rgx(); + static auto mkup = InlineMarkup(); if (textline.match(rgx.inline_faces_line)) { textline = textline - .replaceFirst(rgx.inline_emphasis_line, ("*┨$1┣*$2")) - .replaceFirst(rgx.inline_bold_line, ("!┨$1┣!$2")) - .replaceFirst(rgx.inline_underscore_line, ("_┨$1┣_$2")) - .replaceFirst(rgx.inline_italics_line, ("/┨$1┣/$2")); + .replaceFirst(rgx.inline_emphasis_line, format(q"┋%s%s%s%s%s%s┋", mkup.emph, mkup.ff_o, "$1", mkup.ff_c, mkup.emph, "$2")) + .replaceFirst(rgx.inline_bold_line, format(q"┋%s%s%s%s%s%s┋", mkup.bold, mkup.ff_o, "$1", mkup.ff_c, mkup.bold, "$2")) + .replaceFirst(rgx.inline_underscore_line, format(q"┋%s%s%s%s%s%s┋", mkup.underscore, mkup.ff_o, "$1", mkup.ff_c, mkup.underscore, "$2")) + .replaceFirst(rgx.inline_italics_line, format(q"┋%s%s%s%s%s%s┋", mkup.italic, mkup.ff_o, "$1", mkup.ff_c, mkup.italic, "$2")); } return textline; } @@ -6861,7 +6870,7 @@ struct BookIndexReportSection { string[dchar] transTable = [' ' : "_"]; foreach (mainkey; mainkeys) { bi_tmp_tags = [""]; - bi_tmp = "!┨" ~ mainkey ~ "┣! "; + bi_tmp = mkup.bold ~ mkup.ff_o ~ mainkey ~ mkup.ff_c ~ mkup.bold ~ " "; buffer.clear(); bi_tmp_tags ~= translate(mainkey, transTable); auto bkidx_lnk(string locs) { @@ -6984,7 +6993,7 @@ struct NotesSection { ) { debug(endnotes_build) { writeln( - "{^┨", m.captures[1], ".┣^}" + "{^", mkup.ff_o, m.captures[1], ".", mkup.ff_c, "^}" ~ mkup.mark_internal_site_lnk, tag_in_seg["seg_lv4"], ".fnSuffix#noteref_\n ", m.captures[1], " ", @@ -6994,12 +7003,12 @@ struct NotesSection { object_notes["anchor"] ~= "note_" ~ m.captures[1] ~ "』"; object_notes["notes"] ~= (tag_in_seg["seg_lv4"].empty) ? (munge.url_links( - "{^┨" ~ m.captures[1] ~ ".┣^}#noteref_" + "{" ~ mkup.superscript ~ mkup.ff_o ~ m.captures[1] ~ "." ~ mkup.ff_c ~ mkup.superscript ~ "}#noteref_" ~ m.captures[1]) ~ " " ~ m.captures[2] ~ "』" ) : (munge.url_links( - "{^┨" ~ m.captures[1] ~ ".┣^}" + "{" ~ mkup.superscript ~ mkup.ff_o ~ m.captures[1] ~ "." ~ mkup.ff_c ~ mkup.superscript ~ "}" ~ mkup.mark_internal_site_lnk ~ tag_in_seg["seg_lv4"] ~ ".fnSuffix#noteref_" diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index 661234c..7c1a726 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -127,8 +127,17 @@ template InternalMarkup() { static struct InlineMarkup { auto en_a_o = "【"; auto en_a_c = "】"; auto en_b_o = "〖"; auto en_b_c = "〗"; + auto ff_o = "┨"; auto ff_c = "┣"; // fontface auto lnk_o = "┥"; auto lnk_c = "┝"; auto url_o = "┤"; auto url_c = "├"; + auto emph = "*"; + auto bold = "!"; + auto italic = "/"; + auto underscore = "_"; + auto superscript = "^"; + auto subscript = ","; + auto mono = "■"; + auto cite = "‖"; auto mark_internal_site_lnk = "¤"; auto nbsp = "░"; auto br_line = "┘"; @@ -142,7 +151,6 @@ template InternalMarkup() { auto tc_o = "┏"; auto tc_c = "┚"; auto tc_p = "┆"; - auto mono = "■"; auto img = "☼"; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index 90cc08a..d82c60a 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -235,10 +235,11 @@ template DocReformDocAbstraction() { } static auto inline_markup_faces(L)(L line) { static auto rgx = Rgx(); - line = replaceAll!(m => "■┨" ~ m[2] ~ "┣■")(line, rgx.inline_mark_mono); - line = replaceAll!(m => "‖┨" ~ m[2] ~ "┣‖")(line, rgx.inline_mark_cite); + static auto mkup = InlineMarkup(); + line = replaceAll!(m => mkup.mono ~ mkup.ff_o ~ m[2] ~ mkup.ff_c ~ mkup.mono)(line, rgx.inline_mark_mono); + line = replaceAll!(m => mkup.cite ~ mkup.ff_o ~ m[2] ~ mkup.ff_c ~ mkup.cite)(line, rgx.inline_mark_cite); foreach (regx; [rgx.inline_mark_emphasis, rgx.inline_mark_bold, rgx.inline_mark_underscore, rgx.inline_mark_italics, rgx.inline_mark_superscript, rgx.inline_mark_subscript, rgx.inline_mark_strike, rgx.inline_mark_insert]) { - line = replaceAll!(m => m[1] ~ "┨" ~ m[2] ~ "┣"~ m[1])(line, regx); + line = replaceAll!(m => m[1] ~ mkup.ff_o ~ m[2] ~ mkup.ff_c ~ m[1])(line, regx); } return line; } @@ -457,7 +458,7 @@ template DocReformDocAbstraction() { /+ object other than "code block" object (includes regular text paragraph, headings & blocks other than code) +/ /+ heading, glossary, blurb, poem, group, block, quote, table +/ - line = line.inline_markup_faces; + line = line.inline_markup_faces; // by text line (rather than by text object), linebreaks in para problematic if (line.matchFirst(rgx.heading_biblio) || (obj_type_status["biblio_section"] == State.on && (!(line.matchFirst(rgx.heading_blurb_glossary))) @@ -1225,7 +1226,7 @@ template DocReformDocAbstraction() { "%s \"%s\"%s%s%s%s%s%s%s%s%s.", ((entry["author"].str.empty) ? entry["editor"].str : entry["author"].str), entry["fulltitle"].str, - ((entry["journal"].str.empty) ? "" : ", /┨" ~ entry["journal"].str ~ "┣/"), + ((entry["journal"].str.empty) ? "" : ", " ~ mkup.italic ~ mkup.ff_o ~ entry["journal"].str ~ mkup.ff_c ~ mkup.italic), ((entry["volume"].str.empty) ? "" : ", " ~ entry["volume"].str), ((entry["in"].str.empty) ? "" : ", " ~ entry["in"].str), ((!(entry["author"].str.empty) && (!(entry["editor"].str.empty))) ? entry["editor"].str : ""), @@ -1829,6 +1830,9 @@ template DocReformDocAbstraction() { tag_assoc[(obj.metainfo.identifier)]["seg_lv1_to_4"] = obj.tags.epub_segment_anchor_tag_is; } + if (obj.metainfo.is_a != "code") { + obj.text = obj.text.inline_markup_faces; + } if (obj.metainfo.is_a == "heading") { debug(dom) { writeln(obj.text); @@ -1871,6 +1875,7 @@ template DocReformDocAbstraction() { dom_structure_markedup_tags_status = dom_structure_markedup_tags_status_buffer.dup; dom_structure_collapsed_tags_status = dom_structure_collapsed_tags_status_buffer.dup; foreach (ref obj; the_endnotes_section) { + obj.text = obj.text.inline_markup_faces; if (obj.metainfo.is_a == "heading") { debug(dom) { writeln(obj.text); @@ -2040,6 +2045,9 @@ template DocReformDocAbstraction() { /+ optional only one 1~ level +/ if (the_blurb_section.length > 1) { foreach (ref obj; the_blurb_section) { + if (obj.metainfo.is_a != "code") { + obj.text = obj.text.inline_markup_faces; + } if (obj.metainfo.is_a == "heading") { debug(dom) { writeln(obj.text); @@ -3987,12 +3995,13 @@ template DocReformDocAbstraction() { T textline, ) { static auto rgx = Rgx(); + static auto mkup = InlineMarkup(); if (textline.match(rgx.inline_faces_line)) { textline = textline - .replaceFirst(rgx.inline_emphasis_line, ("*┨$1┣*$2")) - .replaceFirst(rgx.inline_bold_line, ("!┨$1┣!$2")) - .replaceFirst(rgx.inline_underscore_line, ("_┨$1┣_$2")) - .replaceFirst(rgx.inline_italics_line, ("/┨$1┣/$2")); + .replaceFirst(rgx.inline_emphasis_line, format(q"┋%s%s%s%s%s%s┋", mkup.emph, mkup.ff_o, "$1", mkup.ff_c, mkup.emph, "$2")) + .replaceFirst(rgx.inline_bold_line, format(q"┋%s%s%s%s%s%s┋", mkup.bold, mkup.ff_o, "$1", mkup.ff_c, mkup.bold, "$2")) + .replaceFirst(rgx.inline_underscore_line, format(q"┋%s%s%s%s%s%s┋", mkup.underscore, mkup.ff_o, "$1", mkup.ff_c, mkup.underscore, "$2")) + .replaceFirst(rgx.inline_italics_line, format(q"┋%s%s%s%s%s%s┋", mkup.italic, mkup.ff_o, "$1", mkup.ff_c, mkup.italic, "$2")); } return textline; } @@ -5507,7 +5516,7 @@ template DocReformDocAbstraction() { string[dchar] transTable = [' ' : "_"]; foreach (mainkey; mainkeys) { bi_tmp_tags = [""]; - bi_tmp = "!┨" ~ mainkey ~ "┣! "; + bi_tmp = mkup.bold ~ mkup.ff_o ~ mainkey ~ mkup.ff_c ~ mkup.bold ~ " "; buffer.clear(); bi_tmp_tags ~= translate(mainkey, transTable); auto bkidx_lnk(string locs) { @@ -5613,7 +5622,7 @@ template DocReformDocAbstraction() { ) { debug(endnotes_build) { writeln( - "{^┨", m.captures[1], ".┣^}" + "{^", mkup.ff_o, m.captures[1], ".", mkup.ff_c, "^}" ~ mkup.mark_internal_site_lnk, tag_in_seg["seg_lv4"], ".fnSuffix#noteref_\n ", m.captures[1], " ", @@ -5623,12 +5632,12 @@ template DocReformDocAbstraction() { object_notes["anchor"] ~= "note_" ~ m.captures[1] ~ "』"; object_notes["notes"] ~= (tag_in_seg["seg_lv4"].empty) ? (munge.url_links( - "{^┨" ~ m.captures[1] ~ ".┣^}#noteref_" + "{" ~ mkup.superscript ~ mkup.ff_o ~ m.captures[1] ~ "." ~ mkup.ff_c ~ mkup.superscript ~ "}#noteref_" ~ m.captures[1]) ~ " " ~ m.captures[2] ~ "』" ) : (munge.url_links( - "{^┨" ~ m.captures[1] ~ ".┣^}" + "{" ~ mkup.superscript ~ mkup.ff_o ~ m.captures[1] ~ "." ~ mkup.ff_c ~ mkup.superscript ~ "}" ~ mkup.mark_internal_site_lnk ~ tag_in_seg["seg_lv4"] ~ ".fnSuffix#noteref_" diff --git a/src/doc_reform/output/defaults.d b/src/doc_reform/output/defaults.d index 36f5c8e..e54afb9 100644 --- a/src/doc_reform/output/defaults.d +++ b/src/doc_reform/output/defaults.d @@ -8,8 +8,17 @@ template InternalMarkup() { static struct InlineMarkup { auto en_a_o = "【"; auto en_a_c = "】"; auto en_b_o = "〖"; auto en_b_c = "〗"; + auto ff_o = "┨"; auto ff_c = "┣"; // fontface auto lnk_o = "┥"; auto lnk_c = "┝"; auto url_o = "┤"; auto url_c = "├"; + auto emph = "*"; + auto bold = "!"; + auto italic = "/"; + auto underscore = "_"; + auto superscript = "^"; + auto subscript = ","; + auto mono = "■"; + auto cite = "‖"; auto mark_internal_site_lnk = "¤"; auto nbsp = "░"; auto br_line = "┘"; @@ -23,7 +32,6 @@ template InternalMarkup() { auto tc_o = "┏"; auto tc_c = "┚"; auto tc_p = "┆"; - auto mono = "■"; auto img = "☼"; static string indent_by_spaces_provided(int indent, string _indent_spaces ="░░") { _indent_spaces = replicate(_indent_spaces, indent); |