From b7f2764f5e5eb0f3e9fad8e76272756f4219241b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 16 Nov 2016 10:08:35 -0500 Subject: minor reorganise same --- org/ao_abstract_doc_source.org | 48 +++++++++++++++++++++++++--------------- org/ao_output_debugs.org | 32 +++++++++++++++++++-------- src/sdp/ao_abstract_doc_source.d | 48 +++++++++++++++++++++++++--------------- src/sdp/ao_output_debugs.d | 32 +++++++++++++++++++-------- 4 files changed, 106 insertions(+), 54 deletions(-) diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index d1bc79b..7c10dca 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -2821,30 +2821,15 @@ struct ObjInlineMarkupMunge { string[string] obj_txt; int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; string obj_txt_out, tail, note; + auto rgx = Rgx(); + auto mkup = InlineMarkup(); private auto initialize_note_numbers() { n_foot = 0; n_foot_reg = 0; n_foot_sp_asterisk = 0; n_foot_sp_plus = 0; } - private auto object_notes_(string obj_txt_in) - in { } - body { - auto rgx = Rgx(); - auto mkup = InlineMarkup(); - obj_txt_out = ""; - tail = ""; - obj_txt_in = replaceAll( - obj_txt_in, - rgx.inline_notes_curly_sp_asterisk, - (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c) - ); - obj_txt_in = - replaceAll( - obj_txt_in, - rgx.inline_notes_curly_sp_plus, - (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) - ); + string url_links(string obj_txt_in) { /+ url matched +/ if (auto m = matchAll(obj_txt_in, rgx.inline_url)) { /+ link: naked url: http://url +/ @@ -2887,6 +2872,9 @@ struct ObjInlineMarkupMunge { ); } } + return obj_txt_in; + } + string footnotes_endnotes(string obj_txt_in) { /+ endnotes (regular) +/ obj_txt_in = replaceAll( @@ -2916,6 +2904,30 @@ struct ObjInlineMarkupMunge { } else { obj_txt_out = obj_txt_in; } + return obj_txt_in; + } + private auto object_notes_(string obj_txt_in) + in { } + body { + obj_txt_out = ""; + tail = ""; + /+ special endnotes +/ + obj_txt_in = replaceAll( + obj_txt_in, + rgx.inline_notes_curly_sp_asterisk, + (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c) + ); + obj_txt_in = + replaceAll( + obj_txt_in, + rgx.inline_notes_curly_sp_plus, + (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) + ); + /+ url matched +/ + if (auto m = matchAll(obj_txt_in, rgx.inline_url)) { + obj_txt_in = url_links(obj_txt_in); + } + obj_txt_in = footnotes_endnotes(obj_txt_in); debug(footnotes) { writeln(obj_txt_out, tail); } diff --git a/org/ao_output_debugs.org b/org/ao_output_debugs.org index 67f35ae..5349200 100644 --- a/org/ao_output_debugs.org +++ b/org/ao_output_debugs.org @@ -718,24 +718,38 @@ debug(checkdoc) { #+name: ao_output_debugs_summary #+BEGIN_SRC d writefln( - "%s\n\"%s\", %s\n%s\n%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s:%s\n", - "-------------------------------", + "%s\n\"%s\", %s\n%s\n%s\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n(%s: %s)", + "---------------------------------", dochead_meta["title"]["full"], dochead_meta["creator"]["author"], - "-------------------------------", fn_src, + "---------------------------------", + "length toc array: ", + to!int(contents["toc_seg"].length), "length contents array: ", - contents["body"].length, + to!int(contents["body"].length), "last obj_cite_number: ", - check["last_obj_cite_number"], + to!int(check["last_obj_cite_number"]), + "length endnotes: ", + (contents["endnotes_seg"].length > 1) + ? (to!int(contents["endnotes_seg"].length)) + : 0, "length glossary: ", - contents["glossary"].length, + (contents["glossary"].length > 1) + ? (to!int(contents["glossary"].length)) + : 0, "length biblio: ", - contents["bibliography"].length, + (contents["bibliography"].length > 1) + ? (to!int(contents["bibliography"].length)) + : 0, "length bookindex: ", - contents["bookindex_seg"].length, + (contents["bookindex_seg"].length > 1) + ? (to!int(contents["bookindex_seg"].length)) + : 0, "length blurb: ", - contents["blurb"].length, + (contents["blurb"].length > 1) + ? (to!int(contents["blurb"].length)) + : 0, __FILE__, __LINE__, ); diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index f60fa60..851d375 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -2322,30 +2322,15 @@ template SiSUdocAbstraction() { string[string] obj_txt; int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; string obj_txt_out, tail, note; + auto rgx = Rgx(); + auto mkup = InlineMarkup(); private auto initialize_note_numbers() { n_foot = 0; n_foot_reg = 0; n_foot_sp_asterisk = 0; n_foot_sp_plus = 0; } - private auto object_notes_(string obj_txt_in) - in { } - body { - auto rgx = Rgx(); - auto mkup = InlineMarkup(); - obj_txt_out = ""; - tail = ""; - obj_txt_in = replaceAll( - obj_txt_in, - rgx.inline_notes_curly_sp_asterisk, - (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c) - ); - obj_txt_in = - replaceAll( - obj_txt_in, - rgx.inline_notes_curly_sp_plus, - (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) - ); + string url_links(string obj_txt_in) { /+ url matched +/ if (auto m = matchAll(obj_txt_in, rgx.inline_url)) { /+ link: naked url: http://url +/ @@ -2388,6 +2373,9 @@ template SiSUdocAbstraction() { ); } } + return obj_txt_in; + } + string footnotes_endnotes(string obj_txt_in) { /+ endnotes (regular) +/ obj_txt_in = replaceAll( @@ -2417,6 +2405,30 @@ template SiSUdocAbstraction() { } else { obj_txt_out = obj_txt_in; } + return obj_txt_in; + } + private auto object_notes_(string obj_txt_in) + in { } + body { + obj_txt_out = ""; + tail = ""; + /+ special endnotes +/ + obj_txt_in = replaceAll( + obj_txt_in, + rgx.inline_notes_curly_sp_asterisk, + (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c) + ); + obj_txt_in = + replaceAll( + obj_txt_in, + rgx.inline_notes_curly_sp_plus, + (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) + ); + /+ url matched +/ + if (auto m = matchAll(obj_txt_in, rgx.inline_url)) { + obj_txt_in = url_links(obj_txt_in); + } + obj_txt_in = footnotes_endnotes(obj_txt_in); debug(footnotes) { writeln(obj_txt_out, tail); } diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d index 7764af4..3c3b101 100644 --- a/src/sdp/ao_output_debugs.d +++ b/src/sdp/ao_output_debugs.d @@ -522,24 +522,38 @@ template SiSUoutputDebugs() { } } writefln( - "%s\n\"%s\", %s\n%s\n%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s:%s\n", - "-------------------------------", + "%s\n\"%s\", %s\n%s\n%s\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n%s%10d\n(%s: %s)", + "---------------------------------", dochead_meta["title"]["full"], dochead_meta["creator"]["author"], - "-------------------------------", fn_src, + "---------------------------------", + "length toc array: ", + to!int(contents["toc_seg"].length), "length contents array: ", - contents["body"].length, + to!int(contents["body"].length), "last obj_cite_number: ", - check["last_obj_cite_number"], + to!int(check["last_obj_cite_number"]), + "length endnotes: ", + (contents["endnotes_seg"].length > 1) + ? (to!int(contents["endnotes_seg"].length)) + : 0, "length glossary: ", - contents["glossary"].length, + (contents["glossary"].length > 1) + ? (to!int(contents["glossary"].length)) + : 0, "length biblio: ", - contents["bibliography"].length, + (contents["bibliography"].length > 1) + ? (to!int(contents["bibliography"].length)) + : 0, "length bookindex: ", - contents["bookindex_seg"].length, + (contents["bookindex_seg"].length > 1) + ? (to!int(contents["bookindex_seg"].length)) + : 0, "length blurb: ", - contents["blurb"].length, + (contents["blurb"].length > 1) + ? (to!int(contents["blurb"].length)) + : 0, __FILE__, __LINE__, ); -- cgit v1.2.3