aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ao_output_debugs.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-04-24 22:08:24 -0400
committerRalph Amissah <ralph@amissah.com>2016-04-24 22:08:24 -0400
commited302d1be74d2b4e69ee4b6e3834637ed531eaea (patch)
tree0f605c3756788d2fda6fe0782a7a472172a285b9 /org/ao_output_debugs.org
parentbase ... tag (diff)
Diffstat (limited to 'org/ao_output_debugs.org')
-rw-r--r--org/ao_output_debugs.org177
1 files changed, 125 insertions, 52 deletions
diff --git a/org/ao_output_debugs.org b/org/ao_output_debugs.org
index 5fd0d98..3f9b59f 100644
--- a/org/ao_output_debugs.org
+++ b/org/ao_output_debugs.org
@@ -18,11 +18,17 @@
#+name: ao_output_debugs
#+BEGIN_SRC d
debug(parent) {
- writeln(__FILE__, ":", __LINE__);
+ writefln(
+ "%s:%s",
+ __FILE__,
+ __LINE__,
+ );
foreach (obj; contents) {
if (obj["use"] == "content") {
if (obj["is"] == "heading") {
- writeln(scr_txt_marker["cyan"],
+ writefln(
+ "%s%s node: %s heading: %s %s",
+ scr_txt_marker["cyan"],
obj["ocn"],
" node: ", obj["node"],
" heading: ", obj["lvn"],
@@ -34,18 +40,45 @@ debug(parent) {
}
}
#+END_SRC
+** (dumpdoc) :objects:
+#+name: ao_output_debugs
+#+BEGIN_SRC d
+debug(dumpdoc) {
+ writefln(
+ "%s\n%s:%s",
+ "-------------------------------",
+ __FILE__,
+ __LINE__,
+ );
+ foreach (obj; contents) {
+ if (obj["use"] == "content") {
+ writefln(
+ "[%s][%s]\n%s",
+ obj["ocn"],
+ obj["is"],
+ obj["obj"]
+ );
+ }
+ }
+}
+#+END_SRC
** (objects) :objects:
#+name: ao_output_debugs
#+BEGIN_SRC d
debug(objects) {
- writeln("-------------------------------");
- writeln(__FILE__, ":", __LINE__);
+ writefln(
+ "%s\n%s:%s",
+ "-------------------------------",
+ __FILE__,
+ __LINE__,
+ );
foreach (obj; contents) {
if (obj["use"] == "content") {
- writeln(
+ writefln(
+ "%s* [%s][%s] %s%s",
scr_txt_color["green"],
- "* [", obj["ocn"], "]",
- "[", obj["is"], "] ",
+ obj["ocn"],
+ obj["is"],
scr_txt_color["off"],
obj["obj"]
);
@@ -57,17 +90,21 @@ debug(objects) {
#+name: ao_output_debugs
#+BEGIN_SRC d
debug(headermakejson) {
- writeln("document header, metadata & make instructions:");
- writeln(dochead);
- writeln(pointer_head_main);
+ writefln(
+ "%s\n%s\n%s",
+ "document header, metadata & make instructions:",
+ dochead,
+ 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[main_header][sub_header]).length > 2) {
- writeln(
- main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -83,16 +120,21 @@ debug(headermakejson) {
#+name: ao_output_debugs
#+BEGIN_SRC d
debug(headermetadatajson) {
- writeln("document header, metadata & make instructions:");
- writeln(dochead);
- writeln(pointer_head_main);
+ writefln(
+ "%s\n%s\n%s",
+ "document header, metadata & make instructions:",
+ dochead,
+ 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[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -101,8 +143,10 @@ debug(headermetadatajson) {
case "title":
foreach (sub_header; pointer_head_sub_title) {
if (to!string(dochead[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -111,8 +155,10 @@ debug(headermetadatajson) {
case "rights":
foreach (sub_header; pointer_head_sub_rights) {
if (to!string(dochead[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -121,8 +167,10 @@ debug(headermetadatajson) {
case "date":
foreach (sub_header; pointer_head_sub_date) {
if (to!string(dochead[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -131,8 +179,10 @@ debug(headermetadatajson) {
case "original":
foreach (sub_header; pointer_head_sub_original) {
if (to!string(dochead[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -141,8 +191,10 @@ debug(headermetadatajson) {
case "classify":
foreach (sub_header; pointer_head_sub_classify) {
if (to!string(dochead[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -151,8 +203,10 @@ debug(headermetadatajson) {
case "identifier":
foreach (sub_header; pointer_head_sub_identifier) {
if (to!string(dochead[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -161,8 +215,10 @@ debug(headermetadatajson) {
case "notes":
foreach (sub_header; pointer_head_sub_notes) {
if (to!string(dochead[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -171,8 +227,10 @@ debug(headermetadatajson) {
case "publisher":
foreach (sub_header; pointer_head_sub_publisher) {
if (to!string(dochead[main_header][sub_header]).length > 2) {
- writeln(main_header, ":",
- sub_header, ": ",
+ writefln(
+ "%s:%s: %s",
+ main_header,
+ sub_header,
dochead[main_header][sub_header]
);
}
@@ -188,9 +246,13 @@ debug(headermetadatajson) {
#+name: ao_output_debugs
#+BEGIN_SRC d
debug(bookindex) {
- writeln("-------------------------------");
- writeln(__FILE__, ":", __LINE__);
- auto bookindex = new BookIndexReport();
+ writefln(
+ "%s\n%s:%s",
+ "-------------------------------",
+ __FILE__,
+ __LINE__,
+ );
+ auto bookindex = BookIndexReport();
bookindex.bookindex_report_sorted(bookindex_unordered_hashes);
}
#+END_SRC
@@ -219,28 +281,39 @@ debug(checkdoc) {
#+name: ao_output_debugs_summary
#+BEGIN_SRC d
debug(headings) {
- writeln("-------------------------------");
- writeln(__FILE__, ":", __LINE__);
+ writefln(
+ "%s\n%s:%s",
+ "-------------------------------",
+ __FILE__,
+ __LINE__,
+ );
foreach (obj; contents) {
if (obj["is"] == "heading") {
- writeln(
+ writefln(
+ "%s%s~ [%s] %s",
scr_txt_marker["yellow"],
- obj["lev"], "~ ",
- "[", obj["ocn"], "] ",
+ obj["lev"],
+ obj["ocn"],
+ // "[", obj["is"], "] ",
obj["obj"]
);
}
}
}
-writeln(
+writefln(
+ "%s%s%s\n%s\n%s%s\n%s%s\n%s%s\n%s:%s",
scr_txt_color["green"],
"-------------------------------",
scr_txt_color["off"],
- "\n", fn_src,
- "\nlength contents array: ", contents.length,
- "\nlast ocn: ", check["last_ocn"],
- "\nlength bookindex: ", bookindex_unordered_hashes.length,
- "\n", __FILE__, ":", __LINE__,
+ fn_src,
+ "length contents array: ",
+ contents.length,
+ "last ocn: ",
+ check["last_ocn"],
+ "length bookindex: ",
+ bookindex_unordered_hashes.length,
+ __FILE__,
+ __LINE__,
);
#+END_SRC
*** compare number of ocn for known sisu markup output (checkdoc)
@@ -377,12 +450,12 @@ debug(checkdoc) {
** code structure: :ao_output_debugs.d:
#+name: tangle_ao_output_debugs
#+BEGIN_SRC d :tangle ../lib/sdp/ao_output_debugs.d
-/*
+/+
output debugs
ao_output_debugs.d
-*/
++/
template SiSUoutputDebugs() {
- class SDPoutputDebugs {
+ struct SDPoutputDebugs {
auto abstract_doc_source_debugs(
string[string][] contents,
JSONValue[string] docmake,
@@ -394,7 +467,7 @@ template SiSUoutputDebugs() {
) {
mixin RgxInit;
mixin ScreenTxtColors;
- auto rgx = new Rgx();
+ auto rgx = Rgx();
<<ao_output_debugs>>
<<ao_output_debugs_summary>>
}