aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-04-18 20:48:41 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit69c906fc8cffc841fc33ab6f9bdeafcf1d8f3b82 (patch)
tree9c809898d0cd5221df2d13b0995671befb3111c3 /src
parent0.13.9 sisupod & epub3, zipped output (diff)
section keys sequencedoc-reform_v0.0.13
Diffstat (limited to 'src')
-rw-r--r--src/sdp/abstraction.d11
-rw-r--r--src/sdp/abstraction_summary.d2
-rw-r--r--src/sdp/ao_abstract_doc_source.d19
-rw-r--r--src/sdp/ao_doc_debugs.d14
-rw-r--r--src/sdp/output_epub3.d6
-rw-r--r--src/sdp/output_html.d4
-rw-r--r--src/sdp/output_hub.d2
7 files changed, 34 insertions, 24 deletions
diff --git a/src/sdp/abstraction.d b/src/sdp/abstraction.d
index 65bb5cd..714ab41 100644
--- a/src/sdp/abstraction.d
+++ b/src/sdp/abstraction.d
@@ -70,16 +70,13 @@ template SiSUabstraction() {
static assert(!isTypeTuple!(da));
static assert(da.length==4);
auto doc_abstraction = da[docAbst.doc_abstraction]; // head ~ toc ~ body ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~blurb;
- string[][string] _document_section_keys_sequenced = da[docAbst.section_keys];
+ auto _document_section_keys_sequenced = da[docAbst.section_keys];
string[] _doc_html_segnames = da[docAbst.segnames];
auto _images = da[docAbst.images];
struct DocumentMatters {
- string[] keys_seq_seg() {
- string[] _k = _document_section_keys_sequenced["seg"];
- return _k;
- }
- string[] keys_seq_scroll() {
- string[] _k = _document_section_keys_sequenced["scroll"];
+ auto keys_seq() {
+ /+ contains .seg & .scroll sequences +/
+ auto _k = _document_section_keys_sequenced;
return _k;
}
string[] segnames() {
diff --git a/src/sdp/abstraction_summary.d b/src/sdp/abstraction_summary.d
index ab32249..fe97783 100644
--- a/src/sdp/abstraction_summary.d
+++ b/src/sdp/abstraction_summary.d
@@ -23,7 +23,7 @@ template SiSUabstractionSummary() {
string[string] check = [
"last_obj_cite_number" : "NA [debug \"checkdoc\" not run]",
];
- foreach (k; doc_matters.keys_seq_seg) {
+ foreach (k; doc_matters.keys_seq.seg) {
foreach (obj; doc_abstraction[k]) {
if (obj.use != "empty") {
if (!empty(obj.obj_cite_number)) {
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d
index 2a27e64..24fcd48 100644
--- a/src/sdp/ao_abstract_doc_source.d
+++ b/src/sdp/ao_abstract_doc_source.d
@@ -1626,7 +1626,7 @@ template SiSUdocAbstraction() {
dom_collapsed_buffer = [ 0, 0, 0, 0, 0, 0, 0, 0, 0,];
auto t = tuple(
document_the,
- document_section_keys_sequenced,
+ docSectKeysSeq!()(document_section_keys_sequenced),
segnames,
images,
);
@@ -2627,8 +2627,8 @@ template SiSUdocAbstraction() {
);
auto substantive_obj_misc_tuple =
obj_im.obj_inline_markup_and_anchor_tags_and_misc(an_object, an_object_key, dochead_make_aa);
- an_object["substantive"] = substantive_obj_misc_tuple[sObj.content];
- anchor_tags = substantive_obj_misc_tuple[sObj.anchor_tags];
+ 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;
comp_obj_block.use = "body";
comp_obj_block.is_of = "block";
@@ -5473,3 +5473,16 @@ template SiSUdocAbstraction() {
}
/+ abstraction functions assertions ↑ +/
} /+ ← closed: template SiSUdocAbstraction +/
+template docSectKeysSeq() {
+ auto docSectKeysSeq(string[][string] document_section_keys_sequenced) {
+ struct doc_sect_keys_seq {
+ auto seg() {
+ return document_section_keys_sequenced["seg"];
+ }
+ auto scroll() {
+ return document_section_keys_sequenced["scroll"];
+ }
+ }
+ return doc_sect_keys_seq();
+ }
+}
diff --git a/src/sdp/ao_doc_debugs.d b/src/sdp/ao_doc_debugs.d
index 05e3739..11eb148 100644
--- a/src/sdp/ao_doc_debugs.d
+++ b/src/sdp/ao_doc_debugs.d
@@ -37,7 +37,7 @@ template SiSUdebugs() {
__FILE__,
__LINE__,
);
- foreach (key; doc_matters.keys_seq_seg) {
+ foreach (key; doc_matters.keys_seq.seg) {
foreach (obj; contents[key]) {
if (obj.use != "empty") {
if (obj.is_a == "heading") {
@@ -115,7 +115,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.keys_seq.seg) {
foreach (obj; contents[sect]) {
if (obj.is_a == "heading") {
foreach_reverse (k; 0 .. 7) {
@@ -138,7 +138,7 @@ template SiSUdebugs() {
}
}
writeln("--------------------");
- foreach (sect; doc_matters.keys_seq_seg) {
+ foreach (sect; doc_matters.keys_seq.seg) {
foreach (obj; contents[sect]) {
if (obj.is_a == "heading") {
foreach_reverse (k; 0 .. 7) {
@@ -393,7 +393,7 @@ template SiSUdebugs() {
__FILE__,
__LINE__,
);
- foreach (k; doc_matters.keys_seq_seg) {
+ foreach (k; doc_matters.keys_seq.seg) {
foreach (obj; contents[k]) {
if (obj.is_a == "heading") {
writefln(
@@ -409,7 +409,7 @@ template SiSUdebugs() {
}
}
debug(heading) { // heading
- foreach (k; doc_matters.keys_seq_seg) {
+ foreach (k; doc_matters.keys_seq.seg) {
foreach (o; contents[k]) {
if (o.is_a == "heading") {
writefln(
@@ -430,7 +430,7 @@ template SiSUdebugs() {
__FILE__,
__LINE__,
);
- foreach (k; doc_matters.keys_seq_seg) {
+ foreach (k; doc_matters.keys_seq.seg) {
foreach (obj; contents[k]) {
if (obj.is_a == "heading") {
writefln(
@@ -583,7 +583,7 @@ 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.keys_seq.seg) {
if (contents[key].length > 1) {
foreach (obj; contents[key]) {
if (obj.heading_lev_markup == 4) {
diff --git a/src/sdp/output_epub3.d b/src/sdp/output_epub3.d
index f0ac2c3..314fe64 100644
--- a/src/sdp/output_epub3.d
+++ b/src/sdp/output_epub3.d
@@ -117,7 +117,7 @@ template outputEPub3() {
enum DomTags { none, open, close, close_and_open, open_still, }
auto markup = InlineMarkup();
string toc ="<nav epub:type=\"toc\" id=\"toc\">\n";
- foreach (sect; doc_matters.keys_seq_seg) {
+ foreach (sect; doc_matters.keys_seq.seg) {
foreach (obj; doc_abstraction[sect]) {
if (obj.is_a == "heading") {
foreach_reverse (n; 0 .. 7) {
@@ -202,7 +202,7 @@ template outputEPub3() {
doc_matters.dochead_meta["title"]["full"], // title
(doc_matters.dochead_meta["creator"]["author"].empty) ? "" : doc_matters.dochead_meta["creator"]["author"], // author
);
- foreach (sect; doc_matters.keys_seq_seg) {
+ foreach (sect; doc_matters.keys_seq.seg) {
foreach (obj; doc_abstraction[sect]) {
if (obj.is_a == "heading") {
foreach_reverse (k; 0 .. 7) {
@@ -261,7 +261,7 @@ template outputEPub3() {
string[] top_level_headings = ["","","",""];
string[string] oepbs_content_parts;
string suffix = ".xhtml";
- foreach (part; doc_matters.keys_seq_seg) {
+ foreach (part; doc_matters.keys_seq.seg) {
foreach (obj; doc_abstraction[part]) {
if (obj.is_a == "heading") {
switch (obj.heading_lev_markup) {
diff --git a/src/sdp/output_html.d b/src/sdp/output_html.d
index 71faa67..431b81c 100644
--- a/src/sdp/output_html.d
+++ b/src/sdp/output_html.d
@@ -38,7 +38,7 @@ template outputHTML() {
string[] doc_html;
string[] doc;
string suffix = ".html";
- foreach (part; doc_matters.keys_seq_scroll) {
+ foreach (part; doc_matters.keys_seq.scroll) {
foreach (obj; doc_abstraction[part]) {
switch (obj.use) {
case "frontmatter":
@@ -205,7 +205,7 @@ template outputHTML() {
string segment_filename;
string[] top_level_headings = ["","","",""];
string suffix = ".html";
- foreach (part; doc_matters.keys_seq_seg) {
+ foreach (part; doc_matters.keys_seq.seg) {
foreach (obj; doc_abstraction[part]) {
if (obj.is_a == "heading") { // all headings: frontmatter, body & backmatter
switch (obj.heading_lev_markup) {
diff --git a/src/sdp/output_hub.d b/src/sdp/output_hub.d
index 65c8990..9e4f971 100644
--- a/src/sdp/output_hub.d
+++ b/src/sdp/output_hub.d
@@ -34,7 +34,7 @@ template outputHub() {
mixin SiSUoutputRgxInit;
auto rgx = Rgx();
if ((doc_matters.opt_action_bool["verbose"])) {
- writeln(doc_matters.keys_seq_seg);
+ writeln(doc_matters.keys_seq.seg);
}
if (doc_matters.opt_action_bool["source"]) {
/+ mixin outputSource; +/