aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/ao_output_debugs.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-06-25 06:37:22 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-04 14:48:18 -0400
commitf0c845eba3718fd0c732aebf25eb33e689798e03 (patch)
treec2ea36e199950647b1d3cce153691bb8f4fec378 /src/sdp/ao_output_debugs.d
parentstep5.1 headers sdlang (like native headers) converted to json for common int... (diff)
step6 headers (&config), native & sdlang to json internally
Diffstat (limited to 'src/sdp/ao_output_debugs.d')
-rw-r--r--src/sdp/ao_output_debugs.d154
1 files changed, 152 insertions, 2 deletions
diff --git a/src/sdp/ao_output_debugs.d b/src/sdp/ao_output_debugs.d
index 525ebcc..68a2d40 100644
--- a/src/sdp/ao_output_debugs.d
+++ b/src/sdp/ao_output_debugs.d
@@ -8,8 +8,8 @@ template SiSUoutputDebugs() {
auto ref const S contents,
string[][string][string] bookindex_unordered_hashes,
JSONValue[] biblio,
- // JSONValue[string] dochead_make,
- // JSONValue[string] dochead_meta,
+ JSONValue[string] dochead_make,
+ JSONValue[string] dochead_meta,
string fn_src,
bool[string] opt_action_bool
) {
@@ -76,6 +76,154 @@ template SiSUoutputDebugs() {
}
}
}
+ debug(headermakejson) {
+ writefln(
+ "%s\n%s\n%s",
+ "document header, metadata & make instructions:",
+ dochead_meta,
+ pointer_head_main,
+ );
+ foreach (main_header; pointer_head_main) {
+ switch (main_header) {
+ case "make":
+ foreach (sub_header; pointer_head_sub_make) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ debug(headermetadatajson) {
+ writefln(
+ "%s\n%s\n%s",
+ "document header, metadata & make instructions:",
+ dochead_meta,
+ pointer_head_main,
+ );
+ foreach (main_header; pointer_head_main) {
+ switch (main_header) {
+ case "creator":
+ foreach (sub_header; pointer_head_sub_creator) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ case "title":
+ foreach (sub_header; pointer_head_sub_title) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ case "rights":
+ foreach (sub_header; pointer_head_sub_rights) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ case "date":
+ foreach (sub_header; pointer_head_sub_date) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ case "original":
+ foreach (sub_header; pointer_head_sub_original) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ case "classify":
+ foreach (sub_header; pointer_head_sub_classify) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ case "identifier":
+ foreach (sub_header; pointer_head_sub_identifier) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ case "notes":
+ foreach (sub_header; pointer_head_sub_notes) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ case "publisher":
+ foreach (sub_header; pointer_head_sub_publisher) {
+ if (to!string(dochead_meta[main_header][sub_header]).length > 2) {
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
+ dochead_meta[main_header][sub_header]
+ );
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
debug(bookindex) {
writefln(
"%s\n%s:%s",
@@ -138,10 +286,12 @@ template SiSUoutputDebugs() {
if (auto mfn=match(fn_src, rgx.src_fn)) {
if (opt_action_bool["assertions"]) {
switch (mfn.captures[2]) {
+ // live manual:
case "live-manual.ssm":
assert(check["last_obj_cite_number"] ==
"1019","last obj_cite_number should be: 1019 (check test, document is frequently updated)"); // ok
break;
+ // sisu_markup:
case "sisu_markup.sst":
assert(check["last_obj_cite_number"] ==
"297","last obj_cite_number expected to be: 297 rather than " ~ check["last_obj_cite_number"]); // ok