diff options
Diffstat (limited to 'src/sdp.d')
-rwxr-xr-x | src/sdp.d | 72 |
1 files changed, 59 insertions, 13 deletions
@@ -196,21 +196,68 @@ void main(string[] args) { /+ ↓ document abstraction: process document, return abstraction as tuple +/ auto t = abs.abstract_doc_source(content_body, dochead_make, dochead_meta); static assert(!isTypeTuple!(t)); - auto doc_ao_contents = t[0]; // head ~ toc ~ contents ~ endnotes_seg ~ [glossary] ~ bibliography ~ bookindex; + auto doc_ao_contents = t[0]; // head ~ toc ~ contents ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~blurb; auto doc_ao_bookindex_unordered_hashes = t[1]; // redundant? auto doc_ao_biblio = t[2]; // redundant? + string[][string] document_section_keys_sequenced = [ + "seg": [ + "head", + "toc_seg", + "body", + ], + "scroll": [ + "head", + "toc_scroll", + "body", + ] + ]; + /+ seg +/ + if (doc_ao_contents["endnotes_seg"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "endnotes_seg"; + } + if (doc_ao_contents["glossary"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "glossary"; + } + if (doc_ao_contents["bibliography"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "bibliography"; + } + if (doc_ao_contents["bookindex_seg"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "bookindex_seg"; + } + if (doc_ao_contents["blurb"].length > 1) { + document_section_keys_sequenced["seg"] = + document_section_keys_sequenced["seg"] ~= "blurb"; + } + /+ scroll +/ + if (doc_ao_contents["endnotes_scroll"].length > 1) { + document_section_keys_sequenced["scroll"] = + document_section_keys_sequenced["scroll"] ~= "endnotes_scroll"; + } + if (doc_ao_contents["glossary"].length > 1) { + document_section_keys_sequenced["scroll"] = + document_section_keys_sequenced["scroll"] ~= "glossary"; + } + if (doc_ao_contents["bibliography"].length > 1) { + document_section_keys_sequenced["scroll"] = + document_section_keys_sequenced["scroll"] ~= "bibliography"; + } + if (doc_ao_contents["bookindex_scroll"].length > 1) { + document_section_keys_sequenced["scroll"] = + document_section_keys_sequenced["scroll"] ~= "bookindex_scroll"; + } + if (doc_ao_contents["blurb"].length > 1) { + document_section_keys_sequenced["scroll"] = + document_section_keys_sequenced["scroll"] ~= "blurb"; + } /+ ↓ debugs +/ - debug(checkdoc) { // checkbook & dumpdoc - auto doc_ao_contents_view = ( - doc_ao_contents["head"] ~ - doc_ao_contents["toc_seg"] ~ - doc_ao_contents["body"] ~ - doc_ao_contents["endnotes_seg"] ~ - doc_ao_contents["bibliography"] ~ - doc_ao_contents["bookindex_seg"] - ); + debug(checkdoc) { dbg.abstract_doc_source_debugs( - doc_ao_contents_view, + doc_ao_contents, + document_section_keys_sequenced, doc_ao_bookindex_unordered_hashes, // redundant? doc_ao_biblio, // redundant? dochead_make, @@ -222,8 +269,7 @@ void main(string[] args) { /+ ↓ output hub +/ output.hub( doc_ao_contents, - doc_ao_bookindex_unordered_hashes, // redundant? - doc_ao_biblio, // redundant? + document_section_keys_sequenced, dochead_make, dochead_meta, fn_src, |