diff options
Diffstat (limited to 'src/doc_reform/meta/doc_debugs.d')
-rw-r--r-- | src/doc_reform/meta/doc_debugs.d | 494 |
1 files changed, 50 insertions, 444 deletions
diff --git a/src/doc_reform/meta/doc_debugs.d b/src/doc_reform/meta/doc_debugs.d index 9ab9ea7..f68240d 100644 --- a/src/doc_reform/meta/doc_debugs.d +++ b/src/doc_reform/meta/doc_debugs.d @@ -1,3 +1,53 @@ +/+ +- Name: Spine, Doc Reform [a part of] + - Description: documents, structuring, processing, publishing, search + - static content generator + + - Author: Ralph Amissah + [ralph.amissah@gmail.com] + + - Copyright: (C) 2015 - 2021 Ralph Amissah, All Rights + Reserved. + + - License: AGPL 3 or later: + + Spine (SiSU), a framework for document structuring, publishing and + search + + Copyright (C) Ralph Amissah + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU AFERO General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program. If not, see [https://www.gnu.org/licenses/]. + + If you have Internet connection, the latest version of the AGPL should be + available at these locations: + [https://www.fsf.org/licensing/licenses/agpl.html] + [https://www.gnu.org/licenses/agpl.html] + + - Spine (by Doc Reform, related to SiSU) uses standard: + - docReform markup syntax + - standard SiSU markup syntax with modified headers and minor modifications + - docReform object numbering + - standard SiSU object citation numbering & system + + - Hompages: + [https://www.doc_reform.org] + [https://www.sisudoc.org] + + - Git + [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary] + ++/ /++ output debugs +/ @@ -52,399 +102,6 @@ template spineDebugs() { } } } - debug(dumpdoc) { - writefln( - "> %s:%s", - __FILE__, - __LINE__, - ); - } - debug(section_head) { - key="head"; - if (contents[key].length > 1) { - foreach (obj; contents[key]) { - writefln( - "[%s][%s]\n%s", - obj.object_number, - obj.metainfo.is_a, - obj.text - ); - } - } - } - debug(section_toc) { - key="toc"; - out_toc(contents, key); - } - debug(section_toc) { - key="toc"; - out_toc(contents, key); - } - debug(section_toc) { - key="toc"; - out_toc(contents, key); - } - debug(section_body) { - key="body"; - if (contents[key].length > 1) { - foreach (obj; contents[key]) { - writefln( - "[%s][%s]\n%s", - obj.object_number, - obj.metainfo.is_a, - obj.text - ); - } - } - } - debug(toc_nav_dom) { - enum DomTags { none, open, close, close_and_open, open_still, } - foreach (sect; doc_matters.has.keys_seq.seg) { - foreach (obj; contents[sect]) { - if (obj.metainfo.is_a == "heading") { - foreach_reverse (k; 0 .. 7) { - switch (obj.dom_structure_markedup_tags_status[k]) with (DomTags) { - case close : - writeln(markup.indent_by_spaces_provided(k), "</", k, ">"); - break; - case close_and_open : - writeln(markup.indent_by_spaces_provided(k), "</", k, ">"); - writeln(markup.indent_by_spaces_provided(k), - "<", k, ">", obj.text, - " file: ", obj.segment_anchor_tag_html, ".xhtml#", obj.ocn); - break; - case open : - writeln(markup.indent_by_spaces_provided(k), - "<", k, ">", obj.text, - " file: ", obj.segment_anchor_tag_html, ".xhtml#", obj.ocn); - break; - default : - break; - } - } - } - } - } - writeln("--------------------"); - foreach (sect; doc_matters.has.keys_seq.seg) { - foreach (obj; contents[sect]) { - if (obj.metainfo.is_a == "heading") { - foreach_reverse (k; 0 .. 7) { - switch (obj.dom_structure_collapsed_tags_status[k]) with (DomTags) { - case close : - writeln(markup.indent_by_spaces_provided(k), "</", k, ">"); - break; - case close_and_open : - writeln(markup.indent_by_spaces_provided(k), "</", k, ">"); - writeln(markup.indent_by_spaces_provided(k), - "<", k, ">", obj.text, - " file: ", obj.segment_anchor_tag_html, ".xhtml#", obj.ocn); - break; - case open : - writeln(markup.indent_by_spaces_provided(k), - "<", k, ">", obj.text, - " file: ", obj.segment_anchor_tag_html, ".xhtml#", obj.ocn); - break; - default : - break; - } - } - } - } - } - } - debug(decendants) { - foreach (sect; doc_matters.has.keys_seq.scroll) { - foreach (obj; contents[sect]) { - if (obj.metainfo.is_a == "heading") { - writeln(obj.metainfo.ocn, " .. ", obj.metainfo.last_decendant_ocn); - } - } - } - } - debug(section_endnotes) { - key="endnotes"; - out_endnotes(contents, key); - } - debug(section_endnotes_seg) { - key="endnotes"; - out_endnotes(contents, key); - } - debug(section_glossary) { - key="glossary"; - if (contents[key].length > 1) { - foreach (obj; contents[key]) { - writefln( - "[%s][%s]\n%s", - obj.object_number, - obj.metainfo.is_a, - obj.text - ); - } - } - } - debug(section_bibliography) { - key="bibliography"; - if (contents[key].length > 1) { - foreach (obj; contents[key]) { - writefln( - "[%s][%s]\n%s", - obj.object_number, - obj.metainfo.is_a, - obj.text - ); - } - } - } - debug(section_bookindex) { - key="bookindex"; - out_bookindex(contents, key); - } - debug(section_bookindex) { - key="bookindex"; - out_bookindex(contents, key); - } - debug(section_bookindex_scroll) { - key="bookindex_scroll"; - out_bookindex(contents, key); - } - debug(blurb_section) { - key="blurb"; - if (contents[key].length > 1) { - foreach (obj; contents[key]) { - writefln( - "[%s][%s]\n%s", - obj.object_number, - obj.metainfo.is_a, - obj.text - ); - } - } - } - debug(objects) { - writefln( - "> %s:%s", - __FILE__, - __LINE__, - ); - foreach (obj; contents[key]) { - if (obj.metainfo.is_of_part != "empty") { - writefln( - "* [%s][%s] %s", - obj.object_number, - obj.metainfo.is_a, - obj.text - ); - } - } - } - debug(headermakejson) { - writefln( - "%s\n%s\n%s", - "document header, metadata & make instructions:", - doc_matters.conf_make_meta.meta, - ptr_head_main, - ); - foreach (main_header; ptr_head_main) { - switch (main_header) { - case "make": - foreach (sub_header; ptr_head_sub_make) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - default: - break; - } - } - } - debug(headermetadatajson) { - writefln( - "%s\n%s\n%s", - "document header, metadata & make instructions:", - doc_matters.conf_make_meta.meta, - ptr_head_main, - ); - foreach (main_header; ptr_head_main) { - switch (main_header) { - case "creator": - foreach (sub_header; ptr_head_sub_creator) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full, - ); - } - } - break; - case "title": - foreach (sub_header; ptr_head_sub_title) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - case "rights": - foreach (sub_header; ptr_head_sub_rights) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - case "date": - foreach (sub_header; ptr_head_sub_date) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - case "original": - foreach (sub_header; ptr_head_sub_original) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - case "classify": - foreach (sub_header; ptr_head_sub_classify) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - case "identifier": - foreach (sub_header; ptr_head_sub_identifier) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - case "notes": - foreach (sub_header; ptr_head_sub_notes) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - case "publisher": - foreach (sub_header; ptr_head_sub_publisher) { - if (doc_matters.conf_make_meta.meta.title_full.to!string.length > 2) { - writefln( - "%s:%s: %s", - main_header, - sub_header, - doc_matters.conf_make_meta.meta.title_full - ); - } - } - break; - default: - break; - } - } - } - debug(anchor) { - writefln( - "> %s:%s", - __FILE__, - __LINE__, - ); - foreach (k; doc_matters.has.keys_seq.seg) { - foreach (obj; contents[k]) { - if (obj.metainfo.is_a == "heading") { - writefln( - "%s~ [%s] %s %s", - obj.marked_up_level, - obj.object_number, - obj.anchor_tags, - obj.text - ); - } - } - } - } - debug(heading) { // heading - foreach (k; doc_matters.has.keys_seq.seg) { - foreach (o; contents[k]) { - if (o.metainfo.is_a == "heading") { - writefln( - "%s* %s\n (markup level: %s; collapsed level: %s)", - replicate(" ", o.heading_lev_markup), - strip(o.text), - o.heading_lev_markup, - o.heading_lev_collapsed, - ); - } - } - } - } - debug(headings) { - writefln( - "> %s:%s", - __FILE__, - __LINE__, - ); - foreach (k; doc_matters.has.keys_seq.seg) { - foreach (obj; contents[k]) { - if (obj.metainfo.is_a == "heading") { - writefln( - "%s~ [%s] %s", - obj.marked_up_level, - obj.object_number, - obj.text - ); - } - } - } - } - debug(summary) { - string[string] check = [ - "last_object_number" : "NA [debug \"checkdoc\" not run]", - ]; - } debug(checkdoc) { if ((doc_matters.opt.action.debug_do)) { debug(checkdoc) { @@ -590,57 +247,6 @@ template spineDebugs() { } } } - debug(checkdoc) { - void out_toc(S)( - const S contents, - string key, - ) { - if (contents[key].length > 1) { - string indent_spaces; - foreach (obj; contents[key]) { - indent_spaces=markup.indent_by_spaces_provided(obj.indent_hang); - writefln( - "%s%s", - indent_spaces, - obj.text - ); - } - } - } - } - debug(checkdoc) { - void out_endnotes(S)( - const S contents, - string key, - ) { - if (contents[key].length > 1) { - foreach (obj; contents[key]) { - writefln( - "[%s]\n%s", - obj.metainfo.is_a, - obj.text - ); - } - } - } - } - debug(checkdoc) { - void out_bookindex(S)( - const S contents, - string key, - ) { - if (contents[key].length > 1) { - foreach (obj; contents[key]) { - writefln( - "[%s][%s]\n%s", - obj.object_number, - obj.metainfo.is_a, - obj.text - ); - } - } - } - } } } } |