aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-11-09 17:52:33 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:13 -0400
commit2301a8251d111ca2e020f524ce036c11e4306a14 (patch)
treeaed462b441e64efe989dca5c5d5eee306d9d53be /src/sdp.d
parenta bit of naming and tidying (diff)
0.9.0 document sections
Diffstat (limited to 'src/sdp.d')
-rwxr-xr-xsrc/sdp.d72
1 files changed, 59 insertions, 13 deletions
diff --git a/src/sdp.d b/src/sdp.d
index c13250d..63df077 100755
--- a/src/sdp.d
+++ b/src/sdp.d
@@ -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,