From 68395fa1d5bd40d187e704ff570565e5335ade58 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 31 Jan 2019 14:25:38 -0500 Subject: inline fontface markup, internal representation --- org/meta_abstraction.org | 49 ++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) (limited to 'org/meta_abstraction.org') diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index f4a6f62..9721918 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -412,6 +412,15 @@ pure auto obj_dom_set_collapsed_tags(O)( static auto ocn_emit(int ocn_status_flag) { return object_citation_number.ocn_emitter(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); + 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); + } + return line; +} /+ book index variables +/ string book_idx_tmp; string[][string][string] bookindex_unordered_hashes; @@ -650,6 +659,13 @@ continue; #+END_SRC **** _non code objects_ (other blocks or regular text) [+4] :non_code: +***** inline fontface markup + +#+name: abs_in_loop_body_non_code_obj +#+BEGIN_SRC d +line = line.inline_markup_faces; +#+END_SRC + ***** in section (biblio, glossary, blurb) +(block group)+ [+1] :block:active: ****** in section: biblio :biblio: @@ -1592,7 +1608,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) ? "" : ", /┨" ~ entry["journal"].str ~ "┣/"), ((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 : ""), @@ -4986,10 +5002,10 @@ auto font_faces_line(T)( static auto rgx = Rgx(); 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, ("*┨$1┣*$2")) + .replaceFirst(rgx.inline_bold_line, ("!┨$1┣!$2")) + .replaceFirst(rgx.inline_underscore_line, ("_┨$1┣_$2")) + .replaceFirst(rgx.inline_italics_line, ("/┨$1┣/$2")); } return textline; } @@ -5320,8 +5336,6 @@ static struct ObjInlineMarkupMunge { debug(asserts) { static assert(is(typeof(obj_txt_in) == string)); } - static auto mng = InlineMarkup(); - obj_txt_in = obj_txt_in.replaceAll(rgx.inline_mono, (mng.mono ~ "{$1}" ~ mng.mono)); /+ url matched +/ obj_txt_in = obj_txt_in.replaceAll(rgx.inline_notes_al_special, ""); // TODO reinstate when special footnotes are implemented if (obj_txt_in.match(rgx.smid_inline_url_generic)) { @@ -5372,7 +5386,6 @@ static struct ObjInlineMarkupMunge { ); } } - obj_txt_in = obj_txt_in.replaceAll(rgx.inline_mono_box, ("#{$1}#")); return obj_txt_in; } #+END_SRC @@ -5384,7 +5397,6 @@ static struct ObjInlineMarkupMunge { static assert(is(typeof(obj_txt_in) == string)); } static auto mng = InlineMarkup(); - obj_txt_in = obj_txt_in.replaceAll(rgx.inline_mono, (mng.mono ~ "{$1}" ~ mng.mono)); // figure /+ url matched +/ obj_txt_in = obj_txt_in.replaceAll(rgx.inline_notes_al_special, ""); // TODO reinstate when special footnotes are implemented if (obj_txt_in.match(rgx.smid_image_generic)) { /+ images with and without links +/ @@ -5413,7 +5425,6 @@ static struct ObjInlineMarkupMunge { } } } - obj_txt_in = obj_txt_in.replaceAll(rgx.inline_mono_box, ("#{$1}#")); // figure return obj_txt_in; } #+END_SRC @@ -6745,7 +6756,7 @@ struct BookIndexReportSection { } auto mainkeys=bookindex_unordered_hashes.byKey.array.sort().release; foreach (mainkey; mainkeys) { - write("_0_1 !{", mainkey, "}! "); + write("_0_1 !┨", mainkey, "┣! "); foreach (ref_; bookindex_unordered_hashes[mainkey]["_a"]) { auto go = ref_.replaceAll(rgx.book_index_go, "$1"); write(" {", ref_, "}#", go, ", "); @@ -6850,7 +6861,7 @@ struct BookIndexReportSection { string[dchar] transTable = [' ' : "_"]; foreach (mainkey; mainkeys) { bi_tmp_tags = [""]; - bi_tmp = "!{" ~ mainkey ~ "}! "; + bi_tmp = "!┨" ~ mainkey ~ "┣! "; buffer.clear(); bi_tmp_tags ~= translate(mainkey, transTable); auto bkidx_lnk(string locs) { @@ -6967,15 +6978,13 @@ struct NotesSection { previous_count=cntr; static auto mkup = InlineMarkup(); static auto munge = ObjInlineMarkupMunge(); - foreach( - m; + foreach(m; (contents_am[cntr].text).matchAll( - rgx.inline_notes_delimiter_al_regular_number_note - ) + rgx.inline_notes_delimiter_al_regular_number_note) ) { debug(endnotes_build) { writeln( - "{^{", m.captures[1], ".}^}" + "{^┨", m.captures[1], ".┣^}" ~ mkup.mark_internal_site_lnk, tag_in_seg["seg_lv4"], ".fnSuffix#noteref_\n ", m.captures[1], " ", @@ -6985,12 +6994,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_" + "{^┨" ~ m.captures[1] ~ ".┣^}#noteref_" ~ m.captures[1]) ~ " " ~ m.captures[2] ~ "』" ) : (munge.url_links( - "{^{" ~ m.captures[1] ~ ".}^}" + "{^┨" ~ m.captures[1] ~ ".┣^}" ~ mkup.mark_internal_site_lnk ~ tag_in_seg["seg_lv4"] ~ ".fnSuffix#noteref_" @@ -7123,7 +7132,7 @@ struct NotesSection { string anchor_tag = "note_" ~ notenumber; comp_obj_endnote_.tags.anchor_tags = [ endnotes_["anchor"][i] ]; comp_obj_endnote_.has.inline_links = true; - comp_obj_endnote_.text = endnote.strip; + comp_obj_endnote_.text = endnote.inline_markup_faces.strip; the_endnotes_section ~= comp_obj_endnote_; } } -- cgit v1.2.3