aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/sdp.org
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 /org/sdp.org
parenta bit of naming and tidying (diff)
0.9.0 document sections
Diffstat (limited to 'org/sdp.org')
-rw-r--r--org/sdp.org79
1 files changed, 65 insertions, 14 deletions
diff --git a/org/sdp.org b/org/sdp.org
index a3e67a2..c1157eb 100644
--- a/org/sdp.org
+++ b/org/sdp.org
@@ -24,7 +24,7 @@ struct Version {
int minor;
int patch;
}
-enum ver = Version(0, 8, 0);
+enum ver = Version(0, 9, 0);
#+END_SRC
* sdp.d sisu document parser :sdp.d:
@@ -360,27 +360,79 @@ string[string][string] dochead_meta = header_make_and_meta_tuple[1];
/+ ↓ 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?
#+END_SRC
+
+#+NAME: sdp_each_file_do_document_abstraction
+#+BEGIN_SRC d
+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";
+}
+#+END_SRC
+
**** TODO debug (document parts, checkdoc) :debug:checkdoc:
#+NAME: sdp_each_file_do_debugs_checkdoc
#+BEGIN_SRC d
/+ ↓ 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,
@@ -398,8 +450,7 @@ debug(checkdoc) { // checkbook & dumpdoc
/+ ↓ 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,