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 --- org/ao_abstract_doc_source.org | 50 ++----- org/ao_conf_make_meta.org | 321 +++++++++++++++++++++++++++++++++++++++++ org/ao_defaults.org | 14 +- org/ao_output_debugs.org | 39 ++++- org/output.org | 69 ++++++++- org/sdp.org | 144 ++++++++---------- 6 files changed, 504 insertions(+), 133 deletions(-) (limited to 'org') diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index 75c581d..2fe674b 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -752,7 +752,7 @@ auto bookindex_section = bi_tuple[0]; obj_cite_number = bi_tuple[1]; debug(bookindex) { // bookindex foreach (bi_entry; bookindex_section) { - writeln(bi_entry["obj"]); + writeln(bi_entry); } } #+END_SRC @@ -2971,39 +2971,7 @@ struct BookIndexNuggetHash { } #+END_SRC -**** book index report :report: - -#+name: ao_emitters -#+BEGIN_SRC d -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; - } -} -#+END_SRC - -**** book index report indented :report:indented: +**** book index (sort &) report indented :report:indented: #+name: ao_emitters #+BEGIN_SRC d @@ -3036,7 +3004,7 @@ struct BookIndexReportIndent { } #+END_SRC -**** book index report section :report:section: +**** book index (sort &) report section :report:section: #+name: ao_emitters #+BEGIN_SRC d @@ -3069,6 +3037,12 @@ struct BookIndexReportSection { ++mkn; } } +#+END_SRC + +**** book index (sort &) build section :report:section: + +#+name: ao_emitters +#+BEGIN_SRC d auto bookindex_build_section( string[][string][string] bookindex_unordered_hashes, int obj_cite_number @@ -3161,6 +3135,12 @@ struct BookIndexReportSection { auto t = tuple(bookindex_section, obj_cite_number); return t; } +#+END_SRC + +**** book index (sort &) build section :report:section: + +#+name: ao_emitters +#+BEGIN_SRC d auto bookindex_build_section_( string[][string][string] bookindex_unordered_hashes ) { diff --git a/org/ao_conf_make_meta.org b/org/ao_conf_make_meta.org index f660147..38510c6 100644 --- a/org/ao_conf_make_meta.org +++ b/org/ao_conf_make_meta.org @@ -51,6 +51,107 @@ private auto configSettingsSDLangToAAmake(Tag conf_sdlang) { 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 @@ -520,6 +621,20 @@ private auto headerSDLangToAAmake(Tag header_sdlang, string[string][string] doch 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)) { @@ -536,6 +651,141 @@ private auto headerSDLangToAAmake(Tag header_sdlang, string[string][string] doch 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)) { @@ -550,6 +800,47 @@ private auto headerSDLangToAAmake(Tag header_sdlang, string[string][string] doch // 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"; @@ -560,6 +851,36 @@ private auto headerSDLangToAAmake(Tag header_sdlang, string[string][string] doch 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/org/ao_defaults.org b/org/ao_defaults.org index a6baeb4..78b1de8 100644 --- a/org/ao_defaults.org +++ b/org/ao_defaults.org @@ -507,6 +507,10 @@ template InternalMarkup() { * regex ctRegex :regex: [[./sdp.org][sdp]] [[./][org/]] +http://dlang.org/phobos/std_regex.html +- Plain string, in which case it's compiled to bytecode before matching. +- Regex!char (wchar/dchar) that contains a pattern in the form of compiled bytecode. +- StaticRegex!char (wchar/dchar) that contains a pattern in the form of compiled native machine code. ** misc :misc: @@ -620,7 +624,7 @@ static para_attribs = ctRegex!(`^_(([0-9])(_([0-9]))?|_([1-9])?[*]) `); #+name: ao_rgx #+BEGIN_SRC d /+ 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)"); #+END_SRC @@ -630,9 +634,9 @@ static block_poem_open = ctRegex!("^((poem[{].*?$)|`{3} poem)"); #+name: ao_rgx #+BEGIN_SRC d /+ 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)"); @@ -646,9 +650,9 @@ static block_tic_close = ctRegex!("^(`{3})$","m"); #+name: ao_rgx #+BEGIN_SRC d /+ 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/org/ao_output_debugs.org b/org/ao_output_debugs.org index 0f001e1..d5d8177 100644 --- a/org/ao_output_debugs.org +++ b/org/ao_output_debugs.org @@ -14,6 +14,40 @@ * output debugs :debug:output: [[./sdp.org][sdp]] [[./][org/]] + +** book index (sort &) report :report: + +#+name: book_index_sorted_report +#+BEGIN_SRC d +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; + } +} +#+END_SRC + ** (parent) :parent: #+name: ao_output_debugs @@ -477,13 +511,14 @@ debug(checkdoc) { ao_output_debugs.d +/ template SiSUoutputDebugs() { + <> 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/org/output.org b/org/output.org index 69779f2..773aeef 100644 --- a/org/output.org +++ b/org/output.org @@ -15,7 +15,8 @@ [[./sdp.org][sdp]] [[./][org/]] * output :output: ** text :text: -** html :html: +** html [#A] :html: +*** open #+name: output_html #+BEGIN_SRC d @@ -1456,8 +1457,6 @@ struct SDPoutputHTML { string fn_src, bool[string] opt_action_bool ) { - mixin ScreenTxtColors; - mixin RgxInit; auto rgx = Rgx(); string[] toc; string[] body_; @@ -1521,14 +1520,72 @@ struct SDPoutputHTML { // Handle error } } +#+END_SRC + +*** close + +#+name: output_html +#+BEGIN_SRC d } #+END_SRC -** epub :epub: +** epub [#B] :epub: ** pdf :pdf: ** odt :odt: -** sqlite :sqlite: +** sqlite [#B] :sqlite: ** pgsql :pgsql: +** TODO check selection :output: + +#+NAME: output_selection +#+BEGIN_SRC d +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"); + } + } +} +#+END_SRC + * tangles :tangle: ** code structure: :output.d: @@ -1538,10 +1595,12 @@ struct SDPoutputHTML { output_hub.d +/ template SiSUoutputHub() { + <> <> } #+END_SRC +* +other+ ** example head diff --git a/org/sdp.org b/org/sdp.org index 4eec38d..b06c7ef 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -24,7 +24,7 @@ struct Version { int minor; int patch; } -enum ver = Version(0, 6, 2); +enum ver = Version(0, 6, 3); #+END_SRC * sdp.d sisu document parser :sdp.d: @@ -84,7 +84,11 @@ import [[./ao_rgx.org][ao_rgx]] [[./output_hub.org][output hub]] -**** sdlang :import:sdlang: +**** TODO sdlang :import:sdlang: +keep up to date, configuration in ../maker.org +check: +- http://github.com/Abscissa/SDLang-D +- https://github.com/abscissa/libInputVisitor #+NAME: imports_sdlang #+BEGIN_SRC d @@ -151,64 +155,6 @@ mixin SiSUoutputHub; mixin ScreenTxtColors; #+END_SRC -*** sdp output check selection :output: - -#+NAME: sdp_output_selection -#+BEGIN_SRC d -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_; - } -} -#+END_SRC - - *** init :init: #+NAME: sdp_args @@ -233,7 +179,7 @@ string arg_unrecognized; auto rgx = Rgx(); #+END_SRC -*** scope :scope: +*** scope (run complete) :scope: #+NAME: sdp_args #+BEGIN_SRC d @@ -251,8 +197,7 @@ scope(success) { scope(failure) { debug(checkdoc) { stderr.writefln( - "%s~ run failure ~%s", - scr_txt_color["fuchsia"], scr_txt_color["off"], + "run failure", ); } } @@ -342,7 +287,7 @@ auto conf_doc_make_aa = confsdl.documentMakeSDLangToAAmake(sdl_root_doc_make); ** each file (loop) [+2] :loop:files: *** filename provided [+1] :file:process: -**** loop scope :scope: +**** scope (loop) :scope: #+NAME: sdp_each_file_do #+BEGIN_SRC d @@ -445,7 +390,7 @@ output.hub( ); #+END_SRC -**** on exit :scope:exit: +**** scope (on loop exit) :scope:exit: #+NAME: sdp_each_file_do #+BEGIN_SRC d @@ -529,7 +474,7 @@ void main(string[] args) { ** program dir structure figure out best program dir structure for dub and compilers, issue with rdmd -** sisu file structure +** sisu document structure |---------------------+------------------------------------------+------------------------+--------| | header | sisu /header markup/ | markup | | @@ -561,6 +506,7 @@ figure out best program dir structure for dub and compilers, issue with rdmd ** config :config: using sdlang in sdp + *** sdp config and header? file format? sdl ? yml ? json ? :sdl:sdlang: [[https://sdlang.org/][SDL: Simple Declarative Language]] [[http://sdl4r.rubyforge.org/syntaxhighlighter_brush.html][highlighter]] @@ -610,27 +556,31 @@ http://forum.dlang.org/thread/gnfctbuhiemidetngrzi@forum.dlang.org?page=23#post- *** other links http://semitwist.com/sdlang-d-docs/v0.9.3/sdlang.html http://semitwist.com/sdlang-d-docs/ -** read markup files -**** regular .sst -relatively straight forward -**** master .ssm -master files have been able to read in inser files .ssi and regular files .sst -***** reading in .ssi files is straightforward -***** reading in .sst files is more problematic -.sst files have their own root (structure) -either -- the root needs to be disabled - not used -or -- the root tree needs to be demoted, which is only possible if markup from - heading D is not reached then A - C could be demoted to B - D -- the other issue there is that it is common not to write out heading level A - text but to rely on the metadata for title and author, the issue there is that - at present the header for .sst files that are imported is just lopped off and - thrown away. At least the title and author information for each imported .sst - file would have to read and available for use in its header A that is demoted - to B +** markup +*** code + +#+BEGIN_SRC txt :tangle no +code.ruby{ + +}code + +code.python{ + +}code + +code.sh{ + +}code + +code.txt{ + +}code + +code.d{ + +}code +#+END_SRC -** processing files, currently using utf8 ** src dir structure & files #+BEGIN_SRC txt :tangle no tree /home/ralph/sisu_www/current/src/democratizing_innovation.eric_von_hippel.sst @@ -653,7 +603,29 @@ democratizing_innovation.eric_von_hippel.sst #+END_SRC +** read markup files +**** regular .sst +relatively straight forward +**** master .ssm +master files have been able to read in inser files .ssi and regular files .sst +***** reading in .ssi files is straightforward +***** reading in .sst files is more problematic +.sst files have their own root (structure) +either +- the root needs to be disabled - not used +or +- the root tree needs to be demoted, which is only possible if markup from + heading D is not reached then A - C could be demoted to B - D +- the other issue there is that it is common not to write out heading level A + text but to rely on the metadata for title and author, the issue there is that + at present the header for .sst files that are imported is just lopped off and + thrown away. At least the title and author information for each imported .sst + file would have to read and available for use in its header A that is demoted + to B + +** processing files, currently using utf8 ** check + #+BEGIN_SRC text ./.sisu ./_sisu ~/.sisu /etc/.sisu #+END_SRC -- cgit v1.2.3