aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/doc_reform.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/doc_reform.org')
-rw-r--r--org/doc_reform.org80
1 files changed, 53 insertions, 27 deletions
diff --git a/org/doc_reform.org b/org/doc_reform.org
index a04f650..f8dcc63 100644
--- a/org/doc_reform.org
+++ b/org/doc_reform.org
@@ -24,7 +24,7 @@ struct Version {
int minor;
int patch;
}
-enum ver = Version(0, 2, 1);
+enum ver = Version(0, 3, 0);
#+END_SRC
** compilation restrictions (supported compilers)
@@ -666,11 +666,15 @@ _make_and_meta_struct = configParseTOMLreturnDocReformStruct!()(_make_and_meta_s
#+NAME: doc_reform_do_selected
#+BEGIN_SRC d
if (!(_opt_action.skip_output)) {
- debug(steps) {
+ if ((_opt_action.debug_do)
+ || (_opt_action.very_verbose)
+ ) {
writeln("step0 commence → (without processing files)");
}
outputHubOp!()(_env, _opt_action);
- debug(steps) {
+ if ((_opt_action.debug_do)
+ || (_opt_action.very_verbose)
+ ) {
writeln("- step0 complete");
}
}
@@ -684,9 +688,8 @@ if (!(_opt_action.skip_output)) {
scope(success) {
if (!(_opt_action.quiet)) {
writefln(
- "%s\n%s",
- "~ document complete, ok ~",
- "------------------------------------------------------------------",
+ "%s",
+ "-- ~ document complete, ok ~ ------------------------------------",
);
}
}
@@ -715,7 +718,9 @@ enforce(
#+NAME: doc_reform_each_file_do_abstraction
#+BEGIN_SRC d
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("--->\nstepX commence → (document abstraction)");
}
auto t = DocReformAbstraction!()(_env, _opt_action, manifest);
@@ -723,7 +728,9 @@ static assert(!isTypeTuple!(t));
static assert(t.length==2);
auto doc_abstraction = t[dAM.abstraction];
auto doc_matters = t[dAM.matters];
-debug(steps) {
+if ((doc_matters.opt.action.debug_do)
+|| (doc_matters.opt.action.very_verbose)
+) {
writeln("- stepX complete");
}
#+END_SRC
@@ -745,9 +752,7 @@ if (doc_matters.opt.action.verbose) {
#+NAME: doc_reform_each_file_do_debugs_checkdoc
#+BEGIN_SRC d
/+ ↓ debugs +/
-if ((doc_matters.opt.action.debug_do)
-|| (doc_matters.opt.action.verbose)
-) {
+if (doc_matters.opt.action.debug_do) {
DocReformDebugs!()(doc_abstraction, doc_matters);
}
#+END_SRC
@@ -759,11 +764,15 @@ if ((doc_matters.opt.action.debug_do)
#+BEGIN_SRC d
/+ ↓ output hub +/
if (!(doc_matters.opt.action.skip_output)) {
- debug(steps) {
+ if ((_opt_action.debug_do)
+ || (_opt_action.very_verbose)
+ ) {
writeln("step5 commence → (process outputs)");
}
outputHub!()(doc_abstraction, doc_matters);
- debug(steps) {
+ if ((_opt_action.debug_do)
+ || (_opt_action.very_verbose)
+ ) {
writeln("- step5 complete");
}
}
@@ -776,8 +785,9 @@ if (!(doc_matters.opt.action.skip_output)) {
scope(exit) {
if (!(_opt_action.quiet)) {
writefln(
- "processed file: %s",
- manifest.src.filename
+ "processed file: %s (%s)",
+ manifest.src.filename,
+ manifest.src.language
);
}
destroy(manifest);
@@ -851,7 +861,9 @@ if build source pod requested all information needed to build it available at th
#+BEGIN_SRC d
/+ ↓ read file (filename with path) +/
/+ ↓ file tuple of header and content +/
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("step1 commence → (get document header & body & insert file list & if needed image list)"
);
}
@@ -859,7 +871,9 @@ auto _header_body_insertfilelist_imagelist
= DocReformRawMarkupContent!()(_opt_action, _manifest.src.path_and_fn);
static assert(!isTypeTuple!(_header_body_insertfilelist_imagelist));
static assert(_header_body_insertfilelist_imagelist.length==4);
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("- step1 complete");
}
debug(header_and_body) {
@@ -885,7 +899,9 @@ debug(header_and_body) {
#+NAME: doc_reform_each_file_do_split_sisu_markup_file_header_into_make_and_meta_structs
#+BEGIN_SRC d
/+ ↓ split header into make and meta +/
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("step2 commence → (read document header - toml, return struct)");
}
_make_and_meta_struct =
@@ -893,7 +909,9 @@ docHeaderMakeAndMetaTupTomlExtractAndConvertToStruct!()(
_make_and_meta_struct,
_header_body_insertfilelist_imagelist[headBody.header]
);
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("- step2 complete");
}
#+END_SRC
@@ -915,7 +933,9 @@ debug(steps) {
#+NAME: doc_reform_each_file_do_document_abstraction
#+BEGIN_SRC d
/+ ↓ document abstraction: process document, return abstraction as tuple +/
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("step3 commence → (document abstraction (da); da keys; segnames; doc_matters)");
}
auto da = DocReformDocAbstraction!()(
@@ -937,7 +957,9 @@ debug(segnames) {
}
auto _doc_tag_assoc = da[docAbst.tag_assoc];
auto _images = da[docAbst.images];
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("- step3 complete");
}
#+END_SRC
@@ -949,7 +971,9 @@ debug(steps) {
#+NAME: doc_reform_each_file_do_document_matters
#+BEGIN_SRC d
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("step4 commence → (doc_matters)");
}
struct DocumentMatters {
@@ -1030,7 +1054,9 @@ struct DocumentMatters {
}
}
auto doc_matters = DocumentMatters();
-debug(steps) {
+if ((_opt_action.debug_do)
+|| (_opt_action.very_verbose)
+) {
writeln("- step4 complete");
}
#+END_SRC
@@ -1103,7 +1129,7 @@ foreach (k; doc_matters.xml.keys_seq.seg) {
check["last_object_number"] = obj.metainfo.object_number;
}
}
- if (k == "bookindex_seg") {
+ if (k == "bookindex") {
if (obj.metainfo.object_number_type == 2) {
check["last_object_number_book_index"] = obj.metainfo.object_number_book_index;
}
@@ -1131,7 +1157,7 @@ writefln(
doc_matters.src.filename,
markup.repeat_character_by_number_provided("-", char_repeat_number),
"length toc arr:",
- to!int(doc_abstraction["toc_seg"].length),
+ to!int(doc_abstraction["toc"].length),
"length doc_abstraction arr:",
to!int(doc_abstraction["body"].length),
"last doc body ocn:",
@@ -1151,8 +1177,8 @@ writefln(
? (to!int(doc_abstraction["bibliography"].length))
: 0,
"length bookindex:",
- (doc_abstraction["bookindex_seg"].length > 1)
- ? (to!int(doc_abstraction["bookindex_seg"].length))
+ (doc_abstraction["bookindex"].length > 1)
+ ? (to!int(doc_abstraction["bookindex"].length))
: 0,
" last book idx ocn:",
to!int(check["last_object_number_book_index"]),