From c7c6c121884feb55ae3964e6055ac8ca983458cd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 20 Aug 2016 08:57:12 -0400 Subject: step 0.6.3 includes fixes --- src/sdp.d | 55 +------ src/sdp/ao_abstract_doc_source.d | 28 +--- src/sdp/ao_conf_make_meta_sdlang.d | 321 +++++++++++++++++++++++++++++++++++++ src/sdp/ao_output_debugs.d | 31 +++- src/sdp/ao_rgx.d | 10 +- src/sdp/output_hub.d | 48 +++++- 6 files changed, 404 insertions(+), 89 deletions(-) (limited to 'src') diff --git a/src/sdp.d b/src/sdp.d index f03b7de..afc87a0 100755 --- a/src/sdp.d +++ b/src/sdp.d @@ -37,57 +37,7 @@ private import std.typecons, std.utf, std.conv : to; -struct SDPoutput { - auto hub(S)( - auto ref const S contents, - string[][string][string] bookindex_unordered_hashes, - JSONValue[] biblio, - string[string][string] dochead_make_json, - string[string][string] dochead_meta_json, - string fn_src, - bool[string] opt_action_bool - ) { - mixin ScreenTxtColors; - mixin RgxInit; - mixin SiSUoutputHub; - auto rgx = Rgx(); - uint return_ = 0; - if (opt_action_bool["source"]) { - writeln("sisupod source"); - } - if (opt_action_bool["sisupod"]) { - writeln("sisupod source"); - } - if (opt_action_bool["text"]) { - writeln("text processing"); - // auto text=SDPoutput_text(); - // text.scroll(contents, bookindex_unordered_hashes, biblio, fn_src, opt_action_bool); - // // text.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); - } - if (opt_action_bool["html"]) { - auto html=SDPoutputHTML(); - html.css_write; - html.scroll(contents, bookindex_unordered_hashes, biblio, fn_src, opt_action_bool); - // html.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make_aa, dochead_meta_aa, fn_src, opt_action_bool); - } - if (opt_action_bool["epub"]) { - writeln("epub processing"); - } - if (opt_action_bool["pdf"]) { - writeln("pdf processing"); - } - if (opt_action_bool["odt"]) { - writeln("odt processing"); - } - if (opt_action_bool["sqlite"]) { - writeln("sqlite processing"); - } - if (opt_action_bool["postgresql"]) { - writeln("pgsql processing"); - } - return return_; - } -} + mixin(import("version.txt")); mixin CompileTimeInfo; mixin RgxInit; @@ -135,8 +85,7 @@ void main(string[] args) { scope(failure) { debug(checkdoc) { stderr.writefln( - "%s~ run failure ~%s", - scr_txt_color["fuchsia"], scr_txt_color["off"], + "run failure", ); } } diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index 067e920..5095dab 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -538,7 +538,7 @@ template SiSUdocAbstraction() { obj_cite_number = bi_tuple[1]; debug(bookindex) { // bookindex foreach (bi_entry; bookindex_section) { - writeln(bi_entry["obj"]); + writeln(bi_entry); } } auto document_the = @@ -2509,32 +2509,6 @@ template SiSUdocAbstraction() { invariant() { } } - struct BookIndexReport { - // class BookIndexReport : AssertBookIndexReport { - int mkn, skn; - auto bookindex_report_sorted( - string[][string][string] bookindex_unordered_hashes - ) { - auto mainkeys=bookindex_unordered_hashes.byKey.array. - sort!("toLower(a) < toLower(b)", SwapStrategy.stable).release; - foreach (mainkey; mainkeys) { - auto subkeys=bookindex_unordered_hashes[mainkey].byKey.array. - sort!("toLower(a) < toLower(b)", SwapStrategy.stable).release; - foreach (subkey; subkeys) { - debug(bookindex) { - writeln( - mainkey, ": ", - subkey, ": ", - to!string(bookindex_unordered_hashes[mainkey][subkey]) - ); - } - ++skn; - } - ++mkn; - } - // return bookindex_the; - } - } struct BookIndexReportIndent { int mkn, skn; auto bookindex_report_indented( diff --git a/src/sdp/ao_conf_make_meta_sdlang.d b/src/sdp/ao_conf_make_meta_sdlang.d index 16a36e9..612c88a 100644 --- a/src/sdp/ao_conf_make_meta_sdlang.d +++ b/src/sdp/ao_conf_make_meta_sdlang.d @@ -32,6 +32,107 @@ template SiSUheaderExtractSDLang() { private auto documentMakeSDLangToAAmake(Tag document_make_sdlang) { auto dochead_make = sdlangToAAmake(make_aa, document_make_sdlang); /+ + /+ dochead +/ + string hm; + string hs; + /+ make +/ + auto dochead_make = make_aa; + if (!(document_make_sdlang.maybe.tags["make"].empty)) { + hm = "make"; + hs = "bold"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "breaks"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "cover_image"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "css"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "emphasis"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "footer"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "headings"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "home_button_image"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "home_button_text"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "italics"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "num_top"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "substitute"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "texpdf_font"; + if (!(document_make_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (document_make_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_make[hm][hs] = + to!string(document_make_sdlang.tags[hm][0].attributes[hs][0].value); + } + } + +/ + /+ hm = "links"; if (!(document_make_sdlang.maybe.tags[hm].empty)) { /+ TODO @@ -153,6 +254,20 @@ template SiSUheaderExtractSDLang() { dochead_meta[hm][hs] = to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); } + hs = "edition"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "note"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } } hm = "creator"; if (!(header_sdlang.maybe.tags[hm].empty)) { @@ -169,6 +284,141 @@ template SiSUheaderExtractSDLang() { dochead_meta[hm][hs] = to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); } + hs = "author_email"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "illustrator"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "translator"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + } + hm = "classify"; + if (!(header_sdlang.maybe.tags[hm].empty)) { + hs = "dewey"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "keywords"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "loc"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "subject"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "topic_register"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + } + hm = "date"; + if (!(header_sdlang.maybe.tags[hm].empty)) { + hs = "added_to_site"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "available"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "created"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "issued"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "modified"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "published"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "valid"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + } + hm = "identifier"; + if (!(header_sdlang.maybe.tags[hm].empty)) { + hs = "isbn"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "oclc"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "pg"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } } hm = "links"; if (!(header_sdlang.maybe.tags[hm].empty)) { @@ -183,6 +433,47 @@ template SiSUheaderExtractSDLang() { // to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); // } } + hm = "notes"; + if (!(header_sdlang.maybe.tags[hm].empty)) { + hs = "abstract"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "description"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + } + hm = "original"; + if (!(header_sdlang.maybe.tags[hm].empty)) { + hs = "language"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "source"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "title"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + } hm = "publisher"; if (!(header_sdlang.maybe.tags[hm].empty)) { hs = "name"; @@ -193,6 +484,36 @@ template SiSUheaderExtractSDLang() { to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); } } + hm = "rights"; + if (!(header_sdlang.maybe.tags[hm].empty)) { + hs = "copyright"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "cover"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "illustrations"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } + hs = "license"; + if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) + && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { + writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); + dochead_meta[hm][hs] = + to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); + } } +/ auto t = tuple(dochead_make, dochead_meta); diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d index 68a2d40..be08ebe 100644 --- a/src/sdp/ao_output_debugs.d +++ b/src/sdp/ao_output_debugs.d @@ -3,13 +3,40 @@ ao_output_debugs.d +/ template SiSUoutputDebugs() { + struct BookIndexReport { + // class BookIndexReport : AssertBookIndexReport { + int mkn, skn; + auto bookindex_report_sorted( + string[][string][string] bookindex_unordered_hashes + ) { + auto mainkeys=bookindex_unordered_hashes.byKey.array. + sort!("toLower(a) < toLower(b)", SwapStrategy.stable).release; + foreach (mainkey; mainkeys) { + auto subkeys=bookindex_unordered_hashes[mainkey].byKey.array. + sort!("toLower(a) < toLower(b)", SwapStrategy.stable).release; + foreach (subkey; subkeys) { + debug(bookindex) { + writeln( + mainkey, ": ", + subkey, ": ", + to!string(bookindex_unordered_hashes[mainkey][subkey]) + ); + } + // bookindex_the[mkn][mainkey][skn][subkey] ~= (bookindex_unordered_hashes[mainkey][subkey]); + ++skn; + } + ++mkn; + } + // return bookindex_the; + } + } struct SDPoutputDebugs { auto abstract_doc_source_debugs(S)( auto ref const S contents, string[][string][string] bookindex_unordered_hashes, JSONValue[] biblio, - JSONValue[string] dochead_make, - JSONValue[string] dochead_meta, + string[string][string] dochead_make, + string[string][string] dochead_meta, string fn_src, bool[string] opt_action_bool ) { diff --git a/src/sdp/ao_rgx.d b/src/sdp/ao_rgx.d index bb032ea..15f9ed9 100644 --- a/src/sdp/ao_rgx.d +++ b/src/sdp/ao_rgx.d @@ -76,13 +76,13 @@ template RgxInit() { static para_indent_hang = ctRegex!(`^_([0-9])_([0-9]) `); static para_attribs = ctRegex!(`^_(([0-9])(_([0-9]))?|_([1-9])?[*]) `); /+ blocked markup +/ - static block_open = ctRegex!("^((code|poem|group|block|quote|table)[{].*?$)|^`{3} (code|poem|group|block|quote|table)"); + static block_open = ctRegex!("^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); // static block_open_less_code = ctRegex!("^(((poem|group|block|quote|table)[{].*?$)|`{3} (poem|group|block|quote|table))"); static block_poem_open = ctRegex!("^((poem[{].*?$)|`{3} poem)"); /+ blocked markup tics +/ - static block_tic_open = ctRegex!("^`{3} (code|poem|group|block|quote|table)"); + static block_tic_open = ctRegex!("^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); // static block_tic_open_less_code = ctRegex!("^`{3} (poem|group|block|quote|table)"); - static block_tic_code_open = ctRegex!("^`{3} (code)"); + static block_tic_code_open = ctRegex!("^`{3} (code)([.][a-z][0-9a-z_]+)?"); static block_tic_poem_open = ctRegex!("^`{3} (poem)"); static block_tic_group_open = ctRegex!("^`{3} (group)"); static block_tic_block_open = ctRegex!("^`{3} (block)"); @@ -90,9 +90,9 @@ template RgxInit() { static block_tic_table_open = ctRegex!("^`{3} (table)"); static block_tic_close = ctRegex!("^(`{3})$","m"); /+ blocked markup curly +/ - static block_curly_open = ctRegex!(`^((code|poem|group|block|quote|table)[{].*?$)`); + static block_curly_open = ctRegex!(`^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)`); // static block_curly_open_less_code = ctRegex!(`^((poem|group|block|quote|table)[{].*?$)`); - static block_curly_code_open = ctRegex!(`^(code[{].*?$)`); + static block_curly_code_open = ctRegex!(`^(code([.][a-z][0-9a-z_]+)?[{].*?$)`); static block_curly_code_close = ctRegex!(`^([}]code)`); static block_curly_poem_open = ctRegex!(`^(poem[{].*?$)`); static block_curly_poem_close = ctRegex!(`^([}]poem)`); diff --git a/src/sdp/output_hub.d b/src/sdp/output_hub.d index f81c118..28784a3 100644 --- a/src/sdp/output_hub.d +++ b/src/sdp/output_hub.d @@ -3,6 +3,52 @@ output_hub.d +/ template SiSUoutputHub() { + struct SDPoutput { + void hub(S)( + auto ref const S contents, + string[][string][string] bookindex_unordered_hashes, + JSONValue[] biblio, + string[string][string] dochead_make_json, + string[string][string] dochead_meta_json, + string fn_src, + bool[string] opt_action_bool + ) { + auto rgx = Rgx(); + if (opt_action_bool["source"]) { + writeln("sisupod source"); + } + if (opt_action_bool["sisupod"]) { + writeln("sisupod source"); + } + if (opt_action_bool["text"]) { + writeln("text processing"); + // auto text=SDPoutput_text(); + // text.scroll(contents, bookindex_unordered_hashes, biblio, fn_src, opt_action_bool); + // // text.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); + } + if (opt_action_bool["html"]) { + auto html=SDPoutputHTML(); + html.css_write; + html.scroll(contents, bookindex_unordered_hashes, biblio, fn_src, opt_action_bool); + // html.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make_aa, dochead_meta_aa, fn_src, opt_action_bool); + } + if (opt_action_bool["epub"]) { + writeln("epub processing"); + } + if (opt_action_bool["pdf"]) { + writeln("pdf processing"); + } + if (opt_action_bool["odt"]) { + writeln("odt processing"); + } + if (opt_action_bool["sqlite"]) { + writeln("sqlite processing"); + } + if (opt_action_bool["postgresql"]) { + writeln("pgsql processing"); + } + } + } struct SDPoutputHTML { auto html_css() { string css; @@ -1415,8 +1461,6 @@ template SiSUoutputHub() { string fn_src, bool[string] opt_action_bool ) { - mixin ScreenTxtColors; - mixin RgxInit; auto rgx = Rgx(); string[] toc; string[] body_; -- cgit v1.2.3