aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/ao_output_debugs.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/ao_output_debugs.d
parenta bit of naming and tidying (diff)
0.9.0 document sections
Diffstat (limited to 'src/sdp/ao_output_debugs.d')
-rw-r--r--src/sdp/ao_output_debugs.d167
1 files changed, 95 insertions, 72 deletions
diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d
index eefec9d..3bb8ae2 100644
--- a/src/sdp/ao_output_debugs.d
+++ b/src/sdp/ao_output_debugs.d
@@ -5,8 +5,9 @@ template SiSUoutputDebugs() {
struct SDPoutputDebugs {
auto abstract_doc_source_debugs(S)(
auto ref const S contents,
- string[][string][string] bookindex_unordered_hashes,
- JSONValue[] biblio,
+ string[][string] document_section_keys_sequenced,
+ string[][string][string] bookindex_unordered_hashes, // redundant, consider
+ JSONValue[] biblio, // redundant, consider
string[string][string] dochead_make,
string[string][string] dochead_meta,
string fn_src,
@@ -44,17 +45,18 @@ template SiSUoutputDebugs() {
__FILE__,
__LINE__,
);
- foreach (obj; contents) {
- if (obj.use == "content") {
- if (obj.is_a == "heading") {
- writefln(
- "%s node: %s heading: %s %s",
- obj.obj_cite_number,
- obj.node,
- obj.lev_markup_number,
- obj.object,
- );
- } else {
+ foreach (key; document_section_keys_sequenced["seg"]) {
+ foreach (obj; contents[key]) {
+ if (obj.use == "content") {
+ if (obj.is_a == "heading") {
+ writefln(
+ "%s node: %s heading: %s %s",
+ obj.obj_cite_number,
+ obj.node,
+ obj.lev_markup_number,
+ obj.object,
+ );
+ }
}
}
}
@@ -271,53 +273,65 @@ template SiSUoutputDebugs() {
__FILE__,
__LINE__,
);
- foreach (obj; contents) {
- if (obj.is_a == "heading") {
- writefln(
- "%s~ [%s] %s %s",
- obj.heading_attrib.lev,
- obj.obj_cite_number,
- obj.anchor_tags,
- obj.object
- );
+ foreach (key; document_section_keys_sequenced["seg"]) {
+ foreach (obj; contents[key]) {
+ if (obj.is_a == "heading") {
+ writefln(
+ "%s~ [%s] %s %s",
+ obj.heading_attrib.lev,
+ obj.obj_cite_number,
+ obj.anchor_tags,
+ // "[", obj["is"], "] ",
+ obj.object
+ );
+ }
}
}
}
debug(heading) { // heading
string spc;
- foreach (o; contents) {
- if (o.is_a == "heading") {
- switch (o.heading_attrib.lev_markup_number) {
- case 0:
- spc="";
- break;
- case 1:
- spc=" ";
- break;
- case 2:
- spc=" ";
- break;
- case 3:
- spc=" ";
- break;
- case 4:
- spc=" ";
- break;
- case 5:
- spc=" ";
- break;
- case 6:
- spc=" ";
- break;
- case 7:
- spc=" ";
- break;
- case 8:
- spc=" ";
- break;
- default:
- spc="";
- break;
+ foreach (key; document_section_keys_sequenced["seg"]) {
+ foreach (o; contents[key]) {
+ if (o.is_a == "heading") {
+ switch (o.heading_attrib.lev_markup_number) {
+ case 0:
+ spc="";
+ break;
+ case 1:
+ spc=" ";
+ break;
+ case 2:
+ spc=" ";
+ break;
+ case 3:
+ spc=" ";
+ break;
+ case 4:
+ spc=" ";
+ break;
+ case 5:
+ spc=" ";
+ break;
+ case 6:
+ spc=" ";
+ break;
+ case 7:
+ spc=" ";
+ break;
+ case 8:
+ spc=" ";
+ break;
+ default:
+ spc="";
+ break;
+ }
+ writefln(
+ "%s* %s\n (markup level: %s; collapsed level: %s)",
+ spc,
+ strip(o.object),
+ o.heading_attrib.lev_markup_number,
+ o.heading_attrib.lev_collapsed_number
+ );
}
writefln(
"%s* %s\n (markup level: %s; collapsed level: %s)",
@@ -340,41 +354,50 @@ template SiSUoutputDebugs() {
__FILE__,
__LINE__,
);
- foreach (obj; contents) {
- if (obj.is_a == "heading") {
- writefln(
- "%s~ [%s] %s",
- obj.heading_attrib.lev,
- obj.obj_cite_number,
- obj.object
- );
+ foreach (key; document_section_keys_sequenced["seg"]) {
+ foreach (obj; contents[key]) {
+ if (obj.is_a == "heading") {
+ writefln(
+ "%s~ [%s] %s",
+ obj.heading_attrib.lev,
+ obj.obj_cite_number,
+ // "[", obj["is"], "] ",
+ obj.object
+ );
+ }
}
}
}
debug(checkdoc) {
- foreach (obj; contents) {
- if (obj.use == "content") {
- if (!empty(obj.obj_cite_number)) {
- check["last_obj_cite_number"] = obj.obj_cite_number;
+ foreach (key; document_section_keys_sequenced["seg"]) {
+ foreach (obj; contents[key]) {
+ if (obj.use == "content") {
+ if (!empty(obj.obj_cite_number)) {
+ check["last_obj_cite_number"] = obj.obj_cite_number;
+ }
}
}
}
}
writefln(
- "%s\n\"%s\", %s\n%s\n%s\n%s%s\n%s%s\n%s%s\n%s:%s",
+ "%s\n\"%s\", %s\n%s\n%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s%s\n%s:%s\n",
"-------------------------------",
dochead_meta["title"]["full"],
dochead_meta["creator"]["author"],
"-------------------------------",
fn_src,
"length contents array: ",
- contents.length,
+ contents["body"].length,
"last obj_cite_number: ",
check["last_obj_cite_number"],
- "length bookindex: ",
- bookindex_unordered_hashes.length,
+ "length glossary: ",
+ contents["glossary"].length,
"length biblio: ",
- biblio.length,
+ contents["bibliography"].length,
+ "length bookindex: ",
+ contents["bookindex_seg"].length,
+ "length blurb: ",
+ contents["blurb"].length,
__FILE__,
__LINE__,
);