diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sdp/meta/composite_make.d (renamed from src/sdp/ao/composite_make.d) | 6 | ||||
-rw-r--r-- | src/sdp/meta/conf_make_meta.d (renamed from src/sdp/ao/conf_make_meta.d) | 8 | ||||
-rw-r--r-- | src/sdp/meta/conf_make_meta_native.d (renamed from src/sdp/ao/conf_make_meta_native.d) | 6 | ||||
-rw-r--r-- | src/sdp/meta/conf_make_meta_sdlang.d (renamed from src/sdp/ao/conf_make_meta_sdlang.d) | 6 | ||||
-rw-r--r-- | src/sdp/meta/defaults.d (renamed from src/sdp/ao/defaults.d) | 2 | ||||
-rw-r--r-- | src/sdp/meta/doc_debugs.d (renamed from src/sdp/ao/doc_debugs.d) | 6 | ||||
-rw-r--r-- | src/sdp/meta/metadoc.d (renamed from src/sdp/ao/abstraction.d) | 26 | ||||
-rw-r--r-- | src/sdp/meta/metadoc_from_src.d (renamed from src/sdp/ao/abstract_doc_source.d) | 268 | ||||
-rw-r--r-- | src/sdp/meta/metadoc_summary.d (renamed from src/sdp/ao/abstraction_summary.d) | 6 | ||||
-rw-r--r-- | src/sdp/meta/object_setter.d (renamed from src/sdp/ao/object_setter.d) | 5 | ||||
-rw-r--r-- | src/sdp/meta/package.d (renamed from src/sdp/ao/package.d) | 6 | ||||
-rw-r--r-- | src/sdp/meta/read_config_files.d (renamed from src/sdp/ao/read_config_files.d) | 10 | ||||
-rw-r--r-- | src/sdp/meta/read_source_files.d (renamed from src/sdp/ao/read_source_files.d) | 10 | ||||
-rw-r--r-- | src/sdp/meta/rgx.d (renamed from src/sdp/ao/rgx.d) | 4 | ||||
-rw-r--r-- | src/sdp/output/paths_output.d | 2 | ||||
-rw-r--r-- | src/sdp/output/paths_source.d | 4 | ||||
-rwxr-xr-x | src/sdp/sdp.d | 26 |
17 files changed, 223 insertions, 178 deletions
diff --git a/src/sdp/ao/composite_make.d b/src/sdp/meta/composite_make.d index c9df4a8..dc28206 100644 --- a/src/sdp/ao/composite_make.d +++ b/src/sdp/meta/composite_make.d @@ -2,9 +2,9 @@ output hub<BR> check & generate output types requested +/ -module sdp.ao.composite_make; +module sdp.meta.composite_make; template compositeMkCnf() { - import sdp.ao; + import sdp.meta; import std.array; mixin SiSUrgxInit; string[] _substitutions; @@ -73,7 +73,7 @@ template compositeMkCnf() { check & generate output types requested +/ template compositeMkCnfAA() { - import sdp.ao; + import sdp.meta; import std.array; mixin SiSUrgxInit; string[] _substitutions; diff --git a/src/sdp/ao/conf_make_meta.d b/src/sdp/meta/conf_make_meta.d index 1d7d86d..5beeae2 100644 --- a/src/sdp/ao/conf_make_meta.d +++ b/src/sdp/meta/conf_make_meta.d @@ -8,7 +8,7 @@ converting the metadata and make instructions to a common json format used by program internally. Moved to associative array. +/ -module sdp.ao.conf_make_meta; +module sdp.meta.conf_make_meta; template docHeaderMakeAndMetaTupExtractAndConvertToAA() { import std.exception, @@ -20,9 +20,9 @@ template docHeaderMakeAndMetaTupExtractAndConvertToAA() { std.conv : to; import sdlang; import - sdp.ao.conf_make_meta_native, - sdp.ao.conf_make_meta_sdlang, - sdp.ao.rgx; + sdp.meta.conf_make_meta_native, + sdp.meta.conf_make_meta_sdlang, + sdp.meta.rgx; mixin SiSUrgxInit; mixin SiSUheaderExtractNative; mixin SiSUextractSDLang; diff --git a/src/sdp/ao/conf_make_meta_native.d b/src/sdp/meta/conf_make_meta_native.d index aae0b4d..fc7912f 100644 --- a/src/sdp/ao/conf_make_meta_native.d +++ b/src/sdp/meta/conf_make_meta_native.d @@ -2,7 +2,7 @@ native headers using<br>@title:<BR>:subtitle:<BR>type tags<BR> extract native/orig header return associative array +/ -module sdp.ao.conf_make_meta_native; +module sdp.meta.conf_make_meta_native; template SiSUheaderExtractNative() { import std.exception, @@ -14,8 +14,8 @@ template SiSUheaderExtractNative() { std.utf, std.conv : to; import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; struct HeaderDocMetadataAndMakeNativeToAA { mixin SiSUregisters; mixin SiSUrgxInitFlags; diff --git a/src/sdp/ao/conf_make_meta_sdlang.d b/src/sdp/meta/conf_make_meta_sdlang.d index f9fb17d..f4af643 100644 --- a/src/sdp/ao/conf_make_meta_sdlang.d +++ b/src/sdp/meta/conf_make_meta_sdlang.d @@ -2,7 +2,7 @@ sdlang headers<BR> extract sdlang header return sdlang +/ -module sdp.ao.conf_make_meta_sdlang; +module sdp.meta.conf_make_meta_sdlang; template SiSUextractSDLang() { import std.exception, @@ -14,8 +14,8 @@ template SiSUextractSDLang() { std.utf, std.conv : to; import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; struct extractSDL { mixin SiSUregisters; mixin SiSUrgxInit; diff --git a/src/sdp/ao/defaults.d b/src/sdp/meta/defaults.d index caee701..fb95e3a 100644 --- a/src/sdp/ao/defaults.d +++ b/src/sdp/meta/defaults.d @@ -1,7 +1,7 @@ /++ default settings +/ -module sdp.ao.defaults; +module sdp.meta.defaults; template SiSUregisters() { import std.algorithm, diff --git a/src/sdp/ao/doc_debugs.d b/src/sdp/meta/doc_debugs.d index 87a64f4..6d94b05 100644 --- a/src/sdp/ao/doc_debugs.d +++ b/src/sdp/meta/doc_debugs.d @@ -1,11 +1,11 @@ /++ output debugs +/ -module sdp.ao.doc_debugs; +module sdp.meta.doc_debugs; template SiSUdebugs() { import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; import std.algorithm, std.array, diff --git a/src/sdp/ao/abstraction.d b/src/sdp/meta/metadoc.d index b25f354..4174b67 100644 --- a/src/sdp/ao/abstraction.d +++ b/src/sdp/meta/metadoc.d @@ -1,22 +1,22 @@ -module sdp.ao.abstraction; +module sdp.meta.metadoc; template SiSUabstraction() { /+ sdp: sisu document parser, see http://sisudoc.org +/ - import sdp.ao; + import sdp.meta; import std.getopt, std.process; import - sdp.ao.abstraction_summary, - sdp.ao.abstract_doc_source, - sdp.ao.composite_make, - sdp.ao.conf_make_meta, - // sdp.ao.conf_make_meta_native, - sdp.ao.conf_make_meta_sdlang, - sdp.ao.defaults, - sdp.ao.doc_debugs, - sdp.ao.read_config_files, - sdp.ao.read_source_files, - sdp.ao.rgx, + sdp.meta.metadoc_summary, + sdp.meta.metadoc_from_src, + sdp.meta.composite_make, + sdp.meta.conf_make_meta, + // sdp.meta.conf_make_meta_native, + sdp.meta.conf_make_meta_sdlang, + sdp.meta.defaults, + sdp.meta.doc_debugs, + sdp.meta.read_config_files, + sdp.meta.read_source_files, + sdp.meta.rgx, sdp.output.hub, sdp.output.paths_source; mixin SiSUrgxInit; diff --git a/src/sdp/ao/abstract_doc_source.d b/src/sdp/meta/metadoc_from_src.d index f935df3..ab7f883 100644 --- a/src/sdp/ao/abstract_doc_source.d +++ b/src/sdp/meta/metadoc_from_src.d @@ -1,12 +1,12 @@ /++ document abstraction: abstraction of sisu markup for downstream processing - ao_abstract_doc_source.d + meta_metadoc_from_src.d +/ -module sdp.ao.abstract_doc_source; +module sdp.meta.metadoc_from_src; template SiSUdocAbstraction() { /+ ↓ abstraction imports +/ - import sdp.ao; + import sdp.meta; import std.algorithm, std.container, @@ -14,9 +14,9 @@ template SiSUdocAbstraction() { std.json, std.path; import - sdp.ao.defaults, - sdp.ao.object_setter, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.object_setter, + sdp.meta.rgx; /+ ↓ abstraction mixins +/ mixin ObjectSetter; mixin InternalMarkup; @@ -74,59 +74,64 @@ template SiSUdocAbstraction() { int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; int[] dom_collapsed_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,]; enum DomTags { none, open, close, close_and_open, open_still, } - void heading_ancestors(O)( - auto return ref O obj, - return ref string[] lv_ancestors, + auto obj_heading_ancestors(O)( + O obj, + string[] lv_ancestors_txt, ) { switch (obj.heading_lev_markup) { case 0: - lv_ancestors[0] = obj.text.to!string; + lv_ancestors_txt[0] = obj.text.to!string; foreach(k; 1..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 1: - lv_ancestors[1] = obj.text.to!string; + lv_ancestors_txt[1] = obj.text.to!string; foreach(k; 2..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 2: - lv_ancestors[2] = obj.text.to!string; + lv_ancestors_txt[2] = obj.text.to!string; foreach(k; 3..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 3: - lv_ancestors[3] = obj.text.to!string; + lv_ancestors_txt[3] = obj.text.to!string; foreach(k; 4..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 4: - lv_ancestors[4] = obj.text.to!string; + lv_ancestors_txt[4] = obj.text.to!string; foreach(k; 5..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 5: - lv_ancestors[5] = obj.text.to!string; + lv_ancestors_txt[5] = obj.text.to!string; foreach(k; 6..8) { - lv_ancestors[k] = ""; + lv_ancestors_txt[k] = ""; } goto default; case 6: - lv_ancestors[6] = obj.text.to!string; - lv_ancestors[7] = ""; + lv_ancestors_txt[6] = obj.text.to!string; + lv_ancestors_txt[7] = ""; goto default; case 7: - lv_ancestors[7] = obj.text.to!string; + lv_ancestors_txt[7] = obj.text.to!string; goto default; default: - obj.heading_ancestors_text = lv_ancestors.dup; + obj.heading_ancestors_text = lv_ancestors_txt.dup; } + return obj; } - auto dom_set_markup_tags(int[] dom, int lev) { + auto obj_dom_set_markup_tags(O)( + O obj, + int[] dom, + int lev + ) { foreach (i; 0 .. 8) { if (i < lev) { if (dom[i] == DomTags.open @@ -163,9 +168,14 @@ template SiSUdocAbstraction() { debug(dom_magic_numbers) { writeln("marked up: ", lev, ": ", dom); } - return dom; + obj.dom_markedup = dom.dup; + return obj; } - auto dom_set_collapsed_tags(int[] dom, int lev) { + auto obj_dom_set_collapsed_tags(O)( + O obj, + int[] dom, + int lev + ) { foreach (i; 0 .. 8) { if (i < lev) { if (dom[i] == DomTags.open @@ -202,7 +212,8 @@ template SiSUdocAbstraction() { debug(dom_magic_numbers) { writeln("collapsed: ", lev, ": ", dom); } - return dom; + obj.dom_collapsed = dom.dup; + return obj; } int ocn_emit(int ocn_status_flag) { return object_citation_number.ocn_emitter(ocn_status_flag); @@ -260,7 +271,7 @@ template SiSUdocAbstraction() { "start" : "", "end" : "" ]; - string[] lv_ancestors = [ "", "", "", "", "", "", "", "", ]; + string[] lv_ancestors_txt = [ "", "", "", "", "", "", "", "", ]; int[string] lv = [ "lv" : State.off, "h0" : State.off, @@ -322,6 +333,8 @@ template SiSUdocAbstraction() { comp_obj_heading_.parent_lev_markup = 0; comp_obj_heading_.ptr_html_segnames = html_segnames_ptr; comp_obj_heading_.anchor_tags = ["toc"]; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; auto toc_head = comp_obj_heading_; html_segnames_ptr_cntr++; the_table_of_contents_section = [ @@ -430,6 +443,8 @@ template SiSUdocAbstraction() { comp_obj_heading_.heading_lev_collapsed = 1; comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 0, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 0, 0, 0, 0, 0, 0]; the_glossary_section ~= comp_obj_heading_; comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.use = "backmatter"; @@ -444,6 +459,8 @@ template SiSUdocAbstraction() { comp_obj_heading_.heading_lev_collapsed = 2; comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; comp_obj_heading_.anchor_tags = ["glossary"]; the_glossary_section ~= comp_obj_heading_; } else { @@ -499,6 +516,8 @@ template SiSUdocAbstraction() { comp_obj_heading_.heading_lev_collapsed = 1; comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 0, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 0, 0, 0, 0, 0, 0]; the_blurb_section ~= comp_obj_heading_; comp_obj_heading_ = comp_obj_heading_.init; comp_obj_heading_.use = "backmatter"; @@ -514,6 +533,8 @@ template SiSUdocAbstraction() { comp_obj_heading_.parent_ocn = 1; comp_obj_heading_.parent_lev_markup = 0; comp_obj_heading_.anchor_tags = ["blurb"]; + comp_obj_heading_.dom_markedup = [ 1, 1, 0, 0, 1, 0, 0, 0]; + comp_obj_heading_.dom_collapsed = [ 1, 1, 1, 0, 0, 0, 0, 0]; the_blurb_section ~= comp_obj_heading_; } else if (line.matchFirst(rgx.heading) && (opt_action["backmatter"] && opt_action["section_blurb"])) { @@ -790,7 +811,7 @@ template SiSUdocAbstraction() { obj_cite_number, // int cntr, // int heading_ptr, // int - lv_ancestors, // string[] + lv_ancestors_txt, // string[] an_object["is"], // string html_segnames_ptr, // int substantive_object_and_anchor_tags_tuple[sObj.notes_reg], @@ -1288,19 +1309,21 @@ template SiSUdocAbstraction() { if (obj.heading_lev_markup <= 4) { segnames_0_4 ~= obj.segment_anchor_tag; } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } if (the_table_of_contents_section["scroll"].length > 1) { + /+ scroll +/ dom_markedup_buffer = dom_markedup.dup; dom_collapsed_buffer = dom_collapsed.dup; foreach (ref obj; the_table_of_contents_section["scroll"]) { @@ -1312,18 +1335,20 @@ template SiSUdocAbstraction() { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } + /+ seg +/ dom_markedup = dom_markedup_buffer.dup; dom_collapsed = dom_collapsed_buffer.dup; foreach (ref obj; the_table_of_contents_section["seg"]) { @@ -1342,12 +1367,10 @@ template SiSUdocAbstraction() { || (opt_action["html-scroll"]) || (opt_action["html-seg"]) || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } @@ -1369,16 +1392,17 @@ template SiSUdocAbstraction() { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } else if (obj.is_a == "para") { _images ~= extract_images(obj.text); } @@ -1406,16 +1430,17 @@ template SiSUdocAbstraction() { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } @@ -1436,16 +1461,17 @@ template SiSUdocAbstraction() { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } @@ -1466,21 +1492,23 @@ template SiSUdocAbstraction() { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } /+ optional only one 1~ level +/ if (the_bookindex_section["scroll"].length > 1) { + /+ scroll +/ dom_markedup_buffer = dom_markedup.dup; dom_collapsed_buffer = dom_collapsed.dup; foreach (ref obj; the_bookindex_section["scroll"]) { @@ -1497,18 +1525,20 @@ template SiSUdocAbstraction() { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } + /+ seg +/ dom_markedup = dom_markedup_buffer.dup; dom_collapsed = dom_collapsed_buffer.dup; foreach (ref obj; the_bookindex_section["seg"]) { @@ -1526,16 +1556,17 @@ template SiSUdocAbstraction() { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } } @@ -1556,42 +1587,47 @@ template SiSUdocAbstraction() { assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]); } } + /+ dom structure (marked up & collapsed) +/ if ((opt_action["html"]) || (opt_action["html-scroll"]) || (opt_action["html-seg"]) - || (opt_action["epub"])) { - obj.dom_markedup = - dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = - dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + || (opt_action["epub"]) + || (opt_action["sqlite"]) + || (opt_action["postgresql"])) { + obj = obj_dom_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup); + obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed); } - heading_ancestors(obj, lv_ancestors); + obj = obj_heading_ancestors(obj, lv_ancestors_txt); } } + } /+ TODO - note create/insert heading object sole purpose eof close all open tags sort out: - obj.dom_markedup = dom_markedup; - obj.dom_collapsed = dom_collapsed; +/ - dom_markedup = dom_set_markup_tags(dom_markedup, 0); - dom_collapsed = dom_set_collapsed_tags(dom_collapsed, 0); - comp_obj_heading_ = comp_obj_heading_.init; - comp_obj_heading_.use = "empty"; - comp_obj_heading_.is_of = "para"; - comp_obj_heading_.is_a = "heading"; - comp_obj_heading_.ocn = 0; - comp_obj_para.obj_cite_number = ""; - comp_obj_heading_.segment_anchor_tag = ""; - comp_obj_heading_.marked_up_level = ""; - comp_obj_heading_.heading_lev_markup = 9; - comp_obj_heading_.heading_lev_collapsed = 9; - comp_obj_heading_.parent_ocn = 0; - comp_obj_heading_.parent_lev_markup = 0; - comp_obj_heading_.dom_markedup = dom_markedup.dup; - comp_obj_heading_.dom_collapsed = dom_collapsed.dup; - the_dom_tail_section ~= comp_obj_heading_; - } + comp_obj_heading_ = comp_obj_heading_.init; + comp_obj_heading_.use = "empty"; + comp_obj_heading_.is_of = "para"; + comp_obj_heading_.is_a = "heading"; + comp_obj_heading_.ocn = 0; + comp_obj_para.obj_cite_number = ""; + comp_obj_heading_.segment_anchor_tag = ""; + comp_obj_heading_.marked_up_level = ""; + comp_obj_heading_.heading_lev_markup = 9; + comp_obj_heading_.heading_lev_collapsed = 9; + comp_obj_heading_.parent_ocn = 0; + comp_obj_heading_.parent_lev_markup = 0; + comp_obj_heading_.dom_markedup = dom_markedup.dup; + comp_obj_heading_.dom_collapsed = dom_collapsed.dup; + obj_dom_set_markup_tags(comp_obj_heading_, dom_markedup, 0); + obj_dom_set_collapsed_tags(comp_obj_heading_, dom_collapsed, 0); + obj_heading_ancestors(comp_obj_heading_, lv_ancestors_txt); + comp_obj_heading_ = obj_dom_set_markup_tags(comp_obj_heading_, dom_markedup, 0); + comp_obj_heading_ = obj_dom_set_collapsed_tags(comp_obj_heading_, dom_collapsed, 0); + comp_obj_heading_ = obj_heading_ancestors(comp_obj_heading_, lv_ancestors_txt); + the_dom_tail_section ~= comp_obj_heading_; auto document_the = [ "head": the_document_head_section, "toc_seg": the_table_of_contents_section["seg"], @@ -1610,7 +1646,8 @@ template SiSUdocAbstraction() { ]; string[][string] document_section_keys_sequenced = [ "seg": ["head", "toc_seg", "body",], - "scroll": ["head", "toc_scroll", "body",] + "scroll": ["head", "toc_scroll", "body",], + "sql": ["head", "body",] ]; if (document_the["endnotes"].length > 1) { document_section_keys_sequenced["seg"] ~= "endnotes"; @@ -1619,13 +1656,16 @@ template SiSUdocAbstraction() { if (document_the["glossary"].length > 1) { document_section_keys_sequenced["seg"] ~= "glossary"; document_section_keys_sequenced["scroll"] ~= "glossary"; + document_section_keys_sequenced["sql"] ~= "glossary"; } if (document_the["bibliography"].length > 1) { document_section_keys_sequenced["seg"] ~= "bibliography"; document_section_keys_sequenced["scroll"] ~= "bibliography"; + document_section_keys_sequenced["sql"] ~= "bibliography"; } if (document_the["bookindex_seg"].length > 1) { document_section_keys_sequenced["seg"] ~= "bookindex_seg"; + document_section_keys_sequenced["sql"] ~= "bookindex_seg"; } if (document_the["bookindex_scroll"].length > 1) { document_section_keys_sequenced["scroll"] ~= "bookindex_scroll"; @@ -1633,6 +1673,7 @@ template SiSUdocAbstraction() { if (document_the["blurb"].length > 1) { document_section_keys_sequenced["seg"] ~= "blurb"; document_section_keys_sequenced["scroll"] ~= "blurb"; + document_section_keys_sequenced["sql"] ~= "blurb"; } if ((opt_action["html"]) || (opt_action["html-scroll"]) @@ -5142,7 +5183,7 @@ template SiSUdocAbstraction() { N obj_cite_number_, C cntr_, P ptr_, - LA lv_ancestors, + LA lv_ancestors_txt, I is_, PSn html_segnames_ptr, fNr flag_notes_reg, @@ -5159,7 +5200,7 @@ template SiSUdocAbstraction() { static assert(is(typeof(obj_cite_number_) == int)); static assert(is(typeof(cntr_) == int)); static assert(is(typeof(ptr_) == int)); - static assert(is(typeof(lv_ancestors) == string[])); + static assert(is(typeof(lv_ancestors_txt) == string[])); static assert(is(typeof(is_) == string)); static assert(is(typeof(html_segnames_ptr) == int)); } @@ -5271,7 +5312,7 @@ template SiSUdocAbstraction() { _comp_obj_heading_.heading_lev_collapsed = (!(lev_collapsed_number.empty) ? lev_collapsed_number.to!int : 0); _comp_obj_heading_.parent_ocn = p_["obj_cite_number"]; _comp_obj_heading_.parent_lev_markup = p_["lev_markup_number"]; - _comp_obj_heading_.heading_ancestors_text = lv_ancestors; + _comp_obj_heading_.heading_ancestors_text = lv_ancestors_txt; _comp_obj_heading_.ptr_doc_object = cntr_; _comp_obj_heading_.ptr_html_segnames = ((lev_markup_number == "4") ? html_segnames_ptr : 0); _comp_obj_heading_.ptr_heading = ptr_; @@ -5540,6 +5581,9 @@ template docSectKeysSeq() { auto scroll() { return document_section_keys_sequenced["scroll"]; } + auto sql() { + return document_section_keys_sequenced["sql"]; + } } return doc_sect_keys_seq(); } diff --git a/src/sdp/ao/abstraction_summary.d b/src/sdp/meta/metadoc_summary.d index 2b909c7..e2b85b8 100644 --- a/src/sdp/ao/abstraction_summary.d +++ b/src/sdp/meta/metadoc_summary.d @@ -1,12 +1,12 @@ -module sdp.ao.abstraction_summary; +module sdp.meta.metadoc_summary; template SiSUabstractionSummary() { auto SiSUabstractionSummary(S,T)( auto return ref const S doc_abstraction, auto return ref T doc_matters, ) { import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; import std.array, std.exception, diff --git a/src/sdp/ao/object_setter.d b/src/sdp/meta/object_setter.d index b05ac98..385c3d2 100644 --- a/src/sdp/ao/object_setter.d +++ b/src/sdp/meta/object_setter.d @@ -1,9 +1,9 @@ /++ object setter: setting of sisu objects for downstream processing - ao_object_setter.d + meta_object_setter.d +/ -module sdp.ao.object_setter; +module sdp.meta.object_setter; template ObjectSetter() { /+ structs +/ struct HeadingAttrib { @@ -48,6 +48,7 @@ template ObjectSetter() { int heading_lev_collapsed = 9; int[] dom_markedup = [ 0, 0, 0, 0, 0, 0, 0, 0,]; int[] dom_collapsed = [ 0, 0, 0, 0, 0, 0, 0, 0,]; + int[] heading_ancestors = [ 0, 0, 0, 0, 0, 0, 0, 0,]; string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ]; string[] lev4_subtoc = []; int heading_array_ptr = 0; diff --git a/src/sdp/ao/package.d b/src/sdp/meta/package.d index 63b4f3e..fcc6b13 100644 --- a/src/sdp/ao/package.d +++ b/src/sdp/meta/package.d @@ -1,7 +1,7 @@ -module sdp.ao; +module sdp.meta; public import - sdp.ao.defaults, - sdp.ao.rgx; + sdp.meta.defaults, + sdp.meta.rgx; /+ std +/ public import std.array, diff --git a/src/sdp/ao/read_config_files.d b/src/sdp/meta/read_config_files.d index 8f525f3..2410316 100644 --- a/src/sdp/ao/read_config_files.d +++ b/src/sdp/meta/read_config_files.d @@ -1,12 +1,12 @@ /++ read configuration files<BR> - read config files<BR> - ao_config_files.d + meta_config_files.d +/ -module sdp.ao.read_config_files; +module sdp.meta.read_config_files; template configIn() { import - sdp.ao, + sdp.meta, std.file, std.path; final string configIn(C,E)(C conf_sdl, E env) { @@ -49,7 +49,7 @@ template configIn() { template ConfigSDLang() { import sdlang; import - sdp.ao, + sdp.meta, std.file, std.path; auto ConfigSDLang(string configuration, string conf_sdl_filename) { @@ -68,7 +68,7 @@ template ConfigSDLang() { +/ template configRead() { import - sdp.ao, + sdp.meta, std.file, std.path; diff --git a/src/sdp/ao/read_source_files.d b/src/sdp/meta/read_source_files.d index db20cfd..60f0777 100644 --- a/src/sdp/ao/read_source_files.d +++ b/src/sdp/meta/read_source_files.d @@ -1,14 +1,14 @@ /++ - module ao_read_source_files;<BR> + module meta_read_source_files;<BR> - open markup files<BR> - if master file scan for addional files to import/insert +/ -module sdp.ao.read_source_files; +module sdp.meta.read_source_files; template SiSUrawMarkupContent() { import - sdp.ao.rgx; + sdp.meta.rgx; import - sdp.ao, + sdp.meta, std.file, std.path; mixin SiSUrgxInit; @@ -128,7 +128,7 @@ template SiSUrawMarkupContent() { } } struct Inserts { - import sdp.ao.defaults; + import sdp.meta.defaults; auto scan_subdoc_source( char[][] markup_sourcefile_insert_content, string fn_src diff --git a/src/sdp/ao/rgx.d b/src/sdp/meta/rgx.d index 595087d..854e9cc 100644 --- a/src/sdp/ao/rgx.d +++ b/src/sdp/meta/rgx.d @@ -1,9 +1,9 @@ /++ regex: regular expressions used in sisu document parser +/ -module sdp.ao.rgx; +module sdp.meta.rgx; template SiSUrgxInit() { - import sdp.ao.defaults; + import sdp.meta.defaults; struct Rgx { /+ misc +/ static true_dollar = ctRegex!(`\$`, "gm"); diff --git a/src/sdp/output/paths_output.d b/src/sdp/output/paths_output.d index 3edcb67..bf88b54 100644 --- a/src/sdp/output/paths_output.d +++ b/src/sdp/output/paths_output.d @@ -6,7 +6,7 @@ import std.array, std.path, std.regex, std.stdio; -import sdp.ao.rgx; +import sdp.meta.rgx; template SiSUpathsSisupod() { mixin SiSUrgxInit; auto rgx = Rgx(); diff --git a/src/sdp/output/paths_source.d b/src/sdp/output/paths_source.d index 80e2c1a..d7b326f 100644 --- a/src/sdp/output/paths_source.d +++ b/src/sdp/output/paths_source.d @@ -1,14 +1,14 @@ /++ read configuration files<BR> - read config files<BR> - ao_config_files.d + meta_config_files.d +/ module sdp.output.paths_source; import std.array, std.path, std.regex, std.stdio; -import sdp.ao.rgx; +import sdp.meta.rgx; template SiSUpathsSRC() { mixin SiSUrgxInit; auto rgx = Rgx(); diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d index 0b90096..1abf462 100755 --- a/src/sdp/sdp.d +++ b/src/sdp/sdp.d @@ -7,24 +7,24 @@ module sdp.sisu_document_parser; import sdp.conf.compile_time_info, - sdp.ao.abstraction; + sdp.meta.metadoc; /+ sdp: sisu document parser, see http://sisudoc.org +/ -import sdp.ao; +import sdp.meta; import std.getopt, std.process; import - sdp.ao.abstraction_summary, - sdp.ao.abstract_doc_source, - sdp.ao.composite_make, - sdp.ao.conf_make_meta, - // sdp.ao.conf_make_meta_native, - sdp.ao.conf_make_meta_sdlang, - sdp.ao.defaults, - sdp.ao.doc_debugs, - sdp.ao.read_config_files, - sdp.ao.read_source_files, - sdp.ao.rgx, + sdp.meta.metadoc_summary, + sdp.meta.metadoc_from_src, + sdp.meta.composite_make, + sdp.meta.conf_make_meta, + // sdp.meta.conf_make_meta_native, + sdp.meta.conf_make_meta_sdlang, + sdp.meta.defaults, + sdp.meta.doc_debugs, + sdp.meta.read_config_files, + sdp.meta.read_source_files, + sdp.meta.rgx, sdp.output.hub, sdp.output.paths_source; mixin(import("version.txt")); |