aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--org/default_paths.org3
-rw-r--r--org/meta_abstraction.org175
-rw-r--r--org/meta_debugs.org4
-rw-r--r--org/output_hub.org82
-rw-r--r--org/output_sisupod.org20
-rw-r--r--org/output_sqlite.org40
-rw-r--r--org/output_sqlite_discrete.org36
-rw-r--r--org/output_xmls.org56
-rw-r--r--org/sdp.org200
-rw-r--r--src/sdp/meta/doc_debugs.d4
-rw-r--r--src/sdp/meta/metadoc.d13
-rw-r--r--src/sdp/meta/metadoc_from_src.d175
-rw-r--r--src/sdp/meta/metadoc_summary.d2
-rw-r--r--src/sdp/output/epub3.d20
-rw-r--r--src/sdp/output/html.d36
-rw-r--r--src/sdp/output/hub.d82
-rw-r--r--src/sdp/output/source_sisupod.d20
-rw-r--r--src/sdp/output/sqlite.d40
-rw-r--r--src/sdp/output/sqlite_discrete.d36
-rwxr-xr-xsrc/sdp/sdp.d169
-rw-r--r--views/version.txt2
21 files changed, 759 insertions, 456 deletions
diff --git a/org/default_paths.org b/org/default_paths.org
index e874340..cb1826d 100644
--- a/org/default_paths.org
+++ b/org/default_paths.org
@@ -115,6 +115,9 @@ sisupod
│   ├── image
│   ├── text
│   │ └── en
+ │   │ ...
+ │  │  ├── [conf]
+ │   │ └── [image]
│   └── video
└── sisudoc.txt
diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org
index 9a5d41f..0caa15c 100644
--- a/org/meta_abstraction.org
+++ b/org/meta_abstraction.org
@@ -43,7 +43,6 @@ template SiSUdocAbstraction() {
static auto rgx = Rgx();
debug(asserts) {
static assert(is(typeof(markup_sourcefile_content) == char[][]));
- static assert(is(typeof(opt_action) == bool[string]));
}
/+ ↓ abstraction init +/
<<abs_init_rest>>
@@ -600,7 +599,7 @@ if (line.matchFirst(rgx.heading_biblio)
obj_type_status["glossary_section"] = State.off;
obj_type_status["biblio_section"] = State.on;
obj_type_status["blurb_section"] = State.off;
- if (opt_action["backmatter"] && opt_action["section_biblio"]) {
+ if (opt_action.backmatter && opt_action.section_biblio) {
_biblio_block_(line, obj_type_status, bib_entry, biblio_entry_str_json, biblio_arr_json);
debug(bibliobuild) {
writeln("- ", biblio_entry_str_json);
@@ -634,7 +633,7 @@ if there is a glossary section you need to:
obj_type_status["glossary_section"] = State.on;
obj_type_status["biblio_section"] = State.off;
obj_type_status["blurb_section"] = State.off;
- if (opt_action["backmatter"] && opt_action["section_glossary"]) {
+ if (opt_action.backmatter && opt_action.section_glossary) {
indent=[
"hang_position" : 0,
"base_position" : 0,
@@ -729,7 +728,7 @@ if there is a blurb section you need to:
obj_type_status["glossary_section"] = State.off;
obj_type_status["biblio_section"] = State.off;
obj_type_status["blurb_section"] = State.on;
- if (opt_action["backmatter"] && opt_action["section_blurb"]) {
+ if (opt_action.backmatter && opt_action.section_blurb) {
indent=[
"hang_position" : 0,
"base_position" : 0,
@@ -779,7 +778,7 @@ if there is a blurb section you need to:
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"])) {
+ && (opt_action.backmatter && opt_action.section_blurb)) {
comp_obj_heading_ = comp_obj_heading_.init;
comp_obj_heading_.of_part = "backmatter";
comp_obj_heading_.of_section = "blurb";
@@ -1879,13 +1878,13 @@ foreach (ref obj; the_document_head_section) {
obj.obj_cite_number_type = OCNtype.ocn;
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1912,13 +1911,13 @@ if (the_table_of_contents_section["scroll"].length > 1) {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1940,10 +1939,10 @@ if (the_table_of_contents_section["scroll"].length > 1) {
assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]);
}
}
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1976,13 +1975,13 @@ if (the_document_body_section.length > 1) {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -2024,13 +2023,13 @@ if (the_endnotes_section.length > 1) {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -2065,13 +2064,13 @@ if (the_glossary_section.length > 1) {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -2110,13 +2109,13 @@ if (the_bibliography_section.length > 1) {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -2160,13 +2159,13 @@ if (the_bookindex_section["scroll"].length > 1) {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -2199,13 +2198,13 @@ if (the_bookindex_section["scroll"].length > 1) {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -2248,13 +2247,13 @@ if (the_blurb_section.length > 1) {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -2359,10 +2358,10 @@ if (document_the["blurb"].length > 1) {
document_section_keys_sequenced["scroll"] ~= "blurb";
document_section_keys_sequenced["sql"] ~= "blurb";
}
-if ((opt_action["html"])
-|| (opt_action["html-scroll"])
-|| (opt_action["html-seg"])
-|| (opt_action["epub"])) {
+if ((opt_action.html)
+|| (opt_action.html_scroll)
+|| (opt_action.html_seg)
+|| (opt_action.epub)) {
document_section_keys_sequenced["seg"] ~= "tail";
document_section_keys_sequenced["scroll"] ~= "tail";
}
@@ -3845,7 +3844,6 @@ auto _book_index_(L,I,O,T,B)(
static assert(is(typeof(book_idx_tmp) == string));
static assert(is(typeof(an_object) == string[string]));
static assert(is(typeof(obj_type_status) == int[string]));
- static assert(is(typeof(opt_action) == bool[string]));
}
static auto rgx = Rgx();
if (auto m = line.match(rgx.book_index)) {
@@ -3860,7 +3858,7 @@ auto _book_index_(L,I,O,T,B)(
} else if (auto m = line.match(rgx.book_index_open)) {
/+ match open book_index +/
obj_type_status["book_index"] = State.on;
- if (opt_action["backmatter"] && opt_action["section_bookindex"]) {
+ if (opt_action.backmatter && opt_action.section_bookindex) {
book_idx_tmp = m.captures[1].to!string;
debug(bookindexmatch) { // book index
writefln(
@@ -3873,8 +3871,8 @@ auto _book_index_(L,I,O,T,B)(
/+ book_index flag set +/
if (auto m = line.match(rgx.book_index_close)) {
obj_type_status["book_index"] = State.off;
- if (opt_action["backmatter"]
- && opt_action["section_bookindex"]) {
+ if (opt_action.backmatter
+ && opt_action.section_bookindex) {
an_object["bookindex_nugget"] = book_idx_tmp ~ m.captures[1].to!string;
debug(bookindexmatch) { // book index
writefln(
@@ -3885,8 +3883,8 @@ auto _book_index_(L,I,O,T,B)(
}
book_idx_tmp = "";
} else {
- if (opt_action["backmatter"]
- && opt_action["section_bookindex"]) {
+ if (opt_action.backmatter
+ && opt_action.section_bookindex) {
book_idx_tmp ~= line;
}
}
@@ -6071,7 +6069,6 @@ struct BookIndexReportSection {
debug(asserts) {
static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string]));
static assert(is(typeof(obj_cite_digits.on) == int));
- static assert(is(typeof(opt_action) == bool[string]));
}
mixin SiSUnode;
mixin InternalMarkup;
@@ -6088,8 +6085,8 @@ struct BookIndexReportSection {
auto node_para_int_ = node_metadata_para_int;
auto node_para_str_ = node_metadata_para_str;
if ((mainkeys.length > 0)
- && (opt_action["backmatter"]
- && opt_action["section_bookindex"])) {
+ && (opt_action.backmatter
+ && opt_action.section_bookindex)) {
string bi_tmp_seg, bi_tmp_scroll;
string[] bi_tmp_tags;
comp_obj_heading_ = comp_obj_heading_.init;
@@ -6334,9 +6331,9 @@ struct NotesSection {
#+name: meta_emitters_endnotes
#+BEGIN_SRC d
- private auto endnote_objects(N)(
+ private auto endnote_objects(N,O)(
N obj_cite_digits,
- bool[string] opt_action,
+ O opt_action,
)
in {
}
@@ -6350,7 +6347,7 @@ struct NotesSection {
int[string] indent;
ObjGenericComposite comp_obj_heading_;
if ((endnotes_["notes"].length > 0)
- && (opt_action["backmatter"] && opt_action["section_endnotes"])) {
+ && (opt_action.backmatter && opt_action.section_endnotes)) {
comp_obj_heading_ = comp_obj_heading_.init;
comp_obj_heading_.of_part = "backmatter";
comp_obj_heading_.of_section = "endnotes";
@@ -6406,7 +6403,7 @@ struct NotesSection {
comp_obj_heading_.parent_lev_markup = 0;
the_endnotes_section ~= comp_obj_heading_;
}
- if (opt_action["backmatter"] && opt_action["section_endnotes"]) {
+ if (opt_action.backmatter && opt_action.section_endnotes) {
ObjGenericComposite comp_obj_endnote_;
comp_obj_endnote_ = comp_obj_endnote_.init;
comp_obj_endnote_.of_part = "backmatter";
diff --git a/org/meta_debugs.org b/org/meta_debugs.org
index 91155f2..c381ebf 100644
--- a/org/meta_debugs.org
+++ b/org/meta_debugs.org
@@ -34,7 +34,7 @@ template SiSUdebugs() {
<<initialize>>
<<meta_output_debugs>>
debug(checkdoc) {
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.do_debug)) {
<<meta_output_debugs_summary>>
<<meta_output_debugs_checkdoc>>
}
@@ -745,7 +745,7 @@ debug(summary) {
#+BEGIN_SRC d
debug(checkdoc) {
if (auto mfn=match(doc_matters.source_filename, rgx.src_fn)) {
- if (doc_matters.opt_action["assertions"]) {
+ if (doc_matters.opt_action.assertions) {
switch (mfn.captures[2]) {
// live manual:
case "live-manual.ssm":
diff --git a/org/output_hub.org b/org/output_hub.org
index 699e1e6..e8709f2 100644
--- a/org/output_hub.org
+++ b/org/output_hub.org
@@ -34,7 +34,7 @@ template outputHub() {
}
template outputHubOp() {
<<output_imports>>
- void outputHubOp(C)(C config) {
+ void outputHubOp(O)(O opt_action) {
mixin SiSUoutputRgxInit;
static auto rgx = Rgx();
<<output_options_op>>
@@ -62,7 +62,7 @@ import sdp.output,
#+name: output_options
#+BEGIN_SRC d
-if ((doc_matters.opt_action["verbose"])) {
+if ((doc_matters.opt_action.verbose)) {
writeln(doc_matters.keys_seq.seg);
}
#+END_SRC
@@ -72,22 +72,22 @@ if ((doc_matters.opt_action["verbose"])) {
#+name: output_options
#+BEGIN_SRC d
-if ((doc_matters.opt_action["source"])
-|| (doc_matters.opt_action["sisupod"])) {
- if ((doc_matters.opt_action["verbose"])
- && (doc_matters.opt_action["source"]))
+if ((doc_matters.opt_action.source)
+|| (doc_matters.opt_action.sisupod)) {
+ if ((doc_matters.opt_action.verbose)
+ && (doc_matters.opt_action.source))
{ writeln("sisu source processing... "); }
- if ((doc_matters.opt_action["verbose"])
- && (doc_matters.opt_action["sisupod"]))
+ if ((doc_matters.opt_action.verbose)
+ && (doc_matters.opt_action.sisupod))
{ writeln("sisupod source processing... "); }
SiSUpod!()(doc_matters);
- if ((doc_matters.opt_action["verbose"])
- && (doc_matters.opt_action["debug"])
- && (doc_matters.opt_action["source"]))
+ if ((doc_matters.opt_action.verbose)
+ && (doc_matters.opt_action.debug_do)
+ && (doc_matters.opt_action.source))
{ writeln("sisu source done"); }
- if ((doc_matters.opt_action["verbose"])
- && (doc_matters.opt_action["debug"])
- && (doc_matters.opt_action["sisupod"]))
+ if ((doc_matters.opt_action.verbose)
+ && (doc_matters.opt_action.debug_do)
+ && (doc_matters.opt_action.sisupod))
{ writeln("sisupod done"); }
}
#+END_SRC
@@ -97,9 +97,9 @@ if ((doc_matters.opt_action["source"])
#+name: output_options
#+BEGIN_SRC d
-if (doc_matters.opt_action["text"]) {
+if (doc_matters.opt_action.text) {
/+ mixin outputText; +/
- if ((doc_matters.opt_action["verbose"])) { writeln("text processing... "); }
+ if ((doc_matters.opt_action.verbose)) { writeln("text processing... "); }
}
#+END_SRC
@@ -108,23 +108,23 @@ if (doc_matters.opt_action["text"]) {
#+name: output_options
#+BEGIN_SRC d
-if (doc_matters.opt_action["html"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("html scroll processing... "); }
+if (doc_matters.opt_action.html) {
+ if ((doc_matters.opt_action.verbose)) { writeln("html scroll processing... "); }
outputHTML!().scroll(doc_abstraction, doc_matters);
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("html scroll done"); }
- if ((doc_matters.opt_action["verbose"])) { writeln("html seg processing... "); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("html scroll done"); }
+ if ((doc_matters.opt_action.verbose)) { writeln("html seg processing... "); }
outputHTML!().seg(doc_abstraction, doc_matters);
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("html seg done"); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("html seg done"); }
outputHTML!().css(doc_matters);
-} else if (doc_matters.opt_action["html-seg"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("html seg processing... "); }
+} else if (doc_matters.opt_action.html_seg) {
+ if ((doc_matters.opt_action.verbose)) { writeln("html seg processing... "); }
outputHTML!().seg(doc_abstraction, doc_matters);
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("html seg done"); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("html seg done"); }
outputHTML!().css(doc_matters);
-} else if (doc_matters.opt_action["html-scroll"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("html scroll processing... "); }
+} else if (doc_matters.opt_action.html_scroll) {
+ if ((doc_matters.opt_action.verbose)) { writeln("html scroll processing... "); }
outputHTML!().scroll(doc_abstraction, doc_matters);
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("html scroll done"); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("html scroll done"); }
outputHTML!().css(doc_matters);
}
#+END_SRC
@@ -134,11 +134,11 @@ if (doc_matters.opt_action["html"]) {
#+name: output_options
#+BEGIN_SRC d
-if (doc_matters.opt_action["epub"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("epub3 processing... "); }
+if (doc_matters.opt_action.epub) {
+ if ((doc_matters.opt_action.verbose)) { writeln("epub3 processing... "); }
outputEPub3!()(doc_abstraction, doc_matters);
// epub.css_write;
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("epub3 done"); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("epub3 done"); }
}
#+END_SRC
@@ -146,7 +146,7 @@ if (doc_matters.opt_action["epub"]) {
#+name: output_options
#+BEGIN_SRC d
-if (doc_matters.opt_action["pdf"]) {
+if (doc_matters.opt_action.pdf) {
/+ mixin outputPDF; +/
writeln("pdf processing");
}
@@ -156,7 +156,7 @@ if (doc_matters.opt_action["pdf"]) {
#+name: output_options
#+BEGIN_SRC d
-if (doc_matters.opt_action["odt"]) {
+if (doc_matters.opt_action.odt) {
/+ mixin outputODT; +/
writeln("odt processing");
}
@@ -167,8 +167,8 @@ if (doc_matters.opt_action["odt"]) {
#+name: output_options
#+BEGIN_SRC d
-if (doc_matters.opt_action["sqlite-discrete"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("sqlite processing... "); }
+if (doc_matters.opt_action.sqlite_discrete) {
+ if ((doc_matters.opt_action.verbose)) { writeln("sqlite processing... "); }
SQLiteDiscreteBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
}
#+END_SRC
@@ -177,8 +177,8 @@ if (doc_matters.opt_action["sqlite-discrete"]) {
#+name: output_options
#+BEGIN_SRC d
-if (doc_matters.opt_action["sqlite-update"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("sqlite processing... "); }
+if (doc_matters.opt_action.sqlite_update) {
+ if ((doc_matters.opt_action.verbose)) { writeln("sqlite processing... "); }
SQLiteBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
}
#+END_SRC
@@ -188,12 +188,12 @@ if (doc_matters.opt_action["sqlite-update"]) {
**** collection
#+name: output_options_op
#+BEGIN_SRC d
-if ((config["sqlite-create"])) {
- if ((config["verbose"])) { writeln("sqlite create table... "); }
+if ((opt_action.sqlite_create)) {
+ if ((opt_action.verbose)) { writeln("sqlite create table... "); }
SQLiteTablesCreate!()();
}
-if ((config["sqlite-drop"])) {
- if ((config["verbose"])) { writeln("sqlite drop table... "); }
+if ((opt_action.sqlite_drop)) {
+ if ((opt_action.verbose)) { writeln("sqlite drop table... "); }
SQLiteTablesDrop!()();
}
#+END_SRC
@@ -202,7 +202,7 @@ if ((config["sqlite-drop"])) {
#+name: output_options
#+BEGIN_SRC d
-if (doc_matters.opt_action["postgresql"]) {
+if (doc_matters.opt_action.postgresql) {
/+ mixin outputPostgreSQL; +/
writeln("pgsql processing");
}
diff --git a/org/output_sisupod.org b/org/output_sisupod.org
index c9d5d2a..398af1c 100644
--- a/org/output_sisupod.org
+++ b/org/output_sisupod.org
@@ -79,7 +79,7 @@ if (!exists(pths_sisupod.sisupod_dir_())) {
// used both by sisupod zipped (& sisupod filesystem (unzipped) which makes its own recursive dirs)
pths_sisupod.sisupod_dir_().mkdirRecurse;
}
-if (doc_matters.opt_action["source"]) {
+if (doc_matters.opt_action.source) {
if (!exists(pths_sisupod.text_root(doc_matters.source_filename).filesystem_open_zpod)) {
pths_sisupod.text_root(doc_matters.source_filename).filesystem_open_zpod.mkdirRecurse;
}
@@ -125,10 +125,10 @@ auto fn_sisupod = pths_sisupod.sisupod_filename(doc_matters.source_filename).zpo
auto fn_src_out_sisupod_zip_base = pths_sisupod.image_root(doc_matters.source_filename).zpod.to!string ~ "/" ~ image;
auto fn_src_out_filesystem = pths_sisupod.image_root(doc_matters.source_filename).filesystem_open_zpod.to!string ~ "/" ~ image;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
fn_src_in.copy(fn_src_out_filesystem);
}
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn_src_out_sisupod_zip_base;
auto zip_data = new OutBuffer();
@@ -143,10 +143,10 @@ auto fn_sisupod = pths_sisupod.sisupod_filename(doc_matters.source_filename).zpo
auto fn_src_out_sisupod_zip_base = pths_sisupod.conf_root(doc_matters.source_filename).zpod.to!string ~ "/" ~ "sisu_document_make";
auto fn_src_out_filesystem = pths_sisupod.conf_root(doc_matters.source_filename).filesystem_open_zpod.to!string ~ "/" ~ "sisu_document_make";
if (exists(fn_src_in)) {
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
fn_src_in.copy(fn_src_out_filesystem);
}
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn_src_out_sisupod_zip_base;
auto zip_data = new OutBuffer();
@@ -165,14 +165,14 @@ auto fn_sisupod = pths_sisupod.sisupod_filename(doc_matters.source_filename).zpo
if (exists(fn_src_in)) {
filelist_src_out_sisupod_arr ~= fn_src_out_sisupod_zip_base;
filelist_src_zpod_arr ~= fn_src_out_inside_pod;
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
auto filelist = File(pths_sisupod.fn_pod_filelist(doc_matters.source_filename).filesystem_open_zpod, "w");
foreach (source_pth_and_fn; filelist_src_zpod_arr) {
filelist.writeln(source_pth_and_fn);
}
fn_src_in.copy(fn_src_out_filesystem);
}
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn_src_out_sisupod_zip_base;
auto zip_data = new OutBuffer();
@@ -205,10 +205,10 @@ auto fn_sisupod = pths_sisupod.sisupod_filename(doc_matters.source_filename).zpo
insert_file,
).filesystem_open_zpod.to!string;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
fn_src_in.copy(fn_src_out_filesystem);
}
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn_src_out_sisupod_zip_base;
auto zip_data = new OutBuffer();
@@ -223,7 +223,7 @@ auto fn_sisupod = pths_sisupod.sisupod_filename(doc_matters.source_filename).zpo
} {
auto fn_src_in = doc_matters.source_filename;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
createZipFile!()(fn_sisupod, zip.build());
}
}
diff --git a/org/output_sqlite.org b/org/output_sqlite.org
index 0c5b222..328af1a 100644
--- a/org/output_sqlite.org
+++ b/org/output_sqlite.org
@@ -133,7 +133,7 @@ auto generic_munge_sanitize_text_for_search(
if (_urls.length > 0) {
_txt ~= _urls;
}
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
writeln(_txt, "\n");
}
debug(sql_text_clean) {
@@ -198,7 +198,7 @@ auto munge_html(O)(
if (_notes.length > 0) {
_txt ~= _notes;
}
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
writeln(_txt, "\n");
}
return _txt;
@@ -469,8 +469,8 @@ auto html_table(O)(
auto pth_sqlite = SiSUpathsSQLite!()(doc_matters.src_path_info, doc_matters.language);
auto db = Database(pth_sqlite.sqlite_file(doc_matters.environment["pwd"].baseName));
// auto db = Database(":memory:"); // open database in memory
-if (doc_matters.opt_action["sqlite-create"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("sqlite create tables... "); }
+if (doc_matters.opt_action.sqlite_create) {
+ if ((doc_matters.opt_action.verbose)) { writeln("sqlite create tables... "); }
db.run("
#+END_SRC
@@ -1099,7 +1099,7 @@ auto heading(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_heading(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1124,7 +1124,7 @@ auto para(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_para(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1149,7 +1149,7 @@ auto quote(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_quote(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1173,7 +1173,7 @@ auto group(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_group(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1198,7 +1198,7 @@ auto block(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_block(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1223,7 +1223,7 @@ auto verse(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_verse(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1248,7 +1248,7 @@ auto code(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_code(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1273,7 +1273,7 @@ auto table(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_table(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1306,14 +1306,14 @@ foreach (part; doc_parts) {
obj_txt = format_and_sqlite_load.heading(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1335,7 +1335,7 @@ foreach (part; doc_parts) {
obj_txt = format_and_sqlite_load.para(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -1364,14 +1364,14 @@ foreach (part; doc_parts) {
obj_txt = format_and_sqlite_load.table(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1401,14 +1401,14 @@ foreach (part; doc_parts) {
obj_txt = format_and_sqlite_load.para(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1417,7 +1417,7 @@ foreach (part; doc_parts) {
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); // check where empty value could come from
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
writeln(__FILE__, ":", __LINE__, ": ", obj.text); // check where empty value could come from
diff --git a/org/output_sqlite_discrete.org b/org/output_sqlite_discrete.org
index 9180587..957b6e8 100644
--- a/org/output_sqlite_discrete.org
+++ b/org/output_sqlite_discrete.org
@@ -133,7 +133,7 @@ auto generic_munge_sanitize_text_for_search(
if (_urls.length > 0) {
_txt ~= _urls;
}
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
writeln(_txt, "\n");
}
debug(sql_text_clean) {
@@ -198,7 +198,7 @@ auto munge_html(O)(
if (_notes.length > 0) {
_txt ~= _notes;
}
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
writeln(_txt, "\n");
}
return _txt;
@@ -1067,7 +1067,7 @@ auto heading(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_heading(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1092,7 +1092,7 @@ auto para(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_para(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1117,7 +1117,7 @@ auto quote(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_quote(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1141,7 +1141,7 @@ auto group(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_group(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1166,7 +1166,7 @@ auto block(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_block(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1191,7 +1191,7 @@ auto verse(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_verse(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1216,7 +1216,7 @@ auto code(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_code(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1241,7 +1241,7 @@ auto table(O)(
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_table(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -1274,14 +1274,14 @@ foreach (part; doc_parts) {
obj_txt = format_and_sqlite_load.heading(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1303,7 +1303,7 @@ foreach (part; doc_parts) {
obj_txt = format_and_sqlite_load.para(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -1332,14 +1332,14 @@ foreach (part; doc_parts) {
obj_txt = format_and_sqlite_load.table(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1369,14 +1369,14 @@ foreach (part; doc_parts) {
obj_txt = format_and_sqlite_load.para(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1385,7 +1385,7 @@ foreach (part; doc_parts) {
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); // check where empty value could come from
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
writeln(__FILE__, ":", __LINE__, ": ", obj.text); // check where empty value could come from
diff --git a/org/output_xmls.org b/org/output_xmls.org
index a24e1e2..3f82899 100644
--- a/org/output_xmls.org
+++ b/org/output_xmls.org
@@ -1343,14 +1343,14 @@ void scroll(D,I)(
doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1367,7 +1367,7 @@ void scroll(D,I)(
doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -1396,14 +1396,14 @@ void scroll(D,I)(
doc_html ~= xhtml_format.table(obj, _txt);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1433,14 +1433,14 @@ void scroll(D,I)(
doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1449,7 +1449,7 @@ void scroll(D,I)(
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
@@ -1570,13 +1570,13 @@ void seg(D,I)(
doc_html_endnotes[segment_filename] ~= t[1];
break;
case 8: .. case 9:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
}
break;
@@ -1593,14 +1593,14 @@ void seg(D,I)(
doc_html[segment_filename] ~= to!string(t[0]);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -1616,7 +1616,7 @@ void seg(D,I)(
doc_html_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -1654,14 +1654,14 @@ void seg(D,I)(
doc_html_endnotes[segment_filename] ~= "";
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1697,14 +1697,14 @@ void seg(D,I)(
doc_html_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1713,7 +1713,7 @@ void seg(D,I)(
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
}
break;
@@ -2217,13 +2217,13 @@ void outputEPub3(D,I)(
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
case 8: .. case 9:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
}
break;
@@ -2241,14 +2241,14 @@ void outputEPub3(D,I)(
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -2264,7 +2264,7 @@ void outputEPub3(D,I)(
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -2303,14 +2303,14 @@ void outputEPub3(D,I)(
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -2346,14 +2346,14 @@ void outputEPub3(D,I)(
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -2362,7 +2362,7 @@ void outputEPub3(D,I)(
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
}
break;
diff --git a/org/sdp.org b/org/sdp.org
index af7fe98..a6e552f 100644
--- a/org/sdp.org
+++ b/org/sdp.org
@@ -26,7 +26,7 @@ struct Version {
int minor;
int patch;
}
-enum ver = Version(0, 20, 0);
+enum ver = Version(0, 20, 1);
#+END_SRC
#+NAME: version_txt
@@ -230,6 +230,8 @@ look into using getopt
[[http://dlang.org/phobos/std_getopt.html][getopt]]
[[http://dlang.org/library/std/getopt.html][getopt]]
+***** getopt
+
#+NAME: sdp_args
#+BEGIN_SRC d
bool[string] opts = [
@@ -319,6 +321,169 @@ auto helpInfo = getopt(args,
if (helpInfo.helpWanted) {
defaultGetoptPrinter("Some information about the program.", helpInfo.options);
}
+#+END_SRC
+
+***** getopt hash to struct
+
+#+NAME: sdp_args
+#+BEGIN_SRC d
+struct OptActions {
+ auto assertions() {
+ auto _k = opts["assertions"];
+ return _k;
+ }
+ auto concordance() {
+ auto _k = opts["concordance"];
+ return _k;
+ }
+ auto debug_do() {
+ auto _k = opts["debug"];
+ return _k;
+ }
+ auto digest() {
+ auto _k = opts["digest"];
+ return _k;
+ }
+ auto docbook() {
+ auto _k = opts["docbook"];
+ return _k;
+ }
+ auto epub() {
+ auto _k = opts["epub"];
+ return _k;
+ }
+ auto html() {
+ auto _k = opts["html"];
+ return _k;
+ }
+ auto html_seg() {
+ auto _k = opts["html-seg"];
+ return _k;
+ }
+ auto html_scroll() {
+ auto _k = opts["html-scroll"];
+ return _k;
+ }
+ auto manifest() {
+ auto _k = opts["manifest"];
+ return _k;
+ }
+ auto ocn() {
+ auto _k = opts["ocn"];
+ return _k;
+ }
+ auto odt() {
+ auto _k = opts["odt"];
+ return _k;
+ }
+ auto pdf() {
+ auto _k = opts["pdf"];
+ return _k;
+ }
+ auto postgresql() {
+ auto _k = opts["postgresql"];
+ return _k;
+ }
+ auto qrcode() {
+ auto _k = opts["qrcode"];
+ return _k;
+ }
+ auto sisupod() {
+ auto _k = opts["sisupod"];
+ return _k;
+ }
+ auto source() {
+ auto _k = opts["source"];
+ return _k;
+ }
+ auto sqlite_discrete() {
+ auto _k = opts["sqlite-discrete"];
+ return _k;
+ }
+ auto sqlite_update() {
+ auto _k = opts["sqlite-update"];
+ return _k;
+ }
+ auto sqlite_create() {
+ auto _k = opts["sqlite-create"];
+ return _k;
+ }
+ auto sqlite_drop() {
+ auto _k = opts["sqlite-drop"];
+ return _k;
+ }
+ auto text() {
+ auto _k = opts["text"];
+ return _k;
+ }
+ auto verbose() {
+ auto _k = opts["verbose"];
+ return _k;
+ }
+ auto xhtml() {
+ auto _k = opts["xhtml"];
+ return _k;
+ }
+ auto xml_dom() {
+ auto _k = opts["xml-dom"];
+ return _k;
+ }
+ auto xml_sax() {
+ auto _k = opts["xml-sax"];
+ return _k;
+ }
+ auto section_toc() {
+ auto _k = opts["section_toc"];
+ return _k;
+ }
+ auto section_body() {
+ auto _k = opts["section_body"];
+ return _k;
+ }
+ auto section_endnotes() {
+ auto _k = opts["section_endnotes"];
+ return _k;
+ }
+ auto section_glossary() {
+ auto _k = opts["section_glossary"];
+ return _k;
+ }
+ auto section_biblio() {
+ auto _k = opts["section_biblio"];
+ return _k;
+ }
+ auto section_bookindex() {
+ auto _k = opts["section_bookindex"];
+ return _k;
+ }
+ auto section_blurb() {
+ auto _k = opts["section_blurb"];
+ return _k;
+ }
+ auto backmatter() {
+ auto _k = opts["backmatter"];
+ return _k;
+ }
+ auto skip_output() {
+ auto _k = opts["skip-output"];
+ return _k;
+ }
+ auto languages_set() {
+ auto _k = settings["lang"].split(",");
+ return _k;
+ }
+ auto output_dir_set() {
+ auto _k = settings["output-dir"];
+ return _k;
+ }
+}
+auto _opt_action = OptActions();
+#+END_SRC
+
+***** getopt processing path
+
+#+NAME: sdp_args
+#+BEGIN_SRC d
foreach(arg; args[1..$]) {
if (arg.match(rgx.flag_action)) {
flag_action ~= " " ~ arg; // flags not taken by getopt
@@ -354,8 +519,8 @@ foreach(arg; args[1..$]) {
contents_location ~ "»"
);
auto contents_location_pth_ = (contents_location).to!string;
- auto lang_rgx_ = regex(r"/(" ~ settings["lang"].split(",").join("|") ~ ")/");
- if (settings["lang"] == "all"
+ auto lang_rgx_ = regex(r"/(" ~ _opt_action.languages_set.join("|") ~ ")/");
+ if (_opt_action.languages_set[0] == "all"
|| (contents_location_pth_).match(lang_rgx_)
) {
fns_src ~= (((tmp_dir_).chainPath(contents_location_pth_)).array).to!(char[]);
@@ -391,8 +556,8 @@ auto conf_files_composite_make = confFilesSDLtoStruct!()(sdl_root_config_share,
** 2a. actions independed of processing files
#+NAME: sdp_do_selected
#+BEGIN_SRC d
-if (!(opts["skip-output"])) {
- outputHubOp!()(opts);
+if (!(_opt_action.skip_output)) {
+ outputHubOp!()(_opt_action);
}
#+END_SRC
@@ -434,7 +599,7 @@ enforce(
#+NAME: sdp_abstraction
#+BEGIN_SRC d
-auto t = SiSUabstraction!()(fn_src, opts, settings, env);
+auto t = SiSUabstraction!()(fn_src, _opt_action, env);
static assert(!isTypeTuple!(t));
static assert(t.length==2);
auto doc_abstraction = t[dAM.abstraction];
@@ -447,7 +612,7 @@ auto doc_matters = t[dAM.matters];
#+NAME: sdp_each_file_do_debugs_checkdoc
#+BEGIN_SRC d
/+ ↓ debugs +/
-if (doc_matters.opt_action["verbose"]) {
+if (doc_matters.opt_action.verbose) {
SiSUabstractionSummary!()(doc_abstraction, doc_matters);
}
#+END_SRC
@@ -458,8 +623,8 @@ if (doc_matters.opt_action["verbose"]) {
#+NAME: sdp_each_file_do_debugs_checkdoc
#+BEGIN_SRC d
/+ ↓ debugs +/
-if ((doc_matters.opt_action["debug"])
-|| (doc_matters.opt_action["verbose"])
+if ((doc_matters.opt_action.debug_do)
+|| (doc_matters.opt_action.verbose)
) {
SiSUdebugs!()(doc_abstraction, doc_matters);
}
@@ -471,7 +636,7 @@ if ((doc_matters.opt_action["debug"])
#+NAME: sdp_each_file_do_selected_output
#+BEGIN_SRC d
/+ ↓ output hub +/
-if (!(opts["skip-output"])) {
+if (!(doc_matters.opt_action.skip_output)) {
outputHub!()(doc_abstraction, doc_matters);
}
#+END_SRC
@@ -511,10 +676,9 @@ template SiSUabstraction() {
enum makeMeta { make, meta }
enum docAbst { doc_abstraction, section_keys, segnames, segnames_0_4, images }
static auto rgx = Rgx();
- auto SiSUabstraction(Fn,O,S,E)(
+ auto SiSUabstraction(Fn,O,E)(
Fn fn_src,
- O opts,
- S settings,
+ O _opt_action,
E env,
){
<<sdp_conf_files>>
@@ -612,7 +776,7 @@ debug(steps) {
auto da = SiSUdocAbstraction!()(
_header_body_inserts[headBody.body_content],
_make_and_meta_struct,
- opts
+ _opt_action,
);
static assert(!isTypeTuple!(da));
static assert(da.length==5);
@@ -664,11 +828,7 @@ struct DocumentMatters {
return _k;
}
auto opt_action() {
- bool[string] _k = opts;
- return _k;
- }
- auto opt_settings() {
- string[string] _k = settings;
+ auto _k = _opt_action;
return _k;
}
auto environment() {
@@ -712,7 +872,7 @@ template SiSUabstractionSummary() {
<<metadoc_summary_imports>>
mixin InternalMarkup;
<<metadoc_summary_initialize>>
- if (doc_matters.opt_action["verbose"]) {
+ if (doc_matters.opt_action.verbose) {
<<meta_metadoc_summary>>
}
}
diff --git a/src/sdp/meta/doc_debugs.d b/src/sdp/meta/doc_debugs.d
index e8ed3e3..2b274a3 100644
--- a/src/sdp/meta/doc_debugs.d
+++ b/src/sdp/meta/doc_debugs.d
@@ -458,10 +458,10 @@ template SiSUdebugs() {
];
}
debug(checkdoc) {
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.do_debug)) {
debug(checkdoc) {
if (auto mfn=match(doc_matters.source_filename, rgx.src_fn)) {
- if (doc_matters.opt_action["assertions"]) {
+ if (doc_matters.opt_action.assertions) {
switch (mfn.captures[2]) {
// live manual:
case "live-manual.ssm":
diff --git a/src/sdp/meta/metadoc.d b/src/sdp/meta/metadoc.d
index 8d83340..f36af09 100644
--- a/src/sdp/meta/metadoc.d
+++ b/src/sdp/meta/metadoc.d
@@ -31,10 +31,9 @@ template SiSUabstraction() {
enum makeMeta { make, meta }
enum docAbst { doc_abstraction, section_keys, segnames, segnames_0_4, images }
static auto rgx = Rgx();
- auto SiSUabstraction(Fn,O,S,E)(
+ auto SiSUabstraction(Fn,O,E)(
Fn fn_src,
- O opts,
- S settings,
+ O _opt_action,
E env,
){
auto sdl_root_config_share = configRead!()("config_share", env);
@@ -73,7 +72,7 @@ template SiSUabstraction() {
auto da = SiSUdocAbstraction!()(
_header_body_inserts[headBody.body_content],
_make_and_meta_struct,
- opts
+ _opt_action,
);
static assert(!isTypeTuple!(da));
static assert(da.length==5);
@@ -116,11 +115,7 @@ template SiSUabstraction() {
return _k;
}
auto opt_action() {
- bool[string] _k = opts;
- return _k;
- }
- auto opt_settings() {
- string[string] _k = settings;
+ auto _k = _opt_action;
return _k;
}
auto environment() {
diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d
index 24c4699..917b66f 100644
--- a/src/sdp/meta/metadoc_from_src.d
+++ b/src/sdp/meta/metadoc_from_src.d
@@ -244,7 +244,6 @@ template SiSUdocAbstraction() {
static auto rgx = Rgx();
debug(asserts) {
static assert(is(typeof(markup_sourcefile_content) == char[][]));
- static assert(is(typeof(opt_action) == bool[string]));
}
/+ ↓ abstraction init +/
scope(success) {
@@ -410,7 +409,7 @@ template SiSUdocAbstraction() {
obj_type_status["glossary_section"] = State.off;
obj_type_status["biblio_section"] = State.on;
obj_type_status["blurb_section"] = State.off;
- if (opt_action["backmatter"] && opt_action["section_biblio"]) {
+ if (opt_action.backmatter && opt_action.section_biblio) {
_biblio_block_(line, obj_type_status, bib_entry, biblio_entry_str_json, biblio_arr_json);
debug(bibliobuild) {
writeln("- ", biblio_entry_str_json);
@@ -431,7 +430,7 @@ template SiSUdocAbstraction() {
obj_type_status["glossary_section"] = State.on;
obj_type_status["biblio_section"] = State.off;
obj_type_status["blurb_section"] = State.off;
- if (opt_action["backmatter"] && opt_action["section_glossary"]) {
+ if (opt_action.backmatter && opt_action.section_glossary) {
indent=[
"hang_position" : 0,
"base_position" : 0,
@@ -513,7 +512,7 @@ template SiSUdocAbstraction() {
obj_type_status["glossary_section"] = State.off;
obj_type_status["biblio_section"] = State.off;
obj_type_status["blurb_section"] = State.on;
- if (opt_action["backmatter"] && opt_action["section_blurb"]) {
+ if (opt_action.backmatter && opt_action.section_blurb) {
indent=[
"hang_position" : 0,
"base_position" : 0,
@@ -563,7 +562,7 @@ template SiSUdocAbstraction() {
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"])) {
+ && (opt_action.backmatter && opt_action.section_blurb)) {
comp_obj_heading_ = comp_obj_heading_.init;
comp_obj_heading_.of_part = "backmatter";
comp_obj_heading_.of_section = "blurb";
@@ -1374,13 +1373,13 @@ template SiSUdocAbstraction() {
obj.obj_cite_number_type = OCNtype.ocn;
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1401,13 +1400,13 @@ template SiSUdocAbstraction() {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1429,10 +1428,10 @@ template SiSUdocAbstraction() {
assert(obj.segment_anchor_tag == html_segnames[obj.ptr_html_segnames]);
}
}
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1459,13 +1458,13 @@ template SiSUdocAbstraction() {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1501,13 +1500,13 @@ template SiSUdocAbstraction() {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1536,13 +1535,13 @@ template SiSUdocAbstraction() {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1575,13 +1574,13 @@ template SiSUdocAbstraction() {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1619,13 +1618,13 @@ template SiSUdocAbstraction() {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1658,13 +1657,13 @@ template SiSUdocAbstraction() {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1701,13 +1700,13 @@ template SiSUdocAbstraction() {
}
}
/+ dom structure (marked up & collapsed) +/
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])
- || (opt_action["sqlite-discrete"])
- || (opt_action["sqlite-update"])
- || (opt_action["postgresql"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)
+ || (opt_action.sqlite_discrete)
+ || (opt_action.sqlite_update)
+ || (opt_action.postgresql)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_markedup, obj.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_collapsed, obj.heading_lev_collapsed);
}
@@ -1793,10 +1792,10 @@ template SiSUdocAbstraction() {
document_section_keys_sequenced["scroll"] ~= "blurb";
document_section_keys_sequenced["sql"] ~= "blurb";
}
- if ((opt_action["html"])
- || (opt_action["html-scroll"])
- || (opt_action["html-seg"])
- || (opt_action["epub"])) {
+ if ((opt_action.html)
+ || (opt_action.html_scroll)
+ || (opt_action.html_seg)
+ || (opt_action.epub)) {
document_section_keys_sequenced["seg"] ~= "tail";
document_section_keys_sequenced["scroll"] ~= "tail";
}
@@ -3012,7 +3011,6 @@ template SiSUdocAbstraction() {
static assert(is(typeof(book_idx_tmp) == string));
static assert(is(typeof(an_object) == string[string]));
static assert(is(typeof(obj_type_status) == int[string]));
- static assert(is(typeof(opt_action) == bool[string]));
}
static auto rgx = Rgx();
if (auto m = line.match(rgx.book_index)) {
@@ -3027,7 +3025,7 @@ template SiSUdocAbstraction() {
} else if (auto m = line.match(rgx.book_index_open)) {
/+ match open book_index +/
obj_type_status["book_index"] = State.on;
- if (opt_action["backmatter"] && opt_action["section_bookindex"]) {
+ if (opt_action.backmatter && opt_action.section_bookindex) {
book_idx_tmp = m.captures[1].to!string;
debug(bookindexmatch) { // book index
writefln(
@@ -3040,8 +3038,8 @@ template SiSUdocAbstraction() {
/+ book_index flag set +/
if (auto m = line.match(rgx.book_index_close)) {
obj_type_status["book_index"] = State.off;
- if (opt_action["backmatter"]
- && opt_action["section_bookindex"]) {
+ if (opt_action.backmatter
+ && opt_action.section_bookindex) {
an_object["bookindex_nugget"] = book_idx_tmp ~ m.captures[1].to!string;
debug(bookindexmatch) { // book index
writefln(
@@ -3052,8 +3050,8 @@ template SiSUdocAbstraction() {
}
book_idx_tmp = "";
} else {
- if (opt_action["backmatter"]
- && opt_action["section_bookindex"]) {
+ if (opt_action.backmatter
+ && opt_action.section_bookindex) {
book_idx_tmp ~= line;
}
}
@@ -4870,7 +4868,6 @@ template SiSUdocAbstraction() {
debug(asserts) {
static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string]));
static assert(is(typeof(obj_cite_digits.on) == int));
- static assert(is(typeof(opt_action) == bool[string]));
}
mixin SiSUnode;
mixin InternalMarkup;
@@ -4887,8 +4884,8 @@ template SiSUdocAbstraction() {
auto node_para_int_ = node_metadata_para_int;
auto node_para_str_ = node_metadata_para_str;
if ((mainkeys.length > 0)
- && (opt_action["backmatter"]
- && opt_action["section_bookindex"])) {
+ && (opt_action.backmatter
+ && opt_action.section_bookindex)) {
string bi_tmp_seg, bi_tmp_scroll;
string[] bi_tmp_tags;
comp_obj_heading_ = comp_obj_heading_.init;
@@ -5104,9 +5101,9 @@ template SiSUdocAbstraction() {
}
return endnotes_;
}
- private auto endnote_objects(N)(
+ private auto endnote_objects(N,O)(
N obj_cite_digits,
- bool[string] opt_action,
+ O opt_action,
)
in {
}
@@ -5120,7 +5117,7 @@ template SiSUdocAbstraction() {
int[string] indent;
ObjGenericComposite comp_obj_heading_;
if ((endnotes_["notes"].length > 0)
- && (opt_action["backmatter"] && opt_action["section_endnotes"])) {
+ && (opt_action.backmatter && opt_action.section_endnotes)) {
comp_obj_heading_ = comp_obj_heading_.init;
comp_obj_heading_.of_part = "backmatter";
comp_obj_heading_.of_section = "endnotes";
@@ -5176,7 +5173,7 @@ template SiSUdocAbstraction() {
comp_obj_heading_.parent_lev_markup = 0;
the_endnotes_section ~= comp_obj_heading_;
}
- if (opt_action["backmatter"] && opt_action["section_endnotes"]) {
+ if (opt_action.backmatter && opt_action.section_endnotes) {
ObjGenericComposite comp_obj_endnote_;
comp_obj_endnote_ = comp_obj_endnote_.init;
comp_obj_endnote_.of_part = "backmatter";
diff --git a/src/sdp/meta/metadoc_summary.d b/src/sdp/meta/metadoc_summary.d
index 45fd319..c1e3f76 100644
--- a/src/sdp/meta/metadoc_summary.d
+++ b/src/sdp/meta/metadoc_summary.d
@@ -20,7 +20,7 @@ template SiSUabstractionSummary() {
std.conv : to;
mixin InternalMarkup;
auto markup = InlineMarkup();
- if (doc_matters.opt_action["verbose"]) {
+ if (doc_matters.opt_action.verbose) {
string[string] check = [
"last_obj_cite_number" : "NA [debug \"checkdoc\" not run]",
"last_obj_cite_number_body" : "0",
diff --git a/src/sdp/output/epub3.d b/src/sdp/output/epub3.d
index b6987ae..78603b2 100644
--- a/src/sdp/output/epub3.d
+++ b/src/sdp/output/epub3.d
@@ -356,13 +356,13 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
case 8: .. case 9:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
}
break;
@@ -380,14 +380,14 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -403,7 +403,7 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -442,14 +442,14 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -485,14 +485,14 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -501,7 +501,7 @@ template outputEPub3() {
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
}
break;
diff --git a/src/sdp/output/html.d b/src/sdp/output/html.d
index 7ed649e..b0b0405 100644
--- a/src/sdp/output/html.d
+++ b/src/sdp/output/html.d
@@ -40,14 +40,14 @@ template outputHTML() {
doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -64,7 +64,7 @@ template outputHTML() {
doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -93,14 +93,14 @@ template outputHTML() {
doc_html ~= xhtml_format.table(obj, _txt);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -130,14 +130,14 @@ template outputHTML() {
doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -146,7 +146,7 @@ template outputHTML() {
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
@@ -254,13 +254,13 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
case 8: .. case 9:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
}
break;
@@ -277,14 +277,14 @@ template outputHTML() {
doc_html[segment_filename] ~= to!string(t[0]);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -300,7 +300,7 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -338,14 +338,14 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= "";
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -381,14 +381,14 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -397,7 +397,7 @@ template outputHTML() {
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
}
break;
diff --git a/src/sdp/output/hub.d b/src/sdp/output/hub.d
index 4f5a363..1600dd2 100644
--- a/src/sdp/output/hub.d
+++ b/src/sdp/output/hub.d
@@ -16,73 +16,73 @@ template outputHub() {
void outputHub(D,I)(D doc_abstraction, I doc_matters) {
mixin SiSUoutputRgxInit;
static auto rgx = Rgx();
- if ((doc_matters.opt_action["verbose"])) {
+ if ((doc_matters.opt_action.verbose)) {
writeln(doc_matters.keys_seq.seg);
}
- if ((doc_matters.opt_action["source"])
- || (doc_matters.opt_action["sisupod"])) {
- if ((doc_matters.opt_action["verbose"])
- && (doc_matters.opt_action["source"]))
+ if ((doc_matters.opt_action.source)
+ || (doc_matters.opt_action.sisupod)) {
+ if ((doc_matters.opt_action.verbose)
+ && (doc_matters.opt_action.source))
{ writeln("sisu source processing... "); }
- if ((doc_matters.opt_action["verbose"])
- && (doc_matters.opt_action["sisupod"]))
+ if ((doc_matters.opt_action.verbose)
+ && (doc_matters.opt_action.sisupod))
{ writeln("sisupod source processing... "); }
SiSUpod!()(doc_matters);
- if ((doc_matters.opt_action["verbose"])
- && (doc_matters.opt_action["debug"])
- && (doc_matters.opt_action["source"]))
+ if ((doc_matters.opt_action.verbose)
+ && (doc_matters.opt_action.debug_do)
+ && (doc_matters.opt_action.source))
{ writeln("sisu source done"); }
- if ((doc_matters.opt_action["verbose"])
- && (doc_matters.opt_action["debug"])
- && (doc_matters.opt_action["sisupod"]))
+ if ((doc_matters.opt_action.verbose)
+ && (doc_matters.opt_action.debug_do)
+ && (doc_matters.opt_action.sisupod))
{ writeln("sisupod done"); }
}
- if (doc_matters.opt_action["text"]) {
+ if (doc_matters.opt_action.text) {
/+ mixin outputText; +/
- if ((doc_matters.opt_action["verbose"])) { writeln("text processing... "); }
+ if ((doc_matters.opt_action.verbose)) { writeln("text processing... "); }
}
- if (doc_matters.opt_action["html"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("html scroll processing... "); }
+ if (doc_matters.opt_action.html) {
+ if ((doc_matters.opt_action.verbose)) { writeln("html scroll processing... "); }
outputHTML!().scroll(doc_abstraction, doc_matters);
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("html scroll done"); }
- if ((doc_matters.opt_action["verbose"])) { writeln("html seg processing... "); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("html scroll done"); }
+ if ((doc_matters.opt_action.verbose)) { writeln("html seg processing... "); }
outputHTML!().seg(doc_abstraction, doc_matters);
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("html seg done"); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("html seg done"); }
outputHTML!().css(doc_matters);
- } else if (doc_matters.opt_action["html-seg"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("html seg processing... "); }
+ } else if (doc_matters.opt_action.html_seg) {
+ if ((doc_matters.opt_action.verbose)) { writeln("html seg processing... "); }
outputHTML!().seg(doc_abstraction, doc_matters);
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("html seg done"); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("html seg done"); }
outputHTML!().css(doc_matters);
- } else if (doc_matters.opt_action["html-scroll"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("html scroll processing... "); }
+ } else if (doc_matters.opt_action.html_scroll) {
+ if ((doc_matters.opt_action.verbose)) { writeln("html scroll processing... "); }
outputHTML!().scroll(doc_abstraction, doc_matters);
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("html scroll done"); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("html scroll done"); }
outputHTML!().css(doc_matters);
}
- if (doc_matters.opt_action["epub"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("epub3 processing... "); }
+ if (doc_matters.opt_action.epub) {
+ if ((doc_matters.opt_action.verbose)) { writeln("epub3 processing... "); }
outputEPub3!()(doc_abstraction, doc_matters);
// epub.css_write;
- if ((doc_matters.opt_action["verbose"]) && (doc_matters.opt_action["debug"])) { writeln("epub3 done"); }
+ if ((doc_matters.opt_action.verbose) && (doc_matters.opt_action.debug_do)) { writeln("epub3 done"); }
}
- if (doc_matters.opt_action["pdf"]) {
+ if (doc_matters.opt_action.pdf) {
/+ mixin outputPDF; +/
writeln("pdf processing");
}
- if (doc_matters.opt_action["odt"]) {
+ if (doc_matters.opt_action.odt) {
/+ mixin outputODT; +/
writeln("odt processing");
}
- if (doc_matters.opt_action["sqlite-discrete"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("sqlite processing... "); }
+ if (doc_matters.opt_action.sqlite_discrete) {
+ if ((doc_matters.opt_action.verbose)) { writeln("sqlite processing... "); }
SQLiteDiscreteBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
}
- if (doc_matters.opt_action["sqlite-update"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("sqlite processing... "); }
+ if (doc_matters.opt_action.sqlite_update) {
+ if ((doc_matters.opt_action.verbose)) { writeln("sqlite processing... "); }
SQLiteBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
}
- if (doc_matters.opt_action["postgresql"]) {
+ if (doc_matters.opt_action.postgresql) {
/+ mixin outputPostgreSQL; +/
writeln("pgsql processing");
}
@@ -98,15 +98,15 @@ template outputHubOp() {
sdp.output.source_sisupod,
sdp.output.create_zip_file,
sdp.output.paths_output;
- void outputHubOp(C)(C config) {
+ void outputHubOp(O)(O opt_action) {
mixin SiSUoutputRgxInit;
static auto rgx = Rgx();
- if ((config["sqlite-create"])) {
- if ((config["verbose"])) { writeln("sqlite create table... "); }
+ if ((opt_action.sqlite_create)) {
+ if ((opt_action.verbose)) { writeln("sqlite create table... "); }
SQLiteTablesCreate!()();
}
- if ((config["sqlite-drop"])) {
- if ((config["verbose"])) { writeln("sqlite drop table... "); }
+ if ((opt_action.sqlite_drop)) {
+ if ((opt_action.verbose)) { writeln("sqlite drop table... "); }
SQLiteTablesDrop!()();
}
}
diff --git a/src/sdp/output/source_sisupod.d b/src/sdp/output/source_sisupod.d
index d83ae87..6e06667 100644
--- a/src/sdp/output/source_sisupod.d
+++ b/src/sdp/output/source_sisupod.d
@@ -30,7 +30,7 @@ template SiSUpod() {
// used both by sisupod zipped (& sisupod filesystem (unzipped) which makes its own recursive dirs)
pths_sisupod.sisupod_dir_().mkdirRecurse;
}
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
if (!exists(pths_sisupod.text_root(doc_matters.source_filename).filesystem_open_zpod)) {
pths_sisupod.text_root(doc_matters.source_filename).filesystem_open_zpod.mkdirRecurse;
}
@@ -70,10 +70,10 @@ template SiSUpod() {
auto fn_src_out_sisupod_zip_base = pths_sisupod.image_root(doc_matters.source_filename).zpod.to!string ~ "/" ~ image;
auto fn_src_out_filesystem = pths_sisupod.image_root(doc_matters.source_filename).filesystem_open_zpod.to!string ~ "/" ~ image;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
fn_src_in.copy(fn_src_out_filesystem);
}
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn_src_out_sisupod_zip_base;
auto zip_data = new OutBuffer();
@@ -88,10 +88,10 @@ template SiSUpod() {
auto fn_src_out_sisupod_zip_base = pths_sisupod.conf_root(doc_matters.source_filename).zpod.to!string ~ "/" ~ "sisu_document_make";
auto fn_src_out_filesystem = pths_sisupod.conf_root(doc_matters.source_filename).filesystem_open_zpod.to!string ~ "/" ~ "sisu_document_make";
if (exists(fn_src_in)) {
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
fn_src_in.copy(fn_src_out_filesystem);
}
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn_src_out_sisupod_zip_base;
auto zip_data = new OutBuffer();
@@ -110,14 +110,14 @@ template SiSUpod() {
if (exists(fn_src_in)) {
filelist_src_out_sisupod_arr ~= fn_src_out_sisupod_zip_base;
filelist_src_zpod_arr ~= fn_src_out_inside_pod;
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
auto filelist = File(pths_sisupod.fn_pod_filelist(doc_matters.source_filename).filesystem_open_zpod, "w");
foreach (source_pth_and_fn; filelist_src_zpod_arr) {
filelist.writeln(source_pth_and_fn);
}
fn_src_in.copy(fn_src_out_filesystem);
}
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn_src_out_sisupod_zip_base;
auto zip_data = new OutBuffer();
@@ -150,10 +150,10 @@ template SiSUpod() {
insert_file,
).filesystem_open_zpod.to!string;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action["source"]) {
+ if (doc_matters.opt_action.source) {
fn_src_in.copy(fn_src_out_filesystem);
}
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn_src_out_sisupod_zip_base;
auto zip_data = new OutBuffer();
@@ -168,7 +168,7 @@ template SiSUpod() {
} {
auto fn_src_in = doc_matters.source_filename;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action["sisupod"]) {
+ if (doc_matters.opt_action.sisupod) {
createZipFile!()(fn_sisupod, zip.build());
}
}
diff --git a/src/sdp/output/sqlite.d b/src/sdp/output/sqlite.d
index 6a9acd2..591b002 100644
--- a/src/sdp/output/sqlite.d
+++ b/src/sdp/output/sqlite.d
@@ -44,7 +44,7 @@ template SQLiteBuildTablesAndPopulate() {
if (_urls.length > 0) {
_txt ~= _urls;
}
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
writeln(_txt, "\n");
}
debug(sql_text_clean) {
@@ -96,7 +96,7 @@ template SQLiteBuildTablesAndPopulate() {
if (_notes.length > 0) {
_txt ~= _notes;
}
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
writeln(_txt, "\n");
}
return _txt;
@@ -303,7 +303,7 @@ template SQLiteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_heading(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -322,7 +322,7 @@ template SQLiteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_para(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -341,7 +341,7 @@ template SQLiteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_quote(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -360,7 +360,7 @@ template SQLiteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_group(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -379,7 +379,7 @@ template SQLiteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_block(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -398,7 +398,7 @@ template SQLiteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_verse(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -417,7 +417,7 @@ template SQLiteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_code(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -436,7 +436,7 @@ template SQLiteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_table(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -459,8 +459,8 @@ template SQLiteBuildTablesAndPopulate() {
auto pth_sqlite = SiSUpathsSQLite!()(doc_matters.src_path_info, doc_matters.language);
auto db = Database(pth_sqlite.sqlite_file(doc_matters.environment["pwd"].baseName));
// auto db = Database(":memory:"); // open database in memory
- if (doc_matters.opt_action["sqlite-create"]) {
- if ((doc_matters.opt_action["verbose"])) { writeln("sqlite create tables... "); }
+ if (doc_matters.opt_action.sqlite_create) {
+ if ((doc_matters.opt_action.verbose)) { writeln("sqlite create tables... "); }
db.run("
DROP TABLE IF EXISTS metadata_and_text;
DROP TABLE IF EXISTS doc_objects;
@@ -911,14 +911,14 @@ template SQLiteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.heading(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -940,7 +940,7 @@ template SQLiteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.para(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -969,14 +969,14 @@ template SQLiteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.table(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1006,14 +1006,14 @@ template SQLiteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.para(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1022,7 +1022,7 @@ template SQLiteBuildTablesAndPopulate() {
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); // check where empty value could come from
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
writeln(__FILE__, ":", __LINE__, ": ", obj.text); // check where empty value could come from
diff --git a/src/sdp/output/sqlite_discrete.d b/src/sdp/output/sqlite_discrete.d
index 132d312..7415f4c 100644
--- a/src/sdp/output/sqlite_discrete.d
+++ b/src/sdp/output/sqlite_discrete.d
@@ -44,7 +44,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
if (_urls.length > 0) {
_txt ~= _urls;
}
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
writeln(_txt, "\n");
}
debug(sql_text_clean) {
@@ -96,7 +96,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
if (_notes.length > 0) {
_txt ~= _notes;
}
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
writeln(_txt, "\n");
}
return _txt;
@@ -303,7 +303,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_heading(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -322,7 +322,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_para(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -341,7 +341,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_quote(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -360,7 +360,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_group(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -379,7 +379,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_block(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -398,7 +398,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_verse(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -417,7 +417,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_code(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -436,7 +436,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
"text": generic_munge_sanitize_text_for_search(obj.text),
"html": html_table(obj)
];
- if (doc_matters.opt_action["debug"]) {
+ if (doc_matters.opt_action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -908,14 +908,14 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.heading(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -937,7 +937,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.para(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -966,14 +966,14 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.table(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1003,14 +1003,14 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.para(obj);
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -1019,7 +1019,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
case "comment":
break;
default:
- if ((doc_matters.opt_action["debug"])) {
+ if ((doc_matters.opt_action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part); // check where empty value could come from
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
writeln(__FILE__, ":", __LINE__, ": ", obj.text); // check where empty value could come from
diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d
index 330fe7a..ac022ba 100755
--- a/src/sdp/sdp.d
+++ b/src/sdp/sdp.d
@@ -148,6 +148,157 @@ void main(string[] args) {
if (helpInfo.helpWanted) {
defaultGetoptPrinter("Some information about the program.", helpInfo.options);
}
+ struct OptActions {
+ auto assertions() {
+ auto _k = opts["assertions"];
+ return _k;
+ }
+ auto concordance() {
+ auto _k = opts["concordance"];
+ return _k;
+ }
+ auto debug_do() {
+ auto _k = opts["debug"];
+ return _k;
+ }
+ auto digest() {
+ auto _k = opts["digest"];
+ return _k;
+ }
+ auto docbook() {
+ auto _k = opts["docbook"];
+ return _k;
+ }
+ auto epub() {
+ auto _k = opts["epub"];
+ return _k;
+ }
+ auto html() {
+ auto _k = opts["html"];
+ return _k;
+ }
+ auto html_seg() {
+ auto _k = opts["html-seg"];
+ return _k;
+ }
+ auto html_scroll() {
+ auto _k = opts["html-scroll"];
+ return _k;
+ }
+ auto manifest() {
+ auto _k = opts["manifest"];
+ return _k;
+ }
+ auto ocn() {
+ auto _k = opts["ocn"];
+ return _k;
+ }
+ auto odt() {
+ auto _k = opts["odt"];
+ return _k;
+ }
+ auto pdf() {
+ auto _k = opts["pdf"];
+ return _k;
+ }
+ auto postgresql() {
+ auto _k = opts["postgresql"];
+ return _k;
+ }
+ auto qrcode() {
+ auto _k = opts["qrcode"];
+ return _k;
+ }
+ auto sisupod() {
+ auto _k = opts["sisupod"];
+ return _k;
+ }
+ auto source() {
+ auto _k = opts["source"];
+ return _k;
+ }
+ auto sqlite_discrete() {
+ auto _k = opts["sqlite-discrete"];
+ return _k;
+ }
+ auto sqlite_update() {
+ auto _k = opts["sqlite-update"];
+ return _k;
+ }
+ auto sqlite_create() {
+ auto _k = opts["sqlite-create"];
+ return _k;
+ }
+ auto sqlite_drop() {
+ auto _k = opts["sqlite-drop"];
+ return _k;
+ }
+ auto text() {
+ auto _k = opts["text"];
+ return _k;
+ }
+ auto verbose() {
+ auto _k = opts["verbose"];
+ return _k;
+ }
+ auto xhtml() {
+ auto _k = opts["xhtml"];
+ return _k;
+ }
+ auto xml_dom() {
+ auto _k = opts["xml-dom"];
+ return _k;
+ }
+ auto xml_sax() {
+ auto _k = opts["xml-sax"];
+ return _k;
+ }
+ auto section_toc() {
+ auto _k = opts["section_toc"];
+ return _k;
+ }
+ auto section_body() {
+ auto _k = opts["section_body"];
+ return _k;
+ }
+ auto section_endnotes() {
+ auto _k = opts["section_endnotes"];
+ return _k;
+ }
+ auto section_glossary() {
+ auto _k = opts["section_glossary"];
+ return _k;
+ }
+ auto section_biblio() {
+ auto _k = opts["section_biblio"];
+ return _k;
+ }
+ auto section_bookindex() {
+ auto _k = opts["section_bookindex"];
+ return _k;
+ }
+ auto section_blurb() {
+ auto _k = opts["section_blurb"];
+ return _k;
+ }
+ auto backmatter() {
+ auto _k = opts["backmatter"];
+ return _k;
+ }
+ auto skip_output() {
+ auto _k = opts["skip-output"];
+ return _k;
+ }
+ auto languages_set() {
+ auto _k = settings["lang"].split(",");
+ return _k;
+ }
+ auto output_dir_set() {
+ auto _k = settings["output-dir"];
+ return _k;
+ }
+ }
+ auto _opt_action = OptActions();
foreach(arg; args[1..$]) {
if (arg.match(rgx.flag_action)) {
flag_action ~= " " ~ arg; // flags not taken by getopt
@@ -183,8 +334,8 @@ void main(string[] args) {
contents_location ~ "»"
);
auto contents_location_pth_ = (contents_location).to!string;
- auto lang_rgx_ = regex(r"/(" ~ settings["lang"].split(",").join("|") ~ ")/");
- if (settings["lang"] == "all"
+ auto lang_rgx_ = regex(r"/(" ~ _opt_action.languages_set.join("|") ~ ")/");
+ if (_opt_action.languages_set[0] == "all"
|| (contents_location_pth_).match(lang_rgx_)
) {
fns_src ~= (((tmp_dir_).chainPath(contents_location_pth_)).array).to!(char[]);
@@ -200,8 +351,8 @@ void main(string[] args) {
"pwd" : environment["PWD"],
"home" : environment["HOME"],
];
- if (!(opts["skip-output"])) {
- outputHubOp!()(opts);
+ if (!(_opt_action.skip_output)) {
+ outputHubOp!()(_opt_action);
}
if (fns_src.length > 0) {
foreach(fn_src; fns_src) {
@@ -229,23 +380,23 @@ void main(string[] args) {
"not a sisu markup filename: «" ~
fn_src ~ "»"
);
- auto t = SiSUabstraction!()(fn_src, opts, settings, env);
+ auto t = SiSUabstraction!()(fn_src, _opt_action, env);
static assert(!isTypeTuple!(t));
static assert(t.length==2);
auto doc_abstraction = t[dAM.abstraction];
auto doc_matters = t[dAM.matters];
/+ ↓ debugs +/
- if (doc_matters.opt_action["verbose"]) {
+ if (doc_matters.opt_action.verbose) {
SiSUabstractionSummary!()(doc_abstraction, doc_matters);
}
/+ ↓ debugs +/
- if ((doc_matters.opt_action["debug"])
- || (doc_matters.opt_action["verbose"])
+ if ((doc_matters.opt_action.debug_do)
+ || (doc_matters.opt_action.verbose)
) {
SiSUdebugs!()(doc_abstraction, doc_matters);
}
/+ ↓ output hub +/
- if (!(opts["skip-output"])) {
+ if (!(doc_matters.opt_action.skip_output)) {
outputHub!()(doc_abstraction, doc_matters);
}
scope(exit) {
diff --git a/views/version.txt b/views/version.txt
index f39f6a3..1dc7d0d 100644
--- a/views/version.txt
+++ b/views/version.txt
@@ -4,7 +4,7 @@ struct Version {
int minor;
int patch;
}
-enum ver = Version(0, 20, 0);
+enum ver = Version(0, 20, 1);
version (Posix) {
version (DigitalMars) {
} else version (LDC) {