aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-01-06 20:34:42 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitbdcb9189e4cf221bec1efaf2e6e612b127e51f25 (patch)
tree139cffff54a3afdfa9dd70799ef489c3fb51c73d /src
parenttarget config file locations, refine (diff)
0.23.3 work on source & target file paths/locations
Diffstat (limited to 'src')
-rw-r--r--src/sdp/meta/conf_make_meta_sdlang.d12
-rw-r--r--src/sdp/meta/defaults.d44
-rw-r--r--src/sdp/meta/doc_debugs.d42
-rw-r--r--src/sdp/meta/metadoc.d186
-rw-r--r--src/sdp/meta/metadoc_from_src.d410
-rw-r--r--src/sdp/meta/metadoc_summary.d8
-rw-r--r--src/sdp/meta/read_config_files.d24
-rw-r--r--src/sdp/meta/read_source_files.d43
-rw-r--r--src/sdp/meta/rgx.d1
-rw-r--r--src/sdp/output/epub3.d102
-rw-r--r--src/sdp/output/html.d62
-rw-r--r--src/sdp/output/hub.d125
-rw-r--r--src/sdp/output/paths_source.d491
-rw-r--r--src/sdp/output/rgx.d1
-rw-r--r--src/sdp/output/source_sisupod.d160
-rw-r--r--src/sdp/output/sqlite.d46
-rw-r--r--src/sdp/output/sqlite_discrete.d42
-rw-r--r--src/sdp/output/xmls.d12
-rwxr-xr-xsrc/sdp/sdp.d28
19 files changed, 1032 insertions, 807 deletions
diff --git a/src/sdp/meta/conf_make_meta_sdlang.d b/src/sdp/meta/conf_make_meta_sdlang.d
index 728f095..ef395d0 100644
--- a/src/sdp/meta/conf_make_meta_sdlang.d
+++ b/src/sdp/meta/conf_make_meta_sdlang.d
@@ -24,8 +24,8 @@ static template SiSUextractSDLang() {
debug(asserts){
static assert(is(typeof(src_header) == char[]));
}
- char[][] source_header_arr =
- (cast(char[]) src_header).split(rgx.newline_eol_delimiter);
+ char[][] source_header_arr
+ = (cast(char[]) src_header).split(rgx.newline_eol_delimiter);
char[] _src_header;
foreach(header_line; source_header_arr) {
if (!match(header_line, rgx.comments)) {
@@ -207,12 +207,12 @@ static template SiSUextractSDLang() {
Tag _maintag = header_sdlang.getTag("title");
if (_maintag !is null) {
if ("main" in _maintag.maybe.tags) {
- _conf_composite.meta.title_main =
- to!string(_maintag.getTagValues("main"));
+ _conf_composite.meta.title_main
+ = to!string(_maintag.getTagValues("main"));
} else if ("main" !in _maintag.maybe.attributes) {
writeln(_maintag.values[0]); // document title
- _conf_composite.meta.title_main =
- (_maintag.values[0]).to!string; // test that this exists
+ _conf_composite.meta.title_main
+ = (_maintag.values[0]).to!string; // test that this exists
}
}
}
diff --git a/src/sdp/meta/defaults.d b/src/sdp/meta/defaults.d
index e598aa8..7f0586e 100644
--- a/src/sdp/meta/defaults.d
+++ b/src/sdp/meta/defaults.d
@@ -178,8 +178,8 @@ template SiSUregisters() {
}
return _conf_composite_string;
}
- static auto ptr_head_main =
- [
+ static auto ptr_head_main
+ = [
"classify",
"creator",
"date",
@@ -191,24 +191,24 @@ template SiSUregisters() {
"rights",
"title"
];
- static auto ptr_head_sub_classify =
- [
+ static auto ptr_head_sub_classify
+ = [
"dewey",
"keywords",
"loc",
"subject",
"topic_register"
];
- static auto ptr_head_sub_creator =
- [
+ static auto ptr_head_sub_creator
+ = [
"author",
"author_email",
"cover",
"illustrator",
"translator"
];
- static auto ptr_head_sub_date =
- [
+ static auto ptr_head_sub_date
+ = [
"added_to_site",
"available",
"created",
@@ -217,15 +217,15 @@ template SiSUregisters() {
"published",
"valid"
];
- static auto ptr_head_sub_identifier =
- [
+ static auto ptr_head_sub_identifier
+ = [
"isbn",
"oclc",
"pg"
];
/+ make +/
- static auto ptr_head_sub_make =
- [
+ static auto ptr_head_sub_make
+ = [
"cover_image",
"home_button_image",
"home_button_text",
@@ -239,28 +239,28 @@ template SiSUregisters() {
"texpdf_font",
"css"
];
- static auto ptr_head_sub_notes =
- [
+ static auto ptr_head_sub_notes
+ = [
"abstract",
"description"
];
- static auto ptr_head_sub_original =
- [
+ static auto ptr_head_sub_original
+ = [
"language",
"source",
"title"
];
- static auto ptr_head_sub_publisher =
- [ "name" ];
- static auto ptr_head_sub_rights =
- [
+ static auto ptr_head_sub_publisher
+ = [ "name" ];
+ static auto ptr_head_sub_rights
+ = [
"copyright",
"cover",
"illustrations",
"license"
];
- static auto ptr_head_sub_title =
- [
+ static auto ptr_head_sub_title
+ = [
"edition",
"full",
"language",
diff --git a/src/sdp/meta/doc_debugs.d b/src/sdp/meta/doc_debugs.d
index 2b274a3..255ea92 100644
--- a/src/sdp/meta/doc_debugs.d
+++ b/src/sdp/meta/doc_debugs.d
@@ -37,7 +37,7 @@ template SiSUdebugs() {
__FILE__,
__LINE__,
);
- foreach (key; doc_matters.keys_seq.seg) {
+ foreach (key; doc_matters.xml.keys_seq.seg) {
foreach (obj; contents[key]) {
if (obj.of_part != "empty") {
if (obj.is_a == "heading") {
@@ -60,14 +60,16 @@ template SiSUdebugs() {
__FILE__,
__LINE__,
);
- foreach (obj; contents[key]) {
- if (obj.of_part != "empty") {
- writefln(
- "[%s][%s]\n%s",
- obj.obj_cite_number,
- obj.is_a,
- obj.text
- );
+ if (key.length > 0) {
+ foreach (obj; contents[key]) {
+ if (obj.of_part != "empty") {
+ writefln(
+ "[%s][%s]\n%s",
+ obj.obj_cite_number,
+ obj.is_a,
+ obj.text
+ );
+ }
}
}
}
@@ -115,7 +117,7 @@ template SiSUdebugs() {
}
debug(toc_nav_dom) {
enum DomTags { none, open, close, close_and_open, open_still, }
- foreach (sect; doc_matters.keys_seq.seg) {
+ foreach (sect; doc_matters.xml.keys_seq.seg) {
foreach (obj; contents[sect]) {
if (obj.is_a == "heading") {
foreach_reverse (k; 0 .. 7) {
@@ -142,7 +144,7 @@ template SiSUdebugs() {
}
}
writeln("--------------------");
- foreach (sect; doc_matters.keys_seq.seg) {
+ foreach (sect; doc_matters.xml.keys_seq.seg) {
foreach (obj; contents[sect]) {
if (obj.is_a == "heading") {
foreach_reverse (k; 0 .. 7) {
@@ -401,7 +403,7 @@ template SiSUdebugs() {
__FILE__,
__LINE__,
);
- foreach (k; doc_matters.keys_seq.seg) {
+ foreach (k; doc_matters.xml.keys_seq.seg) {
foreach (obj; contents[k]) {
if (obj.is_a == "heading") {
writefln(
@@ -417,7 +419,7 @@ template SiSUdebugs() {
}
}
debug(heading) { // heading
- foreach (k; doc_matters.keys_seq.seg) {
+ foreach (k; doc_matters.xml.keys_seq.seg) {
foreach (o; contents[k]) {
if (o.is_a == "heading") {
writefln(
@@ -438,7 +440,7 @@ template SiSUdebugs() {
__FILE__,
__LINE__,
);
- foreach (k; doc_matters.keys_seq.seg) {
+ foreach (k; doc_matters.xml.keys_seq.seg) {
foreach (obj; contents[k]) {
if (obj.is_a == "heading") {
writefln(
@@ -458,10 +460,10 @@ template SiSUdebugs() {
];
}
debug(checkdoc) {
- if ((doc_matters.opt_action.do_debug)) {
+ if ((doc_matters.opt.action.debug_do)) {
debug(checkdoc) {
- if (auto mfn=match(doc_matters.source_filename, rgx.src_fn)) {
- if (doc_matters.opt_action.assertions) {
+ if (auto mfn=match(doc_matters.src.filename, rgx.src_fn)) {
+ if (doc_matters.opt.action.assertions) {
switch (mfn.captures[2]) {
// live manual:
case "live-manual.ssm":
@@ -580,7 +582,7 @@ template SiSUdebugs() {
// error in bookindex ... (ch7 ... building the cc machine, an extra semi colon)
break;
default:
- writeln(doc_matters.source_filename);
+ writeln(doc_matters.src.filename);
break;
}
}
@@ -591,11 +593,11 @@ template SiSUdebugs() {
auto return ref const S contents,
auto return ref T doc_matters,
) {
- foreach (key; doc_matters.keys_seq.seg) {
+ foreach (key; doc_matters.xml.keys_seq.seg) {
if (contents[key].length > 1) {
foreach (obj; contents[key]) {
if (obj.heading_lev_markup == 4) {
- writeln(obj.ptr_html_segnames, ". (", doc_matters.segnames[obj.ptr_html_segnames], ") -> ", obj.text);
+ writeln(obj.ptr_html_segnames, ". (", doc_matters.xml.segnames[obj.ptr_html_segnames], ") -> ", obj.text);
}
}
}
diff --git a/src/sdp/meta/metadoc.d b/src/sdp/meta/metadoc.d
index 44807b2..129e53c 100644
--- a/src/sdp/meta/metadoc.d
+++ b/src/sdp/meta/metadoc.d
@@ -46,8 +46,8 @@ template SiSUabstraction() {
": step1 commence → (get document header & body & insert file list & if needed image list)"
);
}
- auto _header_body_insertfilelist_imagelist =
- SiSUrawMarkupContent!()(_opt_action, _manifest.src_path_and_fn);
+ auto _header_body_insertfilelist_imagelist
+ = SiSUrawMarkupContent!()(_opt_action, _manifest.src.path_and_fn);
static assert(!isTypeTuple!(_header_body_insertfilelist_imagelist));
static assert(_header_body_insertfilelist_imagelist.length==4);
debug(steps) {
@@ -64,8 +64,11 @@ template SiSUabstraction() {
": step2 commence → (doc header: make & meta as struct)"
);
}
- auto _make_and_meta_struct =
- docHeaderMakeAndMetaTupExtractAndConvertToStruct!()(conf_files_composite_make, _header_body_insertfilelist_imagelist[headBody.header]); // breakage ...
+ auto _make_and_meta_struct
+ = docHeaderMakeAndMetaTupExtractAndConvertToStruct!()(
+ conf_files_composite_make,
+ _header_body_insertfilelist_imagelist[headBody.header]
+ ); // breakage ...
debug(steps) {
writeln(__LINE__, ":", __FILE__, ": step2 complete");
}
@@ -92,84 +95,135 @@ template SiSUabstraction() {
writeln(__LINE__, ":", __FILE__, ": step4 commence → (doc_matters)");
}
struct DocumentMatters {
- auto opt_action() {
- /+ getopt options, commandline instructions, raw
- - processing instructions --epub --html etc.
- - command line config instructions --output-path
- +/
- return _opt_action;
- }
auto conf_make_meta() { // TODO meld with all make instructions
auto _k = _make_and_meta_struct;
return _k;
}
- auto environment() {
+ auto env() {
struct Env_ {
auto pwd() {
- return _manifest.pwd;
+ return _manifest.env.pwd;
}
auto home() {
- return _manifest.home;
+ return _manifest.env.home;
}
}
return Env_();
}
- auto is_pod() {
- return _manifest.is_pod;
- }
- auto source_filename() {
- return _manifest.src_fn;
+ auto opt() {
+ struct Opt_ {
+ auto action() {
+ /+ getopt options, commandline instructions, raw
+ - processing instructions --epub --html etc.
+ - command line config instructions --output-path
+ +/
+ return _opt_action;
+ }
+ }
+ return Opt_();
}
- auto src_path_info() { // consider, reconsider?
- auto _k = SiSUpathsSRC!()(_manifest.pwd, _manifest.src_fn);
- return _k;
+ auto src() {
+ struct SRC_ {
+ auto is_pod() {
+ return _manifest.src.is_pod;
+ }
+ auto filename() {
+ return _manifest.src.filename;
+ }
+ auto language() {
+ return _manifest.src.lng;
+ }
+ auto path_info() {
+ auto _k = SiSUpathsSRC!()(_manifest.env.pwd, _manifest.src.file_with_absolute_path); // would like (to have and use) relative path
+ return _k;
+ }
+ auto file_with_absolute_path() {
+ auto _k = _manifest.src.file_with_absolute_path;
+ return _k;
+ }
+ auto absolute_path_to_src() {
+ auto _k = _manifest.src.absolute_path_to_src;
+ return _k;
+ }
+ auto base_dir() {
+ auto _k = _manifest.src.base_dir;
+ return _k;
+ }
+ auto base_parent_dir_path() {
+ auto _k = _manifest.src.base_parent_dir_path;
+ return _k;
+ }
+ auto base_dir_path() {
+ auto _k = _manifest.src.base_dir_path;
+ return _k;
+ }
+ auto media_dir_path() {
+ auto _k = _manifest.src.media_dir_path;
+ return _k;
+ }
+ auto base_parent_dir() {
+ auto _k = _manifest.src.base_parent_dir;
+ return _k;
+ }
+ auto file_insert_list() {
+ string[] _k = _header_body_insertfilelist_imagelist[headBody.insert_file_list];
+ return _k;
+ }
+ auto image_list() {
+ return _images;
+ }
+ }
+ return SRC_();
}
- auto language() {
- return _manifest.src_lng;
+ auto pod() {
+ struct Pod_ {
+ auto src_is_pod() {
+ return _manifest.pod.src_is_pod;
+ }
+ auto manifest_list_of_filenames() {
+ return _manifest.pod.manifest_list_of_filenames;
+ }
+ auto manifest_list_of_languages() {
+ return _manifest.pod.manifest_list_of_languages;
+ }
+ auto manifest_filename() {
+ return _manifest.pod.manifest_filename;
+ }
+ auto manifest_path() {
+ return _manifest.pod.manifest_path;
+ }
+ auto manifest_file_with_path() {
+ return _manifest.pod.manifest_file_with_path;
+ }
+ auto config_dirs() {
+ return _manifest.pod.config_dirs;
+ }
+ auto image_dirs() {
+ return _manifest.pod.image_dirs;
+ }
+ }
+ return Pod_();
+ }
+ auto xml() {
+ struct XML_ {
+ auto keys_seq() {
+ /+ contains .seg & .scroll sequences +/
+ auto _k = _document_section_keys_sequenced;
+ return _k;
+ }
+ string[] segnames() {
+ string[] _k = _doc_html_segnames;
+ return _k;
+ }
+ string[] segnames_lv_0_to_4() {
+ string[] _k = _doc_epub_segnames_0_4;
+ return _k;
+ }
+ }
+ return XML_();
}
auto output_path() {
- return _manifest.output_path;
- }
- auto pod_manifest_list_of_filenames() {
- return _manifest.pod_manifest_list_of_filenames;
- }
- auto pod_manifest_list_of_languages() {
- return _manifest.pod_manifest_list_of_languages;
- }
- auto pod_manifest_filename() {
- return _manifest.pod_manifest_filename;
- }
- auto pod_manifest_path() {
- return _manifest.pod_manifest_path;
- }
- auto pod_manifest_file_with_path() {
- return _manifest.pod_manifest_file_with_path;
- }
- auto pod_config_dirs() {
- return _manifest.pod_config_dirs;
- }
- auto pod_image_dirs() {
- return _manifest.pod_image_dirs;
- }
- auto file_insert_list() {
- string[] _k = _header_body_insertfilelist_imagelist[headBody.insert_file_list];
- return _k;
- }
- auto image_list() {
- return _images;
- }
- auto keys_seq() {
- /+ contains .seg & .scroll sequences +/
- auto _k = _document_section_keys_sequenced;
- return _k;
- }
- string[] segnames() {
- string[] _k = _doc_html_segnames;
- return _k;
- }
- string[] segnames_lv_0_to_4() {
- string[] _k = _doc_epub_segnames_0_4;
- return _k;
+ return _manifest.output.path;
}
}
auto doc_matters = DocumentMatters();
diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d
index 917b66f..a8014e3 100644
--- a/src/sdp/meta/metadoc_from_src.d
+++ b/src/sdp/meta/metadoc_from_src.d
@@ -779,8 +779,8 @@ template SiSUdocAbstraction() {
: ocn_emit(OCNstatus.on); // : ocn_emit(obj_type_status["ocn_status"]);
an_object["is"] = "heading";
an_object_key="body_nugget";
- auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_object_and_anchor_tags_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[sObj.content];
anchor_tags = substantive_object_and_anchor_tags_tuple[sObj.anchor_tags];
if (an_object["lev_markup_number"].to!int == 4) {
@@ -814,10 +814,10 @@ template SiSUdocAbstraction() {
break;
}
}
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_digits, segment_anchor_tag_that_object_belongs_to);
+ an_object["bookindex_nugget"]
+ = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes
+ = bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_digits, segment_anchor_tag_that_object_belongs_to);
/+ (incrementally build toc) table of contents here! +/
_anchor_tag=to!string(obj_cite_digits.on);
the_table_of_contents_section = obj_im.table_of_contents_gather_headings(
@@ -833,8 +833,8 @@ template SiSUdocAbstraction() {
html_segnames_ptr = html_segnames_ptr_cntr;
html_segnames_ptr_cntr++;
}
- auto comp_obj_heading =
- node_construct.node_emitter_heading(
+ auto comp_obj_heading
+ = node_construct.node_emitter_heading(
an_object["substantive"], // string
an_object["lev"], // string
an_object["lev_markup_number"], // string
@@ -868,13 +868,13 @@ template SiSUdocAbstraction() {
&& (line_occur["para"] > State.off)) {
/+ paragraph object (current line empty) +/
obj_cite_digits = ocn_emit(obj_type_status["ocn_status"]);
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_digits, segment_anchor_tag_that_object_belongs_to);
+ an_object["bookindex_nugget"]
+ = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes
+ = bookindex_extract_hash.bookindex_nugget_hash(an_object["bookindex_nugget"], obj_cite_digits, segment_anchor_tag_that_object_belongs_to);
an_object["is"] = "para";
- auto comp_obj_heading =
- node_construct.node_location_emitter(
+ auto comp_obj_heading
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -882,8 +882,8 @@ template SiSUdocAbstraction() {
heading_ptr-1,
an_object["is"],
);
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
comp_obj_para = comp_obj_para.init;
@@ -968,8 +968,8 @@ template SiSUdocAbstraction() {
}
} /+ ← closed: loop markup document/text line by line +/
/+ ↓ post loop markup document/text +/
- auto en_tuple =
- note_section.endnote_objects(obj_cite_digits, opt_action);
+ auto en_tuple
+ = note_section.endnote_objects(obj_cite_digits, opt_action);
static assert(!isTypeTuple!(en_tuple));
auto the_endnotes_section = en_tuple[0];
obj_cite_digits = en_tuple[1];
@@ -1010,8 +1010,8 @@ template SiSUdocAbstraction() {
}
auto biblio_unsorted_incomplete = biblio_arr_json.dup;
auto biblio = Bibliography();
- auto biblio_ordered =
- biblio._bibliography_(biblio_unsorted_incomplete, bib_arr_json);
+ auto biblio_ordered
+ = biblio._bibliography_(biblio_unsorted_incomplete, bib_arr_json);
if (biblio_ordered.length > 0) {
comp_obj_heading_ = comp_obj_heading_.init;
comp_obj_heading_.of_part = "backmatter";
@@ -1104,8 +1104,8 @@ template SiSUdocAbstraction() {
}
}
auto bi = BookIndexReportSection();
- auto bi_tuple =
- bi.bookindex_build_abstraction_section(
+ auto bi_tuple
+ = bi.bookindex_build_abstraction_section(
bookindex_unordered_hashes,
obj_cite_digits,
opt_action,
@@ -1894,8 +1894,8 @@ template SiSUdocAbstraction() {
obj_type_status["ocn_status"] = OCNstatus.on;
}
} else {
- obj_type_status["ocn_status"] =
- obj_type_status["ocn_status_off_for_multiple_objects"];
+ obj_type_status["ocn_status"]
+ = obj_type_status["ocn_status_off_for_multiple_objects"];
}
}
} else if ((!line.empty) && (obj_type_status["ocn_status_off_for_multiple_objects"] > TriState.off)) {
@@ -2250,8 +2250,8 @@ template SiSUdocAbstraction() {
);
}
an_object["is"] = "verse";
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
comp_obj_block = comp_obj_block.init;
@@ -2308,8 +2308,8 @@ template SiSUdocAbstraction() {
heading_ptr-1,
an_object["is"]
);
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
comp_obj_block = comp_obj_block.init;
@@ -2351,8 +2351,8 @@ template SiSUdocAbstraction() {
}
processing.remove("verse");
an_object["is"] = "verse";
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
comp_obj_block = comp_obj_block.init;
@@ -2400,8 +2400,8 @@ template SiSUdocAbstraction() {
}
processing.remove("verse");
an_object["is"] = "verse";
- auto comp_obj_location =
- node_construct.node_location_emitter(
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -2409,8 +2409,8 @@ template SiSUdocAbstraction() {
heading_ptr-1,
an_object["is"]
);
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
comp_obj_block = comp_obj_block.init;
@@ -2631,8 +2631,8 @@ template SiSUdocAbstraction() {
}
switch (biblio_tag_name) {
case "author_raw": // author_arr author (fn sn)
- j["author_arr"] =
- header_tag_value.split(rgx.arr_delimiter);
+ j["author_arr"]
+ = header_tag_value.split(rgx.arr_delimiter);
string tmp;
biblioAuthorLoop:
foreach (au; j["author_arr"].array) {
@@ -2646,8 +2646,8 @@ template SiSUdocAbstraction() {
j["author"].str = tmp;
goto default;
case "editor_raw": // editor_arr editor (fn sn)
- j["editor_arr"] =
- header_tag_value.split(rgx.arr_delimiter);
+ j["editor_arr"]
+ = header_tag_value.split(rgx.arr_delimiter);
string tmp;
biblioEditorLoop:
foreach (ed; j["editor_arr"].array) {
@@ -2701,8 +2701,8 @@ template SiSUdocAbstraction() {
) {
comp_obj_block = comp_obj_block.init;
obj_cite_digits = ocn_emit(OCNstatus.on);
- auto comp_obj_location =
- node_construct.node_location_emitter(
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -2711,8 +2711,8 @@ template SiSUdocAbstraction() {
"table"
);
an_object["is"] = "table";
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, "body_nugget", conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
comp_obj_block.ocn = obj_cite_digits.on;
comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string;
@@ -2751,17 +2751,17 @@ template SiSUdocAbstraction() {
assertions_flag_types_block_status_none_or_closed(obj_type_status);
if (obj_type_status["quote"] == TriState.closing) {
obj_cite_digits = ocn_emit(OCNstatus.on);
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(
+ an_object["bookindex_nugget"]
+ = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes
+ = bookindex_extract_hash.bookindex_nugget_hash(
an_object["bookindex_nugget"],
obj_cite_digits,
segment_anchor_tag_that_object_belongs_to
);
an_object["is"] = "quote";
- auto comp_obj_location =
- node_construct.node_location_emitter(
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -2769,8 +2769,8 @@ template SiSUdocAbstraction() {
heading_ptr-1,
an_object["is"]
);
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
comp_obj_block = comp_obj_block.init;
@@ -2795,17 +2795,17 @@ template SiSUdocAbstraction() {
++cntr;
} else if (obj_type_status["group"] == TriState.closing) {
obj_cite_digits = ocn_emit(OCNstatus.on);
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(
+ an_object["bookindex_nugget"]
+ = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes
+ = bookindex_extract_hash.bookindex_nugget_hash(
an_object["bookindex_nugget"],
obj_cite_digits,
segment_anchor_tag_that_object_belongs_to
);
an_object["is"] = "group";
- auto comp_obj_location =
- node_construct.node_location_emitter(
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -2813,8 +2813,8 @@ template SiSUdocAbstraction() {
heading_ptr-1,
an_object["is"]
);
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
comp_obj_block = comp_obj_block.init;
@@ -2839,17 +2839,17 @@ template SiSUdocAbstraction() {
++cntr;
} else if (obj_type_status["block"] == TriState.closing) {
obj_cite_digits = ocn_emit(OCNstatus.on);
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(
+ an_object["bookindex_nugget"]
+ = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes
+ = bookindex_extract_hash.bookindex_nugget_hash(
an_object["bookindex_nugget"],
obj_cite_digits,
segment_anchor_tag_that_object_belongs_to
);
an_object["is"] = "block";
- auto comp_obj_location =
- node_construct.node_location_emitter(
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -2857,8 +2857,8 @@ template SiSUdocAbstraction() {
heading_ptr-1,
an_object["is"]
);
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
comp_obj_block = comp_obj_block.init;
comp_obj_block.of_part = "body";
@@ -2881,17 +2881,17 @@ template SiSUdocAbstraction() {
processing.remove("verse");
++cntr;
} else if (obj_type_status["poem"] == TriState.closing) {
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(
+ an_object["bookindex_nugget"]
+ = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes
+ = bookindex_extract_hash.bookindex_nugget_hash(
an_object["bookindex_nugget"],
obj_cite_digits,
segment_anchor_tag_that_object_belongs_to
);
an_object["is"] = "verse";
- auto comp_obj_location =
- node_construct.node_location_emitter(
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -2917,17 +2917,17 @@ template SiSUdocAbstraction() {
processing.remove("verse");
} else if (obj_type_status["code"] == TriState.closing) {
obj_cite_digits = ocn_emit(OCNstatus.on);
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(
+ an_object["bookindex_nugget"]
+ = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes
+ = bookindex_extract_hash.bookindex_nugget_hash(
an_object["bookindex_nugget"],
obj_cite_digits,
segment_anchor_tag_that_object_belongs_to
);
an_object["is"] = "code";
- auto comp_obj_location =
- node_construct.node_location_emitter(
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -2935,8 +2935,8 @@ template SiSUdocAbstraction() {
heading_ptr-1,
an_object["is"]
);
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
comp_obj_code = comp_obj_code.init;
@@ -2962,17 +2962,17 @@ template SiSUdocAbstraction() {
} else if (obj_type_status["table"] == TriState.closing) {
comp_obj_block = comp_obj_block.init;
obj_cite_digits = ocn_emit(OCNstatus.on);
- an_object["bookindex_nugget"] =
- ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
- bookindex_unordered_hashes =
- bookindex_extract_hash.bookindex_nugget_hash(
+ an_object["bookindex_nugget"]
+ =("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : "";
+ bookindex_unordered_hashes
+ = bookindex_extract_hash.bookindex_nugget_hash(
an_object["bookindex_nugget"],
obj_cite_digits,
segment_anchor_tag_that_object_belongs_to
);
an_object["is"] = "table";
- auto comp_obj_location =
- node_construct.node_location_emitter(
+ auto comp_obj_location
+ = node_construct.node_location_emitter(
content_non_header,
segment_anchor_tag_that_object_belongs_to,
obj_cite_digits,
@@ -2980,9 +2980,9 @@ template SiSUdocAbstraction() {
heading_ptr-1,
an_object["is"]
);
- auto substantive_obj_misc_tuple =
- obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
- an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
+ auto substantive_obj_misc_tuple
+ = obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, conf_make_meta);
+ an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
comp_obj_block = comp_obj_block.init;
comp_obj_block.ocn = obj_cite_digits.on;
comp_obj_block.obj_cite_number = (obj_cite_digits.on==0) ? "" : obj_cite_digits.on.to!string;
@@ -3078,8 +3078,8 @@ template SiSUdocAbstraction() {
debug(headingsfound) {
writeln(dochead_make_identify_unmarked_headings);
}
- char[][] make_headings_spl =
- (cast(char[]) dochead_make_identify_unmarked_headings)
+ char[][] make_headings_spl
+ = (cast(char[]) dochead_make_identify_unmarked_headings)
.split(rgx.make_heading_delimiter);
debug(headingsfound) {
writeln(make_headings_spl.length);
@@ -3088,58 +3088,58 @@ template SiSUdocAbstraction() {
switch (make_headings_spl.length) {
case 7 :
if (!empty(make_headings_spl[6])) {
- heading_match_str["h_4"] =
- "^(" ~ make_headings_spl[6].to!string ~ ")";
- heading_match_rgx["h_4"] =
- regex(heading_match_str["h_4"]);
+ heading_match_str["h_4"]
+ = "^(" ~ make_headings_spl[6].to!string ~ ")";
+ heading_match_rgx["h_4"]
+ = regex(heading_match_str["h_4"]);
}
goto case;
case 6 :
if (!empty(make_headings_spl[5])) {
- heading_match_str["h_3"] =
- "^(" ~ make_headings_spl[5].to!string ~ ")";
- heading_match_rgx["h_3"] =
- regex(heading_match_str["h_3"]);
+ heading_match_str["h_3"]
+ = "^(" ~ make_headings_spl[5].to!string ~ ")";
+ heading_match_rgx["h_3"]
+ = regex(heading_match_str["h_3"]);
}
goto case;
case 5 :
if (!empty(make_headings_spl[4])) {
- heading_match_str["h_2"] =
- "^(" ~ make_headings_spl[4].to!string ~ ")";
- heading_match_rgx["h_2"] =
- regex(heading_match_str["h_2"]);
+ heading_match_str["h_2"]
+ = "^(" ~ make_headings_spl[4].to!string ~ ")";
+ heading_match_rgx["h_2"]
+ = regex(heading_match_str["h_2"]);
}
goto case;
case 4 :
if (!empty(make_headings_spl[3])) {
- heading_match_str["h_1"] =
- "^(" ~ make_headings_spl[3].to!string ~ ")";
- heading_match_rgx["h_1"] =
- regex(heading_match_str["h_1"]);
+ heading_match_str["h_1"]
+ = "^(" ~ make_headings_spl[3].to!string ~ ")";
+ heading_match_rgx["h_1"]
+ = regex(heading_match_str["h_1"]);
}
goto case;
case 3 :
if (!empty(make_headings_spl[2])) {
- heading_match_str["h_D"] =
- "^(" ~ make_headings_spl[2].to!string ~ ")";
- heading_match_rgx["h_D"] =
- regex(heading_match_str["h_D"]);
+ heading_match_str["h_D"]
+ = "^(" ~ make_headings_spl[2].to!string ~ ")";
+ heading_match_rgx["h_D"]
+ = regex(heading_match_str["h_D"]);
}
goto case;
case 2 :
if (!empty(make_headings_spl[1])) {
- heading_match_str["h_C"] =
- "^(" ~ make_headings_spl[1].to!string ~ ")";
- heading_match_rgx["h_C"] =
- regex(heading_match_str["h_C"]);
+ heading_match_str["h_C"]
+ = "^(" ~ make_headings_spl[1].to!string ~ ")";
+ heading_match_rgx["h_C"]
+ = regex(heading_match_str["h_C"]);
}
goto case;
case 1 :
if (!empty(make_headings_spl[0])) {
- heading_match_str["h_B"] =
- "^(" ~ make_headings_spl[0].to!string ~ ")";
- heading_match_rgx["h_B"] =
- regex(heading_match_str["h_B"]);
+ heading_match_str["h_B"]
+ = "^(" ~ make_headings_spl[0].to!string ~ ")";
+ heading_match_rgx["h_B"]
+ = regex(heading_match_str["h_B"]);
}
break;
default:
@@ -3252,8 +3252,8 @@ template SiSUdocAbstraction() {
.replaceFirst(rgx.variable_doc_author,
conf_make_meta.meta.creator_author);
collapsed_lev["h0"] = 0;
- an_object["lev_collapsed_number"] =
- collapsed_lev["h0"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h0"].to!string;
lv["lv"] = DocStructMarkupHeading.h_sect_A;
++lv["h0"];
lv["h1"] = State.off;
@@ -3266,8 +3266,8 @@ template SiSUdocAbstraction() {
goto default;
case "B":
collapsed_lev["h1"] = collapsed_lev["h0"] + 1;
- an_object["lev_collapsed_number"] =
- collapsed_lev["h1"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h1"].to!string;
lv["lv"] = DocStructMarkupHeading.h_sect_B;
++lv["h1"];
lv["h2"] = State.off;
@@ -3279,8 +3279,8 @@ template SiSUdocAbstraction() {
goto default;
case "C":
collapsed_lev["h2"] = collapsed_lev["h1"] + 1;
- an_object["lev_collapsed_number"] =
- collapsed_lev["h2"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h2"].to!string;
lv["lv"] = DocStructMarkupHeading.h_sect_C;
++lv["h2"];
lv["h3"] = State.off;
@@ -3291,8 +3291,8 @@ template SiSUdocAbstraction() {
goto default;
case "D":
collapsed_lev["h3"] = collapsed_lev["h2"] + 1;
- an_object["lev_collapsed_number"] =
- collapsed_lev["h3"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h3"].to!string;
lv["lv"] = DocStructMarkupHeading.h_sect_D;
++lv["h3"];
lv["h4"] = State.off;
@@ -3310,8 +3310,8 @@ template SiSUdocAbstraction() {
} else if (lv["h0"] > State.off) {
collapsed_lev["h4"] = collapsed_lev["h0"] + 1;
}
- an_object["lev_collapsed_number"] =
- collapsed_lev["h4"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h4"].to!string;
lv["lv"] = DocStructMarkupHeading.h_text_1;
++lv["h4"];
lv["h5"] = State.off;
@@ -3320,12 +3320,12 @@ template SiSUdocAbstraction() {
goto default;
case "2":
if (lv["h5"] > State.off) {
- an_object["lev_collapsed_number"] =
- collapsed_lev["h5"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h5"].to!string;
} else if (lv["h4"] > State.off) {
collapsed_lev["h5"] = collapsed_lev["h4"] + 1;
- an_object["lev_collapsed_number"] =
- collapsed_lev["h5"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h5"].to!string;
}
lv["lv"] = DocStructMarkupHeading.h_text_2;
++lv["h5"];
@@ -3334,12 +3334,12 @@ template SiSUdocAbstraction() {
goto default;
case "3":
if (lv["h6"] > State.off) {
- an_object["lev_collapsed_number"] =
- collapsed_lev["h6"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h6"].to!string;
} else if (lv["h5"] > State.off) {
collapsed_lev["h6"] = collapsed_lev["h5"] + 1;
- an_object["lev_collapsed_number"] =
- collapsed_lev["h6"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h6"].to!string;
}
lv["lv"] = DocStructMarkupHeading.h_text_3;
++lv["h6"];
@@ -3347,12 +3347,12 @@ template SiSUdocAbstraction() {
goto default;
case "4":
if (lv["h7"] > State.off) {
- an_object["lev_collapsed_number"] =
- collapsed_lev["h7"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h7"].to!string;
} else if (lv["h6"] > State.off) {
collapsed_lev["h7"] = collapsed_lev["h6"] + 1;
- an_object["lev_collapsed_number"] =
- collapsed_lev["h7"].to!string;
+ an_object["lev_collapsed_number"]
+ = collapsed_lev["h7"].to!string;
}
lv["lv"] = DocStructMarkupHeading.h_text_4;
++lv["h7"];
@@ -3818,8 +3818,8 @@ template SiSUdocAbstraction() {
rgx.inline_notes_curly_sp_asterisk,
(mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c)
);
- obj_txt_in =
- obj_txt_in.replaceAll(
+ obj_txt_in
+ = obj_txt_in.replaceAll(
rgx.inline_notes_curly_sp_plus,
(mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c)
);
@@ -4313,7 +4313,7 @@ template SiSUdocAbstraction() {
heading_num_3 = 0;
} else if (
heading_num_top_level
- == obj_["lev_markup_number"].to!uint
+ == obj_["lev_markup_number"].to!uint
) {
heading_num_0 ++;
heading_num_1 = 0;
@@ -4321,26 +4321,26 @@ template SiSUdocAbstraction() {
heading_num_3 = 0;
} else if (
heading_num_top_level
- == (obj_["lev_markup_number"].to!uint - 1)
+ == (obj_["lev_markup_number"].to!uint - 1)
) {
heading_num_1 ++;
heading_num_2 = 0;
heading_num_3 = 0;
} else if (
heading_num_top_level
- == (obj_["lev_markup_number"].to!uint - 2)
+ == (obj_["lev_markup_number"].to!uint - 2)
) {
heading_num_2 ++;
heading_num_3 = 0;
} else if (
heading_num_top_level
- == (obj_["lev_markup_number"].to!uint - 3)
+ == (obj_["lev_markup_number"].to!uint - 3)
) {
heading_num_3 ++;
}
if (heading_num_3 > 0) {
- heading_number_auto_composite =
- (heading_num_depth == 3)
+ heading_number_auto_composite
+ = (heading_num_depth == 3)
? ( heading_num_0.to!string ~ "."
~ heading_num_1.to!string ~ "."
~ heading_num_2.to!string ~ "."
@@ -4348,8 +4348,8 @@ template SiSUdocAbstraction() {
)
: "";
} else if (heading_num_2 > 0) {
- heading_number_auto_composite =
- ((heading_num_depth >= 2)
+ heading_number_auto_composite
+ = ((heading_num_depth >= 2)
&& (heading_num_depth <= 3))
? ( heading_num_0.to!string ~ "."
~ heading_num_1.to!string ~ "."
@@ -4357,16 +4357,16 @@ template SiSUdocAbstraction() {
)
: "";
} else if (heading_num_1 > 0) {
- heading_number_auto_composite =
- ((heading_num_depth >= 1)
+ heading_number_auto_composite
+ = ((heading_num_depth >= 1)
&& (heading_num_depth <= 3))
? ( heading_num_0.to!string ~ "."
~ heading_num_1.to!string
)
: "";
} else if (heading_num_0 > 0) {
- heading_number_auto_composite =
- ((heading_num_depth >= 0)
+ heading_number_auto_composite
+ = ((heading_num_depth >= 0)
&& (heading_num_depth <= 3))
? (heading_num_0.to!string)
: "";
@@ -4706,10 +4706,10 @@ template SiSUdocAbstraction() {
oa_j.object["obj_cite_number"] = _comp_obj_heading.ocn;
oa_j.object["lev_markup_number"] = _comp_obj_heading.heading_lev_markup;
oa_j.object["lev_collapsed_number"] = _comp_obj_heading.heading_lev_collapsed;
- oa_j.object["heading_ptr"] =
- _comp_obj_heading.ptr_heading;
- oa_j.object["doc_object_ptr"] =
- _comp_obj_heading.ptr_doc_object;
+ oa_j.object["heading_ptr"]
+ = _comp_obj_heading.ptr_heading;
+ oa_j.object["doc_object_ptr"]
+ = _comp_obj_heading.ptr_doc_object;
}
oa_j.object["parent_obj_cite_number"] = _comp_obj_heading.parent_ocn;
oa_j.object["parent_lev_markup_number"] = _comp_obj_heading.parent_lev_markup;
@@ -4747,11 +4747,11 @@ template SiSUdocAbstraction() {
body {
static auto rgx = Rgx();
if (!bookindex_section.empty) {
- auto bi_main_terms_split_arr =
- bookindex_section.split(rgx.bi_main_terms_split);
+ auto bi_main_terms_split_arr
+ = bookindex_section.split(rgx.bi_main_terms_split);
foreach (bi_main_terms_content; bi_main_terms_split_arr) {
- auto bi_main_term_and_rest =
- bi_main_terms_content.split(rgx.bi_main_term_plus_rest_split);
+ auto bi_main_term_and_rest
+ = bi_main_terms_content.split(rgx.bi_main_term_plus_rest_split);
if (auto m = bi_main_term_and_rest[0].match(
rgx.bi_term_and_obj_cite_numbers_match)
) {
@@ -4768,8 +4768,8 @@ template SiSUdocAbstraction() {
bi[main_term]["_a"] ~= obj_cite_numbers;
obj_cite_numbers=null;
if (bi_main_term_and_rest.length > 1) {
- auto bi_sub_terms_split_arr =
- bi_main_term_and_rest[1].split(
+ auto bi_sub_terms_split_arr
+ = bi_main_term_and_rest[1].split(
rgx.bi_sub_terms_plus_obj_cite_number_offset_split
);
foreach (sub_terms_bits; bi_sub_terms_split_arr) {
@@ -4806,14 +4806,14 @@ template SiSUdocAbstraction() {
debug(asserts) {
static assert(is(typeof(bookindex_unordered_hashes) == string[][string][string]));
}
- auto mainkeys=
- bookindex_unordered_hashes.byKey.array.sort().release;
+ auto mainkeys
+ = bookindex_unordered_hashes.byKey.array.sort().release;
foreach (mainkey; mainkeys) {
debug(bookindex1) {
writeln(mainkey);
}
- auto subkeys=
- bookindex_unordered_hashes[mainkey].byKey.array.sort().release;
+ auto subkeys
+ = bookindex_unordered_hashes[mainkey].byKey.array.sort().release;
foreach (subkey; subkeys) {
debug(bookindex1) {
writeln(" ", subkey);
@@ -4846,8 +4846,8 @@ template SiSUdocAbstraction() {
}
writeln(" \\\\");
bookindex_unordered_hashes[mainkey].remove("_a");
- auto subkeys=
- bookindex_unordered_hashes[mainkey].byKey.array.sort().release;
+ auto subkeys
+ = bookindex_unordered_hashes[mainkey].byKey.array.sort().release;
foreach (subkey; subkeys) {
write(" ", subkey, ", ");
foreach (ref_; bookindex_unordered_hashes[mainkey][subkey]) {
@@ -4877,8 +4877,8 @@ template SiSUdocAbstraction() {
int heading_lev_markup, heading_lev_collapsed;
string attrib;
int[string] indent;
- auto mainkeys =
- bookindex_unordered_hashes.byKey.array.sort().release;
+ auto mainkeys
+ = bookindex_unordered_hashes.byKey.array.sort().release;
ObjGenericComposite[][string] bookindex_section;
ObjGenericComposite comp_obj_heading_, comp_obj_para;
auto node_para_int_ = node_metadata_para_int;
@@ -4941,8 +4941,8 @@ template SiSUdocAbstraction() {
auto bkidx_lnk_seg(string locs) {
string markup = "";
if (auto m = locs.matchFirst(rgx.book_index_go_seg)) {
- markup =
- munge.url_links("{ " ~ m["link"] ~ " }"
+ markup
+ = munge.url_links("{ " ~ m["link"] ~ " }"
~ mkup.mark_internal_site_lnk ~ m["seg"] ~ ".fnSuffix"
~ "#" ~ m["ocn"] ~ ", ");
} else {
@@ -4953,8 +4953,8 @@ template SiSUdocAbstraction() {
auto bkidx_lnk_scroll(string locs) {
string markup = "";
if (auto m = locs.matchFirst(rgx.book_index_go)) {
- markup =
- munge.url_links("{ " ~ m["link"] ~ " }"
+ markup
+ = munge.url_links("{ " ~ m["link"] ~ " }"
~ mkup.mark_internal_site_lnk
~ "#" ~ m["ocn"] ~ ", ");
} else {
@@ -4969,8 +4969,8 @@ template SiSUdocAbstraction() {
bi_tmp_scroll ~= " \\\\\n ";
bi_tmp_seg ~= " \\\\\n ";
bookindex_unordered_hashes[mainkey].remove("_a");
- auto subkeys =
- bookindex_unordered_hashes[mainkey].byKey.array.sort().release;
+ auto subkeys
+ = bookindex_unordered_hashes[mainkey].byKey.array.sort().release;
foreach (subkey; subkeys) {
bi_tmp_scroll ~= subkey ~ ", ";
buffer.clear();
@@ -5214,8 +5214,8 @@ template SiSUdocAbstraction() {
}
}
body {
- JSONValue[] biblio_unsorted =
- _biblio_unsorted_complete_(biblio_unsorted_incomplete, bib_arr_json);
+ JSONValue[] biblio_unsorted
+ = _biblio_unsorted_complete_(biblio_unsorted_incomplete, bib_arr_json);
biblio_arr_json = [];
biblio_unsorted_incomplete = [];
JSONValue[] biblio_sorted__ = biblio_sort(biblio_unsorted);
@@ -5265,8 +5265,8 @@ template SiSUdocAbstraction() {
}
bib_arr_json ~= j;
}
- JSONValue[] biblio_unsorted_array_of_json_objects =
- bib_arr_json.dup;
+ JSONValue[] biblio_unsorted_array_of_json_objects
+ = bib_arr_json.dup;
destroy(bib_arr_json);
return biblio_unsorted_array_of_json_objects;
}
@@ -5275,8 +5275,8 @@ template SiSUdocAbstraction() {
static assert(is(typeof(biblio_unordered) == JSONValue[]));
}
JSONValue[] biblio_sorted_;
- biblio_sorted_ =
- sort!((a, b){
+ biblio_sorted_
+ = sort!((a, b){
return ((a["sortby_deemed_author_year_title"].str) < (b["sortby_deemed_author_year_title"].str));
})(biblio_unordered).array;
debug(bibliosorted) {
@@ -5426,24 +5426,24 @@ template SiSUdocAbstraction() {
lv = DocStructMarkupHeading.h_sect_B;
lv1 = obj_cite_digit;
lv2=0; lv3=0; lv4=0; lv5=0; lv6=0; lv7=0;
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_sect_A;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_sect_A;
p_["obj_cite_number"] = lv0;
break;
case 2:
lv = DocStructMarkupHeading.h_sect_C;
lv2 = obj_cite_digit;
lv3=0; lv4=0; lv5=0; lv6=0; lv7=0;
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_sect_B;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_sect_B;
p_["obj_cite_number"] = lv1;
break;
case 3:
lv = DocStructMarkupHeading.h_sect_D;
lv3=obj_cite_digit;
lv4=0; lv5=0; lv6=0; lv7=0;
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_sect_C;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_sect_C;
p_["obj_cite_number"] = lv2;
break;
case 4:
@@ -5451,20 +5451,20 @@ template SiSUdocAbstraction() {
lv4 = obj_cite_digit;
lv5=0; lv6=0; lv7=0;
if (lv3 > State.off) {
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_sect_D;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_sect_D;
p_["obj_cite_number"] = lv3;
} else if (lv2 > State.off) {
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_sect_C;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_sect_C;
p_["obj_cite_number"] = lv2;
} else if (lv1 > State.off) {
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_sect_B;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_sect_B;
p_["obj_cite_number"] = lv1;
} else {
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_sect_A;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_sect_A;
p_["obj_cite_number"] = lv0;
}
break;
@@ -5472,23 +5472,23 @@ template SiSUdocAbstraction() {
lv = DocStructMarkupHeading.h_text_2;
lv5 = obj_cite_digit;
lv6=0; lv7=0;
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_text_1;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_text_1;
p_["obj_cite_number"] = lv4;
break;
case 6:
lv = DocStructMarkupHeading.h_text_3;
lv6 = obj_cite_digit;
lv7=0;
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_text_2;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_text_2;
p_["obj_cite_number"] = lv5;
break;
case 7:
lv = DocStructMarkupHeading.h_text_4;
lv7 = obj_cite_digit;
- p_["lev_markup_number"] =
- DocStructMarkupHeading.h_text_3;
+ p_["lev_markup_number"]
+ = DocStructMarkupHeading.h_text_3;
p_["obj_cite_number"] = lv6;
break;
default:
diff --git a/src/sdp/meta/metadoc_summary.d b/src/sdp/meta/metadoc_summary.d
index c1e3f76..ac2477e 100644
--- a/src/sdp/meta/metadoc_summary.d
+++ b/src/sdp/meta/metadoc_summary.d
@@ -2,7 +2,7 @@ module sdp.meta.metadoc_summary;
template SiSUabstractionSummary() {
auto SiSUabstractionSummary(S,T)(
auto return ref const S doc_abstraction,
- auto return ref T doc_matters,
+ auto return ref T doc_matters,
) {
import
sdp.meta.defaults,
@@ -20,13 +20,13 @@ 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",
"last_obj_cite_number_bkidx" : "0",
];
- foreach (k; doc_matters.keys_seq.seg) {
+ foreach (k; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[k]) {
if (obj.of_part != "empty") {
if (!empty(obj.obj_cite_number)) {
@@ -56,7 +56,7 @@ template SiSUabstractionSummary() {
markup.repeat_character_by_number_provided("-", char_repeat_number),
doc_matters.conf_make_meta.meta.title_full,
doc_matters.conf_make_meta.meta.creator_author,
- doc_matters.source_filename,
+ doc_matters.src.filename,
markup.repeat_character_by_number_provided("-", char_repeat_number),
"length toc arr:",
to!int(doc_abstraction["toc_seg"].length),
diff --git a/src/sdp/meta/read_config_files.d b/src/sdp/meta/read_config_files.d
index 57aba7f..52446e8 100644
--- a/src/sdp/meta/read_config_files.d
+++ b/src/sdp/meta/read_config_files.d
@@ -12,9 +12,13 @@ static template configInSite() {
std.path;
final string configInSite(M,E)(M manifest, E env) {
auto conf_file_details = ConfigFilePaths!()(manifest, env);
- string conf_sdl = conf_file_details.config_filename_site;
- auto possible_config_path_locations = conf_file_details.possible_config_path_locations_local_site;
+ string conf_sdl = conf_file_details.possible_config_path_locations.config_filename_site;
+ auto possible_config_path_locations = conf_file_details.possible_config_path_locations.local_site;
string config_file_str;
+ debug(io) {
+ writeln("in config filename: ", conf_sdl);
+ writeln("in config possible path locations: ", possible_config_path_locations);
+ }
foreach(pth; possible_config_path_locations) {
auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_sdl)).array;
if (config_file_str.length > 0) {
@@ -22,8 +26,8 @@ static template configInSite() {
}
try {
if (exists(conf_file)) {
- debug(configfile) {
- writeln(conf_file);
+ debug(io) {
+ writeln("in config file found: ", conf_file);
}
config_file_str = conf_file.readText;
break;
@@ -46,8 +50,12 @@ static template configInDoc() {
final string configInDoc(M,E)(M manifest, E env) {
auto conf_file_details = ConfigFilePaths!()(manifest, env);
string conf_sdl = conf_file_details.config_filename_document;
- auto possible_config_path_locations = conf_file_details.possible_config_path_locations_document;
+ auto possible_config_path_locations = conf_file_details.possible_config_path_locations.document;
string config_file_str;
+ debug(io) {
+ writeln("in config filename: ", conf_sdl);
+ writeln("in config possible path locations: ", possible_config_path_locations);
+ }
foreach(pth; possible_config_path_locations) {
auto conf_file = asNormalizedPath(chainPath(to!string(pth), conf_sdl)).array;
if (config_file_str.length > 0) {
@@ -55,8 +63,8 @@ static template configInDoc() {
}
try {
if (exists(conf_file)) {
- debug(configfile) {
- writeln(conf_file);
+ debug(io) {
+ writeln("in config file found: ", conf_file);
}
config_file_str = conf_file.readText;
break;
@@ -104,7 +112,7 @@ static template configReadSite() {
final auto configReadSite(M,E)(M manifest, E env) {
auto configuration = configInSite!()(manifest, env);
auto conf_file_details = ConfigFilePaths!()(manifest, env);
- string conf_sdl = conf_file_details.config_filename_site;
+ string conf_sdl = conf_file_details.possible_config_path_locations.config_filename_site;
auto sdl_root = ConfigSDLang!()(configuration, conf_sdl);
return sdl_root;
}
diff --git a/src/sdp/meta/read_source_files.d b/src/sdp/meta/read_source_files.d
index 95a9dbe..0e53e73 100644
--- a/src/sdp/meta/read_source_files.d
+++ b/src/sdp/meta/read_source_files.d
@@ -25,37 +25,37 @@ static template SiSUrawMarkupContent() {
}
auto rawsrc = RawMarkupContent();
auto SiSUrawMarkupContent(O,Fn)(O _opt_action, Fn fn_src) {
- auto _0_header_1_body_content_2_insert_filelist_tuple =
- rawsrc.sourceContentSplitIntoHeaderAndBody(_opt_action, rawsrc.sourceContent(fn_src), fn_src);
+ auto _0_header_1_body_content_2_insert_filelist_tuple
+ = rawsrc.sourceContentSplitIntoHeaderAndBody(_opt_action, rawsrc.sourceContent(fn_src), fn_src);
return _0_header_1_body_content_2_insert_filelist_tuple;
}
struct RawMarkupContent {
final sourceContent(in string fn_src) {
auto raw = MarkupRawUnit();
- auto source_txt_str =
- raw.markupSourceReadIn(fn_src);
+ auto source_txt_str
+ = raw.markupSourceReadIn(fn_src);
return source_txt_str;
}
final auto sourceContentSplitIntoHeaderAndBody(O)(O _opt_action, in string source_txt_str, in string fn_src="") {
auto raw = MarkupRawUnit();
string[] insert_file_list;
string[] images_list;
- auto t =
- raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str);
+ auto t
+ = raw.markupSourceHeaderContentRawLineTupleArray(source_txt_str);
auto header_raw = t[0];
auto sourcefile_body_content = t[1];
if (fn_src.match(rgx.src_fn_master)) { // filename with path needed if master file (.ssm) not otherwise
auto ins = Inserts();
- auto tu =
- ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src);
+ auto tu
+ = ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src);
static assert(!isTypeTuple!(tu));
sourcefile_body_content = tu[0];
insert_file_list = tu[1].dup;
images_list = tu[2].dup;
} else if (_opt_action.source || _opt_action.sisupod) {
auto ins = Inserts();
- auto tu =
- ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src);
+ auto tu
+ = ins.scan_master_src_for_insert_files_and_import_content(_opt_action, sourcefile_body_content, fn_src);
static assert(!isTypeTuple!(tu));
images_list = tu[2].dup;
}
@@ -80,6 +80,9 @@ static template SiSUrawMarkupContent() {
string source_txt_str;
try {
if (exists(fn_src)) {
+ debug(io) {
+ writeln("in src, markup source file found: ", fn_src);
+ }
source_txt_str = fn_src.readText;
}
}
@@ -108,8 +111,8 @@ static template SiSUrawMarkupContent() {
return header_and_content;
}
final private char[][] markupSourceLineArray(in char[] src_text) {
- char[][] source_line_arr =
- (cast(char[]) src_text).split(rgx.newline_eol_strip_preceding);
+ char[][] source_line_arr
+ = (cast(char[]) src_text).split(rgx.newline_eol_strip_preceding);
return source_line_arr;
}
auto markupSourceReadIn(in string fn_src) {
@@ -205,11 +208,11 @@ static template SiSUrawMarkupContent() {
type1["header_meta"] = 0;
auto insert_fn = m.captures[2];
auto insert_sub_pth = m.captures[1];
- auto fn_src_insert =
- chainPath(markup_src_file_path, insert_sub_pth ~ insert_fn).array;
+ auto fn_src_insert
+ = chainPath(markup_src_file_path, insert_sub_pth ~ insert_fn).array;
auto raw = MarkupRawUnit();
- auto markup_sourcesubfile_insert_content =
- raw.getInsertMarkupSourceContentRawLineArray(fn_src_insert, rgx.src_fn_find_inserts);
+ auto markup_sourcesubfile_insert_content
+ = raw.getInsertMarkupSourceContentRawLineArray(fn_src_insert, rgx.src_fn_find_inserts);
debug(insert_file) {
tell_l("red", line);
tell_l("red", fn_src_insert);
@@ -285,8 +288,8 @@ static template SiSUrawMarkupContent() {
} else if (auto m = line.match(rgx.insert_src_fn_ssi_or_sst)) {
auto insert_fn = m.captures[2];
auto insert_sub_pth = m.captures[1];
- auto fn_src_insert =
- chainPath(markup_src_file_path, insert_sub_pth ~ insert_fn).array;
+ auto fn_src_insert
+ = chainPath(markup_src_file_path, insert_sub_pth ~ insert_fn).array;
insert_file_list ~= to!string(fn_src_insert);
auto raw = MarkupRawUnit();
/+ TODO +/
@@ -294,8 +297,8 @@ static template SiSUrawMarkupContent() {
/+ .sst when inserted, not used: headers and heading level ^:?A~ so remove +/
writeln(__LINE__); writeln(ma);
}
- auto markup_sourcefile_insert_content =
- raw.getInsertMarkupSourceContentRawLineArray(fn_src_insert, rgx.src_fn_find_inserts);
+ auto markup_sourcefile_insert_content
+ = raw.getInsertMarkupSourceContentRawLineArray(fn_src_insert, rgx.src_fn_find_inserts);
debug(insert_file) {
tell_l("red", line);
tell_l("red", fn_src_insert);
diff --git a/src/sdp/meta/rgx.d b/src/sdp/meta/rgx.d
index 37db8e7..c196ad2 100644
--- a/src/sdp/meta/rgx.d
+++ b/src/sdp/meta/rgx.d
@@ -211,6 +211,7 @@ static template SiSUrgxInit() {
static src_fn_insert = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ssi)$`);
static src_fn_find_inserts = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[im])$`);
static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[ti])$`);
+ static src_base_parent_dir_name = ctRegex!(`[/](?P<dir>(?:[a-zA-Z0-9._-]+))(?:/media/text/[a-z]{2})$`); // formalizes dir structure
/+ inline markup footnotes endnotes +/
static inline_notes_al = ctRegex!(`【(?:[*+]\s+|\s*)(.+?)】`, "mg");
static inline_notes_al_gen = ctRegex!(`【.+?】`, "m");
diff --git a/src/sdp/output/epub3.d b/src/sdp/output/epub3.d
index 2641784..3c8eb4d 100644
--- a/src/sdp/output/epub3.d
+++ b/src/sdp/output/epub3.d
@@ -31,7 +31,7 @@ template outputEPub3() {
}
string epub3_oebps_content(D,I,P)(D doc_abstraction, I doc_matters, P parts) {
auto xhtml_format = outputXHTMLs();
- auto pth_epub3 = SiSUpathsEPUB!()(doc_matters.output_path, doc_matters.language);
+ auto pth_epub3 = SiSUpathsEPUB!()(doc_matters.output_path, doc_matters.src.language);
string uuid = "18275d951861c77f78acd05672c9906924c59f18a2e0ba06dad95959693e9bd8"; // TODO sort uuid in doc_matters!
string content = format(q"¶ <?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="EPB-UUID">
@@ -70,7 +70,7 @@ template outputEPub3() {
? "" : xhtml_format.special_characters_text(doc_matters.conf_make_meta.meta.creator_author),
(doc_matters.conf_make_meta.meta.creator_author.empty)
? "" : xhtml_format.special_characters_text(doc_matters.conf_make_meta.meta.creator_author),
- doc_matters.language, // language, fix (needed in dochead metadata)
+ doc_matters.src.language, // language, fix (needed in dochead metadata)
(doc_matters.conf_make_meta.meta.date_published.empty)
? "" : xhtml_format.special_characters_text(doc_matters.conf_make_meta.meta.date_published),
(doc_matters.conf_make_meta.meta.rights_copyright.empty)
@@ -78,17 +78,17 @@ template outputEPub3() {
uuid,
uuid,
uuid,
- (pth_epub3.fn_oebps_css(doc_matters.source_filename)).chompPrefix("OEBPS/"),
+ (pth_epub3.fn_oebps_css(doc_matters.src.filename)).chompPrefix("OEBPS/"),
);
content ~= " " ~ "<!-- Content Documents -->" ~ "\n ";
content ~= parts["manifest_documents"];
// TODO sort jpg & png
content ~= " " ~ "<!-- Images -->" ~ "\n ";
- foreach (image; doc_matters.image_list) {
+ foreach (image; doc_matters.src.image_list) {
content ~= format(q"¶ <item id="%s" href="%s/%s" media-type="image/%s" />
¶",
image.baseName.stripExtension,
- (pth_epub3.doc_oebps_image(doc_matters.source_filename)).chompPrefix("OEBPS/"),
+ (pth_epub3.doc_oebps_image(doc_matters.src.filename)).chompPrefix("OEBPS/"),
image,
image.extension.chompPrefix("."),
);
@@ -102,7 +102,7 @@ template outputEPub3() {
content ~= " " ~ "</guide>" ~ "\n ";
content ~= "" ~ "</package>";
debug(epubmanifest) {
- foreach (s; doc_matters.keys_seq.seg) {
+ foreach (s; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[s]) {
if (obj.is_a == "heading") {
if (obj.heading_lev_markup == 4) {
@@ -144,7 +144,7 @@ template outputEPub3() {
<nav epub:type=\"toc\" id=\"toc\">\n",
doc_matters.conf_make_meta.meta.title_full,
);
- foreach (sect; doc_matters.keys_seq.seg) {
+ foreach (sect; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[sect]) {
if (obj.is_a == "heading") {
string _txt = obj.text.replaceAll(rgx.inline_notes_al_gen, "").strip;
@@ -241,7 +241,7 @@ template outputEPub3() {
(doc_matters.conf_make_meta.meta.creator_author.empty) ? ""
: doc_matters.conf_make_meta.meta.creator_author, // author
);
- foreach (sect; doc_matters.keys_seq.seg) {
+ foreach (sect; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[sect]) {
if (obj.is_a == "heading") {
string _txt = obj.text.replaceAll(rgx.inline_notes_al_gen, "").strip;
@@ -307,7 +307,7 @@ template outputEPub3() {
string[string] oepbs_content_parts;
string suffix = ".xhtml";
string[] doc_parts_;
- foreach (part; doc_matters.keys_seq.seg) {
+ foreach (part; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[part]) {
string _txt = xhtml_format.special_characters(obj, obj.text);
if (obj.is_a == "heading") {
@@ -356,13 +356,13 @@ template outputEPub3() {
doc_epub3_endnotes[segment_filename] ~= t[1];
break;
case 8: .. case 9:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
}
break;
@@ -591,10 +591,10 @@ template outputEPub3() {
static assert(is(typeof(oebps_toc_ncx) == string));
static assert(is(typeof(oebps_content_opf) == string));
}
- auto pth_epub3 = SiSUpathsEPUB!()(doc_matters.output_path, doc_matters.language);
+ auto pth_epub3 = SiSUpathsEPUB!()(doc_matters.output_path, doc_matters.src.language);
auto xhtml_format = outputXHTMLs();
/+ zip file +/
- auto fn_epub = pth_epub3.epub_file(doc_matters.source_filename);
+ auto fn_epub = pth_epub3.epub_file(doc_matters.src.filename);
auto zip = new ZipArchive(); // ZipArchive zip = new ZipArchive();
/+ zip archive member files +/
try {
@@ -602,24 +602,24 @@ template outputEPub3() {
pth_epub3.base.mkdirRecurse;
}
debug(epub_output) {
- if (!exists(pth_epub3.dbg_doc_meta_inf(doc_matters.source_filename))) {
- pth_epub3.dbg_doc_meta_inf(doc_matters.source_filename).mkdirRecurse;
+ if (!exists(pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename))) {
+ pth_epub3.dbg_doc_meta_inf(doc_matters.src.filename).mkdirRecurse;
}
- if (!exists(pth_epub3.dbg_doc_oebps_css(doc_matters.source_filename))) {
- pth_epub3.dbg_doc_oebps_css(doc_matters.source_filename).mkdirRecurse;
+ if (!exists(pth_epub3.dbg_doc_oebps_css(doc_matters.src.filename))) {
+ pth_epub3.dbg_doc_oebps_css(doc_matters.src.filename).mkdirRecurse;
}
- if (!exists(pth_epub3.dbg_doc_oebps_image(doc_matters.source_filename))) {
- pth_epub3.dbg_doc_oebps_image(doc_matters.source_filename).mkdirRecurse;
+ if (!exists(pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename))) {
+ pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename).mkdirRecurse;
}
}
{ /+ OEBPS/[segments].xhtml (the document contents) +/
- foreach (seg_filename; doc_matters.segnames_lv_0_to_4) {
- string fn = pth_epub3.fn_oebps_content_xhtml(doc_matters.source_filename, seg_filename);
+ foreach (seg_filename; doc_matters.xml.segnames_lv_0_to_4) {
+ string fn = pth_epub3.fn_oebps_content_xhtml(doc_matters.src.filename, seg_filename);
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
debug(epub_output) {
- string fn_dbg = pth_epub3.dbg_fn_oebps_content_xhtml(doc_matters.source_filename, seg_filename);
+ string fn_dbg = pth_epub3.dbg_fn_oebps_content_xhtml(doc_matters.src.filename, seg_filename);
auto f = File(fn_dbg, "w");
}
foreach (docseg; doc_epub3[seg_filename]) {
@@ -643,10 +643,10 @@ template outputEPub3() {
File f;
{ /+ mimetypes (identify zip file type) +/
debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_mimetypes(doc_matters.source_filename);
+ fn_dbg = pth_epub3.dbg_fn_mimetypes(doc_matters.src.filename);
File(fn_dbg, "w").writeln(mimetypes);
}
- fn = pth_epub3.fn_mimetypes(doc_matters.source_filename);
+ fn = pth_epub3.fn_mimetypes(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
@@ -657,10 +657,10 @@ template outputEPub3() {
}
{ /+ META-INF/container.xml (identify doc root) +/
debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_dmi_container_xml(doc_matters.source_filename);
+ fn_dbg = pth_epub3.dbg_fn_dmi_container_xml(doc_matters.src.filename);
File(fn_dbg, "w").writeln(meta_inf_container_xml);
}
- fn = pth_epub3.fn_dmi_container_xml(doc_matters.source_filename);
+ fn = pth_epub3.fn_dmi_container_xml(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
@@ -671,10 +671,10 @@ template outputEPub3() {
}
{ /+ OEBPS/toc_nav.xhtml (navigation toc epub3) +/
debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_oebps_toc_nav_xhtml(doc_matters.source_filename);
+ fn_dbg = pth_epub3.dbg_fn_oebps_toc_nav_xhtml(doc_matters.src.filename);
File(fn_dbg, "w").writeln(oebps_toc_nav_xhtml);
}
- fn = pth_epub3.fn_oebps_toc_nav_xhtml(doc_matters.source_filename);
+ fn = pth_epub3.fn_oebps_toc_nav_xhtml(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
@@ -685,10 +685,10 @@ template outputEPub3() {
}
{ /+ OEBPS/toc.ncx (navigation toc epub2) +/
debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_oebps_toc_ncx(doc_matters.source_filename);
+ fn_dbg = pth_epub3.dbg_fn_oebps_toc_ncx(doc_matters.src.filename);
File(fn_dbg, "w").writeln(oebps_toc_ncx);
}
- fn = pth_epub3.fn_oebps_toc_ncx(doc_matters.source_filename);
+ fn = pth_epub3.fn_oebps_toc_ncx(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
@@ -699,10 +699,10 @@ template outputEPub3() {
}
{ /+ OEBPS/content.opf (doc manifest) +/
debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_oebps_content_opf(doc_matters.source_filename);
+ fn_dbg = pth_epub3.dbg_fn_oebps_content_opf(doc_matters.src.filename);
File(fn_dbg, "w").writeln(oebps_content_opf);
}
- fn = pth_epub3.fn_oebps_content_opf(doc_matters.source_filename);
+ fn = pth_epub3.fn_oebps_content_opf(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
@@ -712,25 +712,25 @@ template outputEPub3() {
createZipFile!()(fn_epub, zip.build());
}
{ /+ OEBPS/_sisu/image (images) +/
- foreach (image; doc_matters.image_list) {
+ foreach (image; doc_matters.src.image_list) {
debug(epub_output) {
- if (exists(doc_matters.src_path_info.image_root ~ "/" ~ image)) {
- (doc_matters.src_path_info.image_root ~ "/" ~ image)
- .copy((pth_epub3.dbg_doc_oebps_image(doc_matters.source_filename)) ~ "/" ~ image);
+ if (exists(doc_matters.src.path_info.image_root ~ "/" ~ image)) {
+ (doc_matters.src.path_info.image_root ~ "/" ~ image)
+ .copy((pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename)) ~ "/" ~ image);
}
}
}
- foreach (image; doc_matters.image_list) {
+ foreach (image; doc_matters.src.image_list) {
debug(epub_output) {
debug(epub_images) {
writeln(
- doc_matters.src_path_info.image_root, image, " -> ",
- pth_epub3.dbg_doc_oebps_image(doc_matters.source_filename), "/", image
+ doc_matters.src.path_info.image_root, image, " -> ",
+ pth_epub3.dbg_doc_oebps_image(doc_matters.src.filename), "/", image
);
}
}
- auto fn_src = doc_matters.src_path_info.image_root ~ image;
- auto fn_out = pth_epub3.doc_oebps_image(doc_matters.source_filename).to!string ~ "/" ~ image;
+ auto fn_src = doc_matters.src.path_info.image_root ~ image;
+ auto fn_out = pth_epub3.doc_oebps_image(doc_matters.src.filename).to!string ~ "/" ~ image;
if (exists(fn_src)) {
{
auto zip_arc_member_file = new ArchiveMember();
@@ -747,10 +747,10 @@ template outputEPub3() {
{ /+ OEBPS/epub.css +/
auto css = SiSUcss();
debug(epub_output) {
- fn_dbg = pth_epub3.dbg_fn_oebps_css(doc_matters.source_filename);
+ fn_dbg = pth_epub3.dbg_fn_oebps_css(doc_matters.src.filename);
File(fn_dbg, "w").writeln(css.epub_css);
}
- fn = pth_epub3.fn_oebps_css(doc_matters.source_filename);
+ fn = pth_epub3.fn_oebps_css(doc_matters.src.filename);
auto zip_arc_member_file = new ArchiveMember();
zip_arc_member_file.name = fn;
auto zip_data = new OutBuffer();
diff --git a/src/sdp/output/html.d b/src/sdp/output/html.d
index 6767e11..10539a5 100644
--- a/src/sdp/output/html.d
+++ b/src/sdp/output/html.d
@@ -24,7 +24,7 @@ template outputHTML() {
string suffix = ".html";
string previous_part = "";
string delimit = "";
- foreach (part; doc_matters.keys_seq.scroll) {
+ foreach (part; doc_matters.xml.keys_seq.scroll) {
foreach (obj; doc_abstraction[part]) {
delimit = xhtml_format.div_delimit(part, previous_part);
string _txt = xhtml_format.special_characters(obj, obj.text);
@@ -40,14 +40,14 @@ template outputHTML() {
doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
writeln(__FILE__, ":", __LINE__, ": ", obj.text);
@@ -165,12 +165,12 @@ template outputHTML() {
debug(asserts) {
static assert(is(typeof(doc) == string[]));
}
- auto pth_html = SiSUpathsHTML!()(doc_matters.output_path, doc_matters.language);
+ auto pth_html = SiSUpathsHTML!()(doc_matters.output_path, doc_matters.src.language);
try {
if (!exists(pth_html.base)) {
pth_html.base.mkdirRecurse;
}
- auto f = File(pth_html.fn_scroll(doc_matters.source_filename), "w");
+ auto f = File(pth_html.fn_scroll(doc_matters.src.filename), "w");
foreach (o; doc) {
f.writeln(o);
}
@@ -178,7 +178,7 @@ template outputHTML() {
catch (ErrnoException ex) {
// Handle error
}
- writeln(" ", pth_html.fn_scroll(doc_matters.source_filename));
+ writeln(" ", pth_html.fn_scroll(doc_matters.src.filename));
}
void seg(D,I)(
auto return ref const D doc_abstraction,
@@ -196,7 +196,7 @@ template outputHTML() {
string suffix = ".html";
string previous_part = "";
string delimit = "";
- foreach (part; doc_matters.keys_seq.seg) {
+ foreach (part; doc_matters.xml.keys_seq.seg) {
foreach (obj; doc_abstraction[part]) {
delimit = xhtml_format.div_delimit(part, previous_part);
string _txt = xhtml_format.special_characters(obj, obj.text);
@@ -251,13 +251,13 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
case 8: .. case 9:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a, ": ", obj.heading_lev_markup);
}
break;
@@ -274,14 +274,14 @@ template outputHTML() {
doc_html[segment_filename] ~= to!string(t[0]);
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -297,7 +297,7 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
@@ -335,14 +335,14 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= "";
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -378,14 +378,14 @@ template outputHTML() {
doc_html_endnotes[segment_filename] ~= t[1];
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_of);
}
break;
@@ -394,7 +394,7 @@ template outputHTML() {
case "comment":
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.of_part);
}
break;
@@ -414,15 +414,15 @@ template outputHTML() {
}
mixin SiSUoutputRgxInit;
auto rgx = Rgx();
- auto pth_html = SiSUpathsHTML!()(doc_matters.output_path, doc_matters.language);
+ auto pth_html = SiSUpathsHTML!()(doc_matters.output_path, doc_matters.src.language);
auto xhtml_format = outputXHTMLs();
- auto m = doc_matters.source_filename.matchFirst(rgx.src_fn);
+ auto m = doc_matters.src.filename.matchFirst(rgx.src_fn);
try {
- if (!exists(pth_html.seg(doc_matters.source_filename))) {
- pth_html.seg(doc_matters.source_filename).mkdirRecurse;
+ if (!exists(pth_html.seg(doc_matters.src.filename))) {
+ pth_html.seg(doc_matters.src.filename).mkdirRecurse;
}
- foreach (seg_filename; doc_matters.segnames) {
- auto f = File(pth_html.fn_seg(doc_matters.source_filename, seg_filename), "w");
+ foreach (seg_filename; doc_matters.xml.segnames) {
+ auto f = File(pth_html.fn_seg(doc_matters.src.filename, seg_filename), "w");
foreach (docseg; doc_html[seg_filename]) {
f.writeln(docseg);
}
@@ -435,13 +435,13 @@ template outputHTML() {
catch (ErrnoException ex) {
// handle error
}
- writeln(" ", pth_html.fn_seg(doc_matters.source_filename, "toc"));
+ writeln(" ", pth_html.fn_seg(doc_matters.src.filename, "toc"));
}
void css(M)(
auto return ref M doc_matters,
) {
auto css = SiSUcss();
- auto pth_html = SiSUpathsHTML!()(doc_matters.output_path, doc_matters.language);
+ auto pth_html = SiSUpathsHTML!()(doc_matters.output_path, doc_matters.src.language);
try {
if (!exists(pth_html.css)) {
(pth_html.css).mkdirRecurse;
diff --git a/src/sdp/output/hub.d b/src/sdp/output/hub.d
index 1600dd2..7f03360 100644
--- a/src/sdp/output/hub.d
+++ b/src/sdp/output/hub.d
@@ -16,73 +16,108 @@ template outputHub() {
void outputHub(D,I)(D doc_abstraction, I doc_matters) {
mixin SiSUoutputRgxInit;
static auto rgx = Rgx();
- if ((doc_matters.opt_action.verbose)) {
- writeln(doc_matters.keys_seq.seg);
+ if ((doc_matters.opt.action.verbose)) {
+ writeln(doc_matters.xml.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))
- { writeln("sisu source processing... "); }
- if ((doc_matters.opt_action.verbose)
- && (doc_matters.opt_action.sisupod))
- { writeln("sisupod source processing... "); }
+ 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)) {
+ writeln("sisupod source processing... ");
+ }
SiSUpod!()(doc_matters);
- 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_do)
- && (doc_matters.opt_action.sisupod))
- { writeln("sisupod done"); }
+ 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_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_do)) { 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_do)) { 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_do)) { 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_do)) { 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_do)) { 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");
}
@@ -102,11 +137,15 @@ template outputHubOp() {
mixin SiSUoutputRgxInit;
static auto rgx = Rgx();
if ((opt_action.sqlite_create)) {
- if ((opt_action.verbose)) { writeln("sqlite create table... "); }
+ if ((opt_action.verbose)) {
+ writeln("sqlite create table... ");
+ }
SQLiteTablesCreate!()();
}
if ((opt_action.sqlite_drop)) {
- if ((opt_action.verbose)) { writeln("sqlite drop table... "); }
+ if ((opt_action.verbose)) {
+ writeln("sqlite drop table... ");
+ }
SQLiteTablesDrop!()();
}
}
diff --git a/src/sdp/output/paths_source.d b/src/sdp/output/paths_source.d
index 1330606..d141b86 100644
--- a/src/sdp/output/paths_source.d
+++ b/src/sdp/output/paths_source.d
@@ -42,10 +42,10 @@ template PodManifest() {
return ManifestFile_();
}
}
-template PodMatters() {
+template PathMatters() {
mixin SiSUrgxInit;
static auto rgx = Rgx();
- auto PodMatters(O,E,P,F)(
+ auto PathMatters(O,E,P,F)(
O _opt_actions,
E _env,
P _pth = "",
@@ -54,99 +54,206 @@ template PodMatters() {
) {
auto _manifest = PodManifest!()(_pth);
struct ManifestMatters_ {
- auto pwd() {
- return _env["pwd"];
- }
- auto home() {
- return _env["home"];
- }
- auto opt_action() {
- return _opt_actions;
- }
- auto is_pod() {
- auto _is_pod = (_manifest.pod_manifest_path.length > 0) ? true : false;
- return _is_pod;
- }
- auto pod_manifest_list_of_filenames() {
- return _manifest_fn_list;
- }
- auto pod_manifest_list_of_languages() {
- string[] _lngs;
- foreach (filename_; pod_manifest_list_of_filenames) {
- string _k = "en";
- if (auto m = (filename_).match(rgx.language_code_and_filename)) {
- _k = m.captures[1].to!string;
+ auto env() {
+ struct Env_ {
+ auto pwd() {
+ return _env["pwd"];
+ }
+ auto home() {
+ return _env["home"];
}
- _lngs ~= _k; // all the languages from the manifest list of filenames with paths
}
- return _lngs;
- }
- auto pod_manifest_filename() {
- return _manifest.pod_manifest_filename;
- }
- auto pod_manifest_path() {
- return _manifest.pod_manifest_path;
+ return Env_();
}
- auto pod_manifest_file_with_path() {
- return _manifest.pod_manifest_file_with_path;
- }
- auto pod_config_dirs() { // TODO
- string[] _config_dirs;
- return _config_dirs;
- }
- auto pod_image_dirs() { // TODO
- string[] _image_dirs;
- return _image_dirs;
- }
- auto src_path_and_fn() {
- return _fns;
+ auto opt() {
+ struct Opt_ {
+ auto action() { // redundant
+ return _opt_actions;
+ }
+ }
+ return Opt_();
}
- auto src_fn() {
- auto _fn = (src_path_and_fn).match(rgx.src_pth_sst_or_ssm).captures["filename"];
- return _fn;
+ auto src_is_pod() {
+ auto _src_is_pod = (_manifest.pod_manifest_path.length > 0) ? true : false;
+ return _src_is_pod;
}
- auto src_lng() {
- string _k;
- if (auto m = (src_path_and_fn).match(rgx.language_code_and_filename)) {
- _k = m.captures[1];
- } else {
- _k = "en";
+ auto pod() {
+ struct Pod_ {
+ auto src_is_pod() {
+ auto _src_is_pod = (_manifest.pod_manifest_path.length > 0) ? true : false;
+ return _src_is_pod;
+ }
+ auto manifest_filename() {
+ return _manifest.pod_manifest_filename;
+ }
+ auto manifest_path() {
+ return _manifest.pod_manifest_path;
+ }
+ auto manifest_file_with_path() {
+ return _manifest.pod_manifest_file_with_path;
+ }
+ auto config_dirs() { // TODO
+ string[] _config_dirs;
+ return _config_dirs;
+ }
+ auto image_dirs() { // TODO
+ string[] _image_dirs;
+ return _image_dirs;
+ }
+ auto manifest_list_of_filenames() {
+ return _manifest_fn_list;
+ }
+ auto manifest_list_of_languages() {
+ string[] _lngs;
+ foreach (filename_; manifest_list_of_filenames) {
+ string _k = "en";
+ if (auto m = (filename_).match(rgx.language_code_and_filename)) {
+ _k = m.captures[1].to!string;
+ }
+ _lngs ~= _k; // all the languages from the manifest list of filenames with paths
+ }
+ return _lngs;
+ }
}
- return _k;
+ return Pod_();
}
- auto output_path() {
- auto _output_path = pwd;
- if ((_opt_actions.output_dir_set.length > 0)
- && isValidPath(_opt_actions.output_dir_set)
- ) {
- _output_path = asNormalizedPath(_opt_actions.output_dir_set).array;
- if (!exists(_output_path)) {
- try {
- _output_path.mkdirRecurse;
+ auto src() {
+ struct SRC_ {
+ auto is_pod() {
+ auto _src_is_pod = (_manifest.pod_manifest_path.length > 0) ? true : false;
+ return _src_is_pod;
+ }
+ auto path_and_fn() {
+ return _fns;
+ }
+ auto filename() {
+ auto _fn = (path_and_fn).baseName;
+ return _fn;
+ }
+ auto lng() {
+ string _k;
+ if (auto m = (path_and_fn).match(rgx.language_code_and_filename)) {
+ _k = m.captures[1];
+ } else {
+ _k = "en";
}
- catch (Exception ex) {
- // Handle error
+ return _k;
+ }
+ auto file_with_absolute_path() {
+ string _pth = _env["pwd"].chainPath(path_and_fn).array;
+ return _pth;
+ }
+ auto absolute_path_to_src() {
+ string _pth = (_env["pwd"].chainPath(path_and_fn)).dirName.array;
+ return _pth;
+ }
+ auto base_dir() {
+ string _dir;
+ if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ auto m = (absolute_path_to_src)
+ .match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
+ ) {
+ _dir = asAbsolutePath(path_and_fn.chainPath("../../")).array;
+ assert(_dir == m.captures["dir"]);
+ } else {
+ _dir = asAbsolutePath(path_and_fn.chainPath("../../../")).array;
+ assert(_dir == absolute_path_to_src.match(rgx.src_base_parent_dir_name).captures["dir"]);
}
+ writeln("--> ", _dir);
+ return _dir;
+ }
+ auto base_parent_dir_path() {
+ string _dir;
+ if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ auto m = (absolute_path_to_src)
+ .match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
+ ) {
+ _dir = asAbsolutePath(path_and_fn.chainPath("../../")).array;
+ } else {
+ _dir = asAbsolutePath(path_and_fn.chainPath("../../../")).array;
+ }
+ return _dir;
+ }
+ auto base_dir_path() { // looks like there is work to do
+ string _dir;
+ if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ auto m = (absolute_path_to_src)
+ .match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
+ ) {
+ _dir = asAbsolutePath(path_and_fn.chainPath("../")).array;
+ } else {
+ _dir = asAbsolutePath(path_and_fn.chainPath("../../")).array;
+ }
+ writeln("--> ", _dir);
+ return _dir;
+ }
+ auto media_dir_path() { // TODO rework, can base directly on src fn path
+ auto _dir = asAbsolutePath(base_dir_path.chainPath("media")).array;
+ return _dir;
+ }
+ auto image_dir_path() {
+ auto _dir = asAbsolutePath(base_dir_path.chainPath("media/image")).array;
+ return _dir;
+ }
+ auto conf_dir_path() {
+ auto _dir = asAbsolutePath(base_dir_path.chainPath("conf")).array;
+ return _dir;
+ }
+ auto base_parent_dir() {
+ string _dir;
+ if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ auto m = (absolute_path_to_src)
+ .match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
+ ) {
+ _dir = m.captures["dir"];
+ } else {
+ _dir = (absolute_path_to_src).match(rgx.src_base_parent_dir_name).captures["dir"];
+ }
+ writeln("--> ", _dir);
+ return _dir;
+ }
+ auto config_dirs() { // TODO
+ string[] _config_dirs;
+ if (is_pod) {
+ } else {
+ }
+ return _config_dirs;
+ }
+ auto image_dirs() { // TODO
+ string[] _image_dirs;
+ if (is_pod) {
+ } else {
+ }
+ return _image_dirs;
}
- assert(_output_path.isDir,
- "not a directory: " ~ _output_path);
- // TODO always test that is a directory and it is writable
- }
- return _output_path;
- }
- auto src_config_dirs() { // TODO
- string[] _config_dirs;
- if (is_pod) {
- } else {
}
- return _config_dirs;
- }
- auto src_image_dirs() { // TODO
- string[] _image_dirs;
- if (is_pod) {
- } else {
+ return SRC_();
+ }
+ auto output() {
+ struct Out_ {
+ auto path() {
+ auto _output_path = _env["pwd"];
+ if ((_opt_actions.output_dir_set.length > 0)
+ && isValidPath(_opt_actions.output_dir_set)
+ ) {
+ _output_path = asNormalizedPath(_opt_actions.output_dir_set).array;
+ if (!exists(_output_path)) {
+ try {
+ _output_path.mkdirRecurse;
+ }
+ // catch (ErrnoException ex) {
+ catch (Exception ex) {
+ // Handle error
+ }
+ }
+ assert(_output_path.isDir,
+ "not a directory: " ~ _output_path);
+ // TODO always test that is a directory and it is writable
+ }
+ return _output_path;
+ }
}
- return _image_dirs;
+ return Out_();
}
}
return ManifestMatters_();
@@ -163,90 +270,95 @@ template ConfigFilePaths() {
auto config_filename_document() {
return "config_document";
}
- auto possible_config_path_locations_document() {
- /+ FIX clean up conf paths ↓ +/
- /+ config local site (file system only, not in pod) +/
- /+ return paths +/
- string[] _possible_config_path_locations;
- if (_manifest.is_pod) {
- /+ config document in pod +/
- string _sisudoc_conf_pod;
- string _sisudoc_conf_pod_text;
- _sisudoc_conf_pod = asNormalizedPath(chainPath(
- to!string(_env["pwd"]),
- _manifest.pod_manifest_path ~ "/conf"
- )).array;
- _sisudoc_conf_pod_text = asNormalizedPath(chainPath(
- to!string(_env["pwd"]),
- _manifest.pod_manifest_path ~ "/media/text/" ~ _manifest.src_lng ~ "/conf"
- )).array;
- /+ return paths +/
- _possible_config_path_locations = [
- _sisudoc_conf_pod_text,
- _sisudoc_conf_pod,
- ];
- } else {
- /+ config document (& or local site) on filesystem +/
- string _sisudoc_conf_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "sisudoc/conf")).array; // think about
- string _sisudoc_conf_pwd_a = asNormalizedPath(chainPath(to!string(_env["pwd"]), "conf")).array;
- string _sisudoc_conf_pwd_b = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../conf")).array;
- string _sisudoc_conf_pwd_c = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../conf")).array;
- string _sisudoc_conf_pwd_d = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../../conf")).array;
- /+ return paths +/
- _possible_config_path_locations = [
- _sisudoc_conf_pwd,
- _sisudoc_conf_pwd_a,
- _sisudoc_conf_pwd_b,
- _sisudoc_conf_pwd_c,
- _sisudoc_conf_pwd_d,
- ];
- }
- /+ FIX clean up conf paths ↑
- (compare pwd to doc path location, and build config path)
- +/
- return _possible_config_path_locations;
- }
- auto config_filename_site() {
- return "config_local_site";
- }
- auto possible_config_path_locations_local_site() {
- /+ FIX clean up conf paths ↓ +/
- /+ config local site (file system only, not in pod) +/
- string _dot_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), ".sisu")).array;
- string _underscore_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "_sisu")).array;
- string _dot_home = asNormalizedPath(chainPath(to!string(_env["home"]), ".sisu")).array;
- /+ return paths +/
- string[] _possible_config_path_locations;
- if (_manifest.is_pod) {
- _possible_config_path_locations = [
- _dot_pwd,
- _underscore_pwd,
- _dot_home,
- "/etc/sisu"
- ];
- } else {
- /+ config document (& or local site) on filesystem +/
- string _sisudoc_conf_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "sisudoc/conf")).array; // think about
- string _sisudoc_conf_pwd_a = asNormalizedPath(chainPath(to!string(_env["pwd"]), "conf")).array;
- string _sisudoc_conf_pwd_b = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../conf")).array;
- string _sisudoc_conf_pwd_c = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../conf")).array;
- string _sisudoc_conf_pwd_d = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../../conf")).array;
- _possible_config_path_locations = [
- _sisudoc_conf_pwd,
- _sisudoc_conf_pwd_a,
- _sisudoc_conf_pwd_b,
- _sisudoc_conf_pwd_c,
- _sisudoc_conf_pwd_d,
- _dot_pwd,
- _underscore_pwd,
- _dot_home,
- "/etc/sisu"
- ];
+ auto possible_config_path_locations() {
+ struct _ConfFilePaths {
+ auto document() {
+ /+ FIX clean up conf paths ↓ +/
+ /+ config local site (file system only, not in pod) +/
+ /+ return paths +/
+ string[] _possible_config_path_locations;
+ if (_manifest.src.is_pod) {
+ /+ config document in pod +/
+ string _sisudoc_conf_pod; //
+ string _sisudoc_conf_pod_text; //
+ _sisudoc_conf_pod = asNormalizedPath(chainPath(
+ to!string(_env["pwd"]),
+ _manifest.pod.manifest_path ~ "/conf"
+ )).array;
+ _sisudoc_conf_pod_text = asNormalizedPath(chainPath(
+ to!string(_env["pwd"]),
+ _manifest.pod.manifest_path ~ "/media/text/" ~ _manifest.src.lng ~ "/conf"
+ )).array;
+ /+ return paths +/
+ _possible_config_path_locations = [
+ _sisudoc_conf_pod_text,
+ _sisudoc_conf_pod,
+ ];
+ } else {
+ /+ config document (& or local site) on filesystem +/
+ string _sisudoc_conf_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "sisudoc/conf")).array; // think about
+ string _sisudoc_conf_pwd_a = asNormalizedPath(chainPath(to!string(_env["pwd"]), "conf")).array;
+ string _sisudoc_conf_pwd_b = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../conf")).array;
+ string _sisudoc_conf_pwd_c = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../conf")).array;
+ string _sisudoc_conf_pwd_d = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../../conf")).array;
+ /+ return paths +/
+ _possible_config_path_locations = [
+ _sisudoc_conf_pwd,
+ _sisudoc_conf_pwd_a,
+ _sisudoc_conf_pwd_b,
+ _sisudoc_conf_pwd_c,
+ _sisudoc_conf_pwd_d,
+ ];
+ }
+ /+ FIX clean up conf paths ↑
+ (compare pwd to doc path location, and build config path)
+ +/
+ return _possible_config_path_locations;
+ }
+ auto config_filename_site() {
+ return "config_local_site";
+ }
+ auto local_site() {
+ /+ FIX clean up conf paths ↓ +/
+ /+ config local site (file system only, not in pod) +/
+ string _dot_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), ".sisu")).array;
+ string _underscore_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "_sisu")).array;
+ string _dot_home = asNormalizedPath(chainPath(to!string(_env["home"]), ".sisu")).array;
+ /+ return paths +/
+ string[] _possible_config_path_locations;
+ if (_manifest.src.is_pod) {
+ _possible_config_path_locations = [
+ _dot_pwd,
+ _underscore_pwd,
+ _dot_home,
+ "/etc/sisu"
+ ];
+ } else {
+ /+ config document (& or local site) on filesystem +/
+ string _sisudoc_conf_pwd = asNormalizedPath(chainPath(to!string(_env["pwd"]), "sisudoc/conf")).array; // think about
+ string _sisudoc_conf_pwd_a = asNormalizedPath(chainPath(to!string(_env["pwd"]), "conf")).array;
+ string _sisudoc_conf_pwd_b = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../conf")).array;
+ string _sisudoc_conf_pwd_c = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../conf")).array;
+ string _sisudoc_conf_pwd_d = asNormalizedPath(chainPath(to!string(_env["pwd"]), "../../../conf")).array;
+ _possible_config_path_locations = [
+ _sisudoc_conf_pwd,
+ _sisudoc_conf_pwd_a,
+ _sisudoc_conf_pwd_b,
+ _sisudoc_conf_pwd_c,
+ _sisudoc_conf_pwd_d,
+ _dot_pwd,
+ _underscore_pwd,
+ _dot_home,
+ "/etc/sisu"
+ ];
+ }
+ /+ FIX clean up conf paths ↑
+ (compare pwd to doc path location, and build config path)
+ +/
+ return _possible_config_path_locations;
+ }
}
- /+ FIX clean up conf paths ↑
- (compare pwd to doc path location, and build config path)
- +/
- return _possible_config_path_locations;
+ return _ConfFilePaths();
}
}
return ConfFilePaths();
@@ -301,52 +413,17 @@ template SiSUpathsSRC() {
return SisuSrcPaths();
}
}
-template SiSUpathsSisupod() {
- mixin SiSUrgxInit;
- static auto rgx = Rgx();
- string _base_dir_pod = "sisupod";
- string _base_dir_doc = "sisudoc";
- string _suffix = ".zip";
- auto SiSUpathsSisupod()() {
- struct _PathsStruct {
- string base_filename(string fn_src) {
- auto pth = fn_src.baseName.stripExtension;
- return pth;
- }
- string sisupod_dir() {
- auto pth = _base_dir_pod;
- return pth;
- }
- string sisudoc_dir() {
- auto pth = _base_dir_doc;
- return pth;
- }
- string sisupod_filename(string fn_src) {
- string pth = _base_dir_pod.chainPath(base_filename(fn_src) ~ _suffix).array;
- return pth;
- }
- string base_filesystem(string fn_src) {
- string pth = _base_dir_pod.chainPath(base_filename(fn_src)).array;
- assert(pth == _base_dir_pod ~ "/" ~ base_filename(fn_src),
- pth ~ " == " ~ _base_dir_pod ~ "/" ~ base_filename(fn_src) ~ "?");
- return pth;
- }
- string base_pod(string fn_src) {
- string pth = _base_dir_pod.chainPath(base_filename(fn_src)).array; // change this
- return pth;
- }
- }
- return _PathsStruct();
- }
-}
+
template SiSUpathsSisupods() {
mixin SiSUrgxInit;
static auto rgx = Rgx();
- string _base_dir_pod = "sisupod";
- string _base_dir_doc = "sisudoc";
string _suffix = ".zip";
- auto SiSUpathsSisupods()() {
+ auto SiSUpathsSisupods(Dm)(Dm doc_matters) {
+ string _base_dir_pod = (doc_matters.output_path.length > 0)
+ ? doc_matters.output_path ~ "/sisupod"
+ : "/sisupod";
+ string _base_dir_doc = "sisudoc";
struct _PodPaths {
string base_filename_(string fn_src) {
auto pth = fn_src.baseName.stripExtension;
diff --git a/src/sdp/output/rgx.d b/src/sdp/output/rgx.d
index 3e03620..1c32351 100644
--- a/src/sdp/output/rgx.d
+++ b/src/sdp/output/rgx.d
@@ -30,6 +30,7 @@ static template SiSUoutputRgxInit() {
static src_fn_insert = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ssi)$`);
static src_fn_find_inserts = ctRegex!(`^(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[im])$`);
static insert_src_fn_ssi_or_sst = ctRegex!(`^<<\s*(?P<path>[a-zA-Z0-9._-]+/)*(?P<filename>[a-zA-Z0-9._-]+[.]ss[ti])$`);
+ static src_base_parent_dir_name = ctRegex!(`[/](?P<dir>(?:[a-zA-Z0-9._-]+))(?:/media/text/[a-z]{2})$`); // formalizes dir structure
/+ inline markup footnotes endnotes +/
static inline_notes_al = ctRegex!(`【(?:[*+]\s+|\s*)(.+?)】`, "mg");
static inline_notes_al_gen = ctRegex!(`【.+?】`, "m");
diff --git a/src/sdp/output/source_sisupod.d b/src/sdp/output/source_sisupod.d
index 0d529b6..c48a0e3 100644
--- a/src/sdp/output/source_sisupod.d
+++ b/src/sdp/output/source_sisupod.d
@@ -15,64 +15,71 @@ template SiSUpod() {
// static assert(is(typeof(doc_matters) == tuple));
}
mixin SiSUoutputRgxInit;
- string pwd = doc_matters.environment.pwd;
- auto src_path_info = doc_matters.src_path_info;
- auto pth_sisudoc_src = doc_matters.src_path_info;
- auto pths_sisupod = SiSUpathsSisupods!()();
+ string pwd = doc_matters.env.pwd;
+ auto src_path_info = doc_matters.src.path_info;
+ auto pth_sisudoc_src = doc_matters.src.path_info;
+ auto pths_sisupod = SiSUpathsSisupods!()(doc_matters);
mixin SiSUlanguageCodes;
auto lang = Lang();
static auto rgx = Rgx();
- assert (doc_matters.source_filename.match(rgx.src_fn));
+ assert (doc_matters.src.filename.match(rgx.src_fn));
try {
/+ create directory structure +/
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 (!exists(pths_sisupod.text_root(doc_matters.source_filename).filesystem_open_zpod)) {
- pths_sisupod.text_root(doc_matters.source_filename).filesystem_open_zpod.mkdirRecurse;
+ if (doc_matters.opt.action.source) {
+ if (!exists(pths_sisupod.text_root(doc_matters.src.filename).filesystem_open_zpod)) {
+ pths_sisupod.text_root(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse;
}
- if (!exists(pths_sisupod.conf_root(doc_matters.source_filename).filesystem_open_zpod)) {
- pths_sisupod.conf_root(doc_matters.source_filename).filesystem_open_zpod.mkdirRecurse;
+ if (!exists(pths_sisupod.conf_root(doc_matters.src.filename).filesystem_open_zpod)) {
+ pths_sisupod.conf_root(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse;
}
- if (!exists(pths_sisupod.media_root(doc_matters.source_filename).filesystem_open_zpod)) {
- pths_sisupod.media_root(doc_matters.source_filename).filesystem_open_zpod.mkdirRecurse;
+ if (!exists(pths_sisupod.media_root(doc_matters.src.filename).filesystem_open_zpod)) {
+ pths_sisupod.media_root(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse;
}
- if (!exists(pths_sisupod.css(doc_matters.source_filename).filesystem_open_zpod)) {
- pths_sisupod.css(doc_matters.source_filename).filesystem_open_zpod.mkdirRecurse;
+ if (!exists(pths_sisupod.css(doc_matters.src.filename).filesystem_open_zpod)) {
+ pths_sisupod.css(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse;
}
- if (!exists(pths_sisupod.image_root(doc_matters.source_filename).filesystem_open_zpod)) {
- pths_sisupod.image_root(doc_matters.source_filename).filesystem_open_zpod.mkdirRecurse;
+ if (!exists(pths_sisupod.image_root(doc_matters.src.filename).filesystem_open_zpod)) {
+ pths_sisupod.image_root(doc_matters.src.filename).filesystem_open_zpod.mkdirRecurse;
}
- if (!exists(pths_sisupod.doc_lng(doc_matters.source_filename, doc_matters.language).filesystem_open_zpod)) {
- pths_sisupod.doc_lng(doc_matters.source_filename, doc_matters.language).filesystem_open_zpod.mkdirRecurse;
+ if (!exists(pths_sisupod.doc_lng(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod)) {
+ pths_sisupod.doc_lng(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.mkdirRecurse;
}
}
debug(sisupod) {
writeln(__LINE__, ": ",
- doc_matters.source_filename, " -> ",
- pths_sisupod.fn_doc(doc_matters.source_filename, doc_matters.language).filesystem_open_zpod
+ doc_matters.src.filename, " -> ",
+ pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod
);
}
auto zip = new ZipArchive();
- auto fn_sisupod = pths_sisupod.sisupod_filename(doc_matters.source_filename).zpod;
+ auto fn_sisupod = pths_sisupod.sisupod_filename(doc_matters.src.filename).zpod;
{ /+ bundle images +/
- foreach (image; doc_matters.image_list) {
+ foreach (image; doc_matters.src.image_list) {
debug(sisupodimages) {
writeln(
pth_sisudoc_src.image_root.to!string, "/", image, " -> ",
- pths_sisupod.image_root(doc_matters.source_filename).zpod, "/", image
+ pths_sisupod.image_root(doc_matters.src.filename).zpod, "/", image
);
}
auto fn_src_in = pth_sisudoc_src.image_root.to!string ~ "/" ~ image;
- 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;
+ auto fn_src_out_sisupod_zip_base
+ = pths_sisupod.image_root(doc_matters.src.filename).zpod.to!string
+ ~ "/" ~ image;
+ auto fn_src_out_filesystem
+ = pths_sisupod.image_root(doc_matters.src.filename).filesystem_open_zpod.to!string
+ ~ "/" ~ image;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action.source) {
+ debug(io) {
+ writeln("src out found: ", fn_src_in);
+ }
+ 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();
@@ -80,17 +87,28 @@ template SiSUpod() {
zip_arc_member_file.expandedData = zip_data.toBytes();
zip.addMember(zip_arc_member_file);
}
+ } else {
+ if (doc_matters.opt.action.verbose) {
+ writeln("src out NOT found (image): ", fn_src_in);
+ }
}
}
} { /+ bundle sisu_document_make +/
- auto fn_src_in = pth_sisudoc_src.conf_root.to!string ~ "/" ~ "sisu_document_make"; // check (_sisu/sisu_document_make)
- 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";
+ auto fn_src_in
+ = pth_sisudoc_src.conf_root.to!string ~ "/" ~ "sisu_document_make"; // check (_sisu/sisu_document_make)
+ auto fn_src_out_sisupod_zip_base
+ = pths_sisupod.conf_root(doc_matters.src.filename).zpod.to!string ~ "/" ~ "sisu_document_make";
+ auto fn_src_out_filesystem
+ = pths_sisupod.conf_root(doc_matters.src.filename).filesystem_open_zpod.to!string
+ ~ "/" ~ "sisu_document_make"; // TODO
if (exists(fn_src_in)) {
- if (doc_matters.opt_action.source) {
+ debug(io) {
+ writeln("src out found: ", fn_src_in);
+ }
+ 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();
@@ -98,25 +116,36 @@ template SiSUpod() {
zip_arc_member_file.expandedData = zip_data.toBytes();
zip.addMember(zip_arc_member_file);
}
+ } else {
+ if (doc_matters.opt.action.verbose) {
+ writeln("src out NOT found (document make): ", fn_src_in);
+ }
}
} { /+ TODO bundle primary file +/
- auto fn_src_in = doc_matters.source_filename;
- auto fn_src_out_sisupod_zip_base = pths_sisupod.fn_doc(doc_matters.source_filename, doc_matters.language).zpod.to!string;
- auto fn_src_out_filesystem = pths_sisupod.fn_doc(doc_matters.source_filename, doc_matters.language).filesystem_open_zpod.to!string; // needed without root path:
- auto fn_src_out_inside_pod = pths_sisupod.fn_doc(doc_matters.source_filename, doc_matters.language).zpod.to!string; // needed without root path:
+ auto fn_src_in = doc_matters.src.file_with_absolute_path.to!string;
+ auto fn_src_out_sisupod_zip_base
+ = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).zpod.to!string;
+ auto fn_src_out_filesystem
+ = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.to!string; // needed without root path:
+ auto fn_src_out_inside_pod
+ = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).zpod.to!string; // needed without root path:
string[] filelist_src_out_sisupod_arr;
string[] filelist_src_zpod_arr;
if (exists(fn_src_in)) {
- filelist_src_out_sisupod_arr ~= fn_src_out_sisupod_zip_base;
+ debug(io) {
+ writeln("src out found: ", 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) {
- auto filelist = File(pths_sisupod.fn_pod_filelist(doc_matters.source_filename).filesystem_open_zpod, "w");
+ if (doc_matters.opt.action.source) {
+ auto filelist
+ = File(pths_sisupod.fn_pod_filelist(doc_matters.src.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();
@@ -124,38 +153,45 @@ template SiSUpod() {
zip_arc_member_file.expandedData = zip_data.toBytes();
zip.addMember(zip_arc_member_file);
}
+ } else {
+ if (doc_matters.opt.action.verbose) {
+ writeln("src out NOT found (markup source): ", fn_src_in);
+ }
}
} { /+ bundle insert files +/
- if (doc_matters.file_insert_list.length > 0) {
- foreach (insert_file; doc_matters.file_insert_list) {
+ if (doc_matters.src.file_insert_list.length > 0) {
+ foreach (insert_file; doc_matters.src.file_insert_list) {
debug(sisupod) {
writeln(
insert_file, " -> ",
pths_sisupod.fn_doc_insert(
- doc_matters.source_filename,
+ doc_matters.src.filename,
insert_file,
- doc_matters.language,
+ doc_matters.src.language,
).zpod
);
}
auto fn_src_in = insert_file;
- auto fn_src_out_sisupod_zip_base =
- pths_sisupod.fn_doc_insert(
- doc_matters.source_filename,
+ auto fn_src_out_sisupod_zip_base
+ = pths_sisupod.fn_doc_insert(
+ doc_matters.src.filename,
insert_file,
- doc_matters.language,
+ doc_matters.src.language,
).zpod.to!string;
- auto fn_src_out_filesystem =
- pths_sisupod.fn_doc_insert(
- doc_matters.source_filename,
+ auto fn_src_out_filesystem
+ = pths_sisupod.fn_doc_insert(
+ doc_matters.src.filename,
insert_file,
- doc_matters.language,
+ doc_matters.src.language,
).filesystem_open_zpod.to!string;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action.source) {
+ debug(io) {
+ writeln("src out found: ", fn_src_in);
+ }
+ 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();
@@ -164,13 +200,17 @@ template SiSUpod() {
zip.addMember(zip_arc_member_file);
createZipFile!()(fn_sisupod, zip.build());
}
+ } else {
+ if (doc_matters.opt.action.verbose) {
+ writeln("src out NOT found (insert file): ", fn_src_in);
+ }
}
}
}
} {
- auto fn_src_in = doc_matters.source_filename;
+ auto fn_src_in = doc_matters.src.filename;
if (exists(fn_src_in)) {
- if (doc_matters.opt_action.sisupod) {
+ if (doc_matters.opt.action.sisupod) {
createZipFile!()(fn_sisupod, zip.build());
}
}
@@ -190,22 +230,22 @@ template SiSUpod() {
catch (ZipException ex) {
// Handle errors
}
- if (doc_matters.source_filename == "sisudoc/media/text/en/the_wealth_of_networks.yochai_benkler.sst") {
+ if (doc_matters.src.filename == "sisudoc/media/text/en/the_wealth_of_networks.yochai_benkler.sst") {
assert(
((data).sha256Of).toHexString
== "626F83A31ED82F42CF528E922C1643498A137ABA3F2E5AFF8A379EA79EA22A1E",
"\nsisupod: sha256 value for "
- ~ doc_matters.source_filename
+ ~ doc_matters.src.filename
~ " has changed, is now: "
~ ((data).sha256Of).toHexString
);
}
- if (doc_matters.source_filename == "sisudoc/media/text/en/sisu_markup_stress_test.sst") {
+ if (doc_matters.src.filename == "sisudoc/media/text/en/sisu_markup_stress_test.sst") {
assert(
((data).sha256Of).toHexString
== "AAE0C87AB3F6D5F7385AEEA6EE661F56D40475CFE87AD930C78C9FE07FFB0D91",
"\nsisupod: sha256 value for "
- ~ doc_matters.source_filename
+ ~ doc_matters.src.filename
~ " has changed, is now: "
~ ((data).sha256Of).toHexString
);
diff --git a/src/sdp/output/sqlite.d b/src/sdp/output/sqlite.d
index 5804da7..4abe3d1 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ if (doc_matters.opt.action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -456,11 +456,11 @@ template SQLiteBuildTablesAndPopulate() {
Statement SQLiteInstruct(I)(
auto ref I doc_matters,
) {
- auto pth_sqlite = SiSUpathsSQLite!()(doc_matters.output_path, doc_matters.language);
- auto db = Database(pth_sqlite.sqlite_file(doc_matters.environment.pwd.baseName));
+ auto pth_sqlite = SiSUpathsSQLite!()(doc_matters.output_path, doc_matters.src.language);
+ auto db = Database(pth_sqlite.sqlite_file(doc_matters.env.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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ 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
@@ -1073,7 +1073,7 @@ template SQLiteBuildTablesAndPopulate() {
}
}
}
- SQLiteObjectsLoop!()(doc_matters.keys_seq.sql);
+ SQLiteObjectsLoop!()(doc_matters.xml.keys_seq.sql);
}
}
template SQLiteTablesCreate() {
diff --git a/src/sdp/output/sqlite_discrete.d b/src/sdp/output/sqlite_discrete.d
index f97692f..0c323d1 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ 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_do) {
+ if (doc_matters.opt.action.debug_do) {
debug(sql_txt) {
writeln(obj_txt["text"]);
}
@@ -456,8 +456,8 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
Statement SQLiteInstruct(I)(
auto ref I doc_matters,
) {
- auto pth_sqlite = SiSUpathsSQLiteDiscrete!()(doc_matters.output_path, doc_matters.language);
- auto db = Database(pth_sqlite.sqlite_file(doc_matters.source_filename));
+ auto pth_sqlite = SiSUpathsSQLiteDiscrete!()(doc_matters.output_path, doc_matters.src.language);
+ auto db = Database(pth_sqlite.sqlite_file(doc_matters.src.filename));
// auto db = Database(":memory:"); // open database in memory
db.run("
DROP TABLE IF EXISTS metadata_and_text;
@@ -908,14 +908,14 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
obj_txt = format_and_sqlite_load.heading(obj);
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ if ((doc_matters.opt.action.debug_do)) {
writeln(__FILE__, ":", __LINE__, ": ", obj.is_a);
}
break;
}
break;
default:
- if ((doc_matters.opt_action.debug_do)) {
+ 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_do)) {
+ 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
@@ -1070,7 +1070,7 @@ template SQLiteDiscreteBuildTablesAndPopulate() {
}
}
}
- SQLiteObjectsLoop!()(doc_matters.keys_seq.sql);
+ SQLiteObjectsLoop!()(doc_matters.xml.keys_seq.sql);
}
}
template SQLiteDiscreteTablesCreate() {
diff --git a/src/sdp/output/xmls.d b/src/sdp/output/xmls.d
index 622e599..5e7f2e9 100644
--- a/src/sdp/output/xmls.d
+++ b/src/sdp/output/xmls.d
@@ -243,7 +243,7 @@ template outputXHTMLs() {
((type == "seg")
? "../../../css/html_seg.css"
: "../../css/html_scroll.css"),
- doc_matters.language,
+ doc_matters.src.language,
site_info_button(doc_matters),
inline_search_form(doc_matters),
((type == "seg") ? "" : "\n</div>"),
@@ -261,16 +261,16 @@ template outputXHTMLs() {
xmlns="http://www.w3.org/1999/xhtml"
xmlns:epub="http://www.idpf.org/2007/ops"
lang="%s" xml:lang="%s">¶",
- doc_matters.language,
- doc_matters.language,
+ doc_matters.src.language,
+ doc_matters.src.language,
);
string html_strict = format(q"¶<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:epub="http://www.idpf.org/2007/ops"
lang="%s" xml:lang="%s">¶",
- doc_matters.language,
- doc_matters.language,
+ doc_matters.src.language,
+ doc_matters.src.language,
);
string o;
o = format(q"¶%s
@@ -304,7 +304,7 @@ template outputXHTMLs() {
doc_matters.conf_make_meta.meta.title_full,
(doc_matters.conf_make_meta.meta.creator_author.empty) ? ""
: ", " ~ doc_matters.conf_make_meta.meta.creator_author,
- doc_matters.language,
+ doc_matters.src.language,
);
return o;
}
diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d
index 8434841..4e43a67 100755
--- a/src/sdp/sdp.d
+++ b/src/sdp/sdp.d
@@ -303,7 +303,7 @@ void main(string[] args) {
"home" : environment["HOME"],
];
auto _manifest_start = PodManifest!()();
- auto _manifest_matter = PodMatters!()(_opt_action, _env);
+ auto _manifest_matter = PathMatters!()(_opt_action, _env);
auto _manifests = [ _manifest_matter ];
foreach(arg; args[1..$]) {
_manifest_start = PodManifest!()(arg);
@@ -340,8 +340,8 @@ void main(string[] args) {
} else { // (file name with path \n)+
contents_location_ = contents_location_raw_;
}
- auto contents_locations_arr =
- (cast(char[]) contents_location_).split;
+ auto contents_locations_arr
+ = (cast(char[]) contents_location_).split;
auto tmp_dir_ = (sisudoc_txt_).dirName.array;
foreach (contents_location; contents_locations_arr) {
assert(contents_location.match(rgx.src_pth_sst_or_ssm),
@@ -354,12 +354,12 @@ void main(string[] args) {
|| (contents_location_pth_).match(lang_rgx_)
) {
auto _fns = (((tmp_dir_).chainPath(contents_location_pth_)).array).to!(string);
- _manifest_matter = PodMatters!()(_opt_action, _env, arg, _fns, contents_locations_arr);
+ _manifest_matter = PathMatters!()(_opt_action, _env, arg, _fns, contents_locations_arr);
_manifests ~= _manifest_matter; // TODO how to capture?
}
}
} else if (arg.match(rgx.src_pth_sst_or_ssm)) {
- _manifests ~= PodMatters!()(_opt_action, _env, arg, arg); // gather input markup source file names for processing
+ _manifests ~= PathMatters!()(_opt_action, _env, arg, arg); // gather input markup source file names for processing
} else if (arg.match(rgx.src_pth_zip)) {
// fns_src ~= arg; // gather input markup source file names for processing
} else { // anything remaining, unused
@@ -372,7 +372,7 @@ void main(string[] args) {
}
if (_manifests.length > 1) { // _manifests[0] initialized dummy element
foreach(manifest; _manifests[1..$]) {
- if (!empty(manifest.src_fn)) {
+ if (!empty(manifest.src.filename)) {
scope(success) {
debug(checkdoc) {
writefln(
@@ -387,14 +387,14 @@ void main(string[] args) {
stderr.writefln(
"~ document run failure ~ (%s v%s)\n\t%s",
__VENDOR__, __VERSION__,
- src_fn
+ manifest.src.filename
);
}
}
enforce(
- manifest.src_fn.match(rgx.src_pth_types),
+ manifest.src.filename.match(rgx.src_pth_types),
"not a sisu markup filename: «" ~
- manifest.src_fn ~ "»"
+ manifest.src.filename ~ "»"
);
auto t = SiSUabstraction!()(_env, _opt_action, manifest);
static assert(!isTypeTuple!(t));
@@ -402,24 +402,24 @@ void main(string[] args) {
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_do)
- || (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 (!(doc_matters.opt_action.skip_output)) {
+ if (!(doc_matters.opt.action.skip_output)) {
outputHub!()(doc_abstraction, doc_matters);
}
scope(exit) {
debug(checkdoc) {
writefln(
"processed file: %s",
- manifest.src_fn
+ manifest.src.filename
);
}
destroy(manifest);