aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-07-31 10:25:29 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:15 -0400
commit9f5a72665fd94dcb082a9710c71e6a6a08386450 (patch)
tree7b5fbb382c6382b51cd6035e3f37744cb7eb9688
parentmeson build related (reggae removed for now) (diff)
messages & remove outputs not generated
-rw-r--r--makefile1
-rw-r--r--maker.org1
-rw-r--r--org/default_paths.org10
-rw-r--r--org/default_shared.org50
-rw-r--r--org/imports.org1
-rw-r--r--org/meta_abstraction.org234
-rw-r--r--org/meta_conf_make_meta.org49
-rw-r--r--org/meta_debugs.org14
-rw-r--r--org/output_hub.org155
-rw-r--r--org/output_sisupod.org6
-rw-r--r--org/output_sqlite.org24
-rw-r--r--org/output_xmls.org19
-rw-r--r--org/output_xmls_css.org5
-rw-r--r--org/sdp.org211
-rw-r--r--org/source_files_read.org1
-rw-r--r--src/sdp/meta/conf_make_meta_json.d49
-rw-r--r--src/sdp/meta/doc_debugs.d14
-rw-r--r--src/sdp/meta/metadoc.d2
-rw-r--r--src/sdp/meta/metadoc_from_src.d220
-rw-r--r--src/sdp/meta/object_setter.d14
-rw-r--r--src/sdp/output/epub3.d4
-rw-r--r--src/sdp/output/html.d13
-rw-r--r--src/sdp/output/hub.d130
-rw-r--r--src/sdp/output/package.d1
-rw-r--r--src/sdp/output/paths_output.d2
-rw-r--r--src/sdp/output/source_sisupod.d6
-rw-r--r--src/sdp/output/sqlite.d28
-rw-r--r--src/sdp/output/xmls.d2
-rwxr-xr-xsrc/sdp/sdp.d205
-rw-r--r--src/sdp/share/defaults.d22
-rw-r--r--src/sdp/source/paths_source.d8
-rw-r--r--src/sdp/source/read_config_files.d1
32 files changed, 658 insertions, 844 deletions
diff --git a/makefile b/makefile
index ee2ba43..0c60492 100644
--- a/makefile
+++ b/makefile
@@ -144,6 +144,7 @@ skel:
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/conf; \
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/meta; \
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/output; \
+ mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/share; \
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/source; \
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME); \
mkdir -p $(PRG_BINDIR);
diff --git a/maker.org b/maker.org
index 4ffc4ef..50214e4 100644
--- a/maker.org
+++ b/maker.org
@@ -332,6 +332,7 @@ skel:
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/conf; \
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/meta; \
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/output; \
+ mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/share; \
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME)/source; \
mkdir -p $(PRG_SRCDIR)/$(PRG_NAME); \
mkdir -p $(PRG_BINDIR);
diff --git a/org/default_paths.org b/org/default_paths.org
index 35dee32..a37b542 100644
--- a/org/default_paths.org
+++ b/org/default_paths.org
@@ -294,7 +294,7 @@ template PathMatters() {
}
string base_dir() {
string _dir;
- if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ if (
auto m = (absolute_path_to_src)
.match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
) {
@@ -312,7 +312,7 @@ template PathMatters() {
}
string base_parent_dir_path() {
string _dir;
- if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ if (
auto m = (absolute_path_to_src)
.match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
) {
@@ -329,7 +329,7 @@ template PathMatters() {
.match(rgx.src_formalised_file_path_parts)
) {
_dir = asNormalizedPath(m.captures["pth"]).array;
- } else if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ } else if (
auto m = (absolute_path_to_src)
.match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
) {
@@ -375,7 +375,7 @@ template PathMatters() {
}
auto base_parent_dir() {
string _dir;
- if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ if (
auto m = (absolute_path_to_src)
.match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
) {
@@ -1187,8 +1187,6 @@ template SiSUpathsSQLiteDiscrete() {
auto out_pth = SiSUoutPaths!()(output_pth_root, lng);
string base_dir = "sqlite";
return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array;
- // return asNormalizedPath((out_pth.output_root).chainPath(base_dir)).array; // single file for each file, multiple languages
- // return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array; // separate files for each language
}
string seg(string fn_src) {
return asNormalizedPath(base.chainPath(base_filename(fn_src))).array;
diff --git a/org/default_shared.org b/org/default_shared.org
new file mode 100644
index 0000000..113b98b
--- /dev/null
+++ b/org/default_shared.org
@@ -0,0 +1,50 @@
+#+TITLE: sdp shared
+#+AUTHOR: Ralph Amissah
+#+EMAIL: [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]]
+#+DESCRIPTION: documents - structuring, publishing in multiple formats & search
+#+KEYWORDS
+#+LANGUAGE: en
+#+STARTUP: indent content
+#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t
+#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
+#+OPTIONS: author:nil email:nil creator:nil timestamp:nil
+#+PROPERTY: header-args :padline no :exports code :noweb yes
+#+EXPORT_SELECT_TAGS: export
+#+EXPORT_EXCLUDE_TAGS: noexport
+#+FILETAGS: :sdp:rel:meta:
+#+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n)
+
+[[./sdp.org][sdp]] [[./][org/]]
+* 0. shared :module:sdp:shared:
+** 0. module template
+
+#+BEGIN_SRC d :tangle ../src/sdp/share/defaults.d
+/++
+ shared default settings
++/
+module sdp.share.defaults;
+<<shared_messages>>
+#+END_SRC
+
+** template: messages :messages:
+#+name: shared_messages
+#+BEGIN_SRC d
+template Msg() {
+ import std.stdio;
+ auto Msg(I)(I doc_matters) {
+ struct Msg_ {
+ void v()(string message) {
+ if (!(doc_matters.opt.action.quiet) && doc_matters.opt.action.verbose) {
+ writeln(message);
+ }
+ }
+ void vv()(string message) {
+ if (!(doc_matters.opt.action.quiet) && doc_matters.opt.action.very_verbose) {
+ writeln(message);
+ }
+ }
+ }
+ return Msg_();
+ }
+}
+#+END_SRC
diff --git a/org/imports.org b/org/imports.org
index d82da9e..c9265cc 100644
--- a/org/imports.org
+++ b/org/imports.org
@@ -73,6 +73,7 @@ public import
// std.uni,
std.utf;
public import
+ sdp.share.defaults,
sdp.source.paths_source,
sdp.output.defaults,
sdp.output.paths_output,
diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org
index 010f8b5..18bf8d6 100644
--- a/org/meta_abstraction.org
+++ b/org/meta_abstraction.org
@@ -82,7 +82,7 @@ template SiSUdocAbstraction() {
} // close else for not the above
} // close after non code, other blocks or regular text
<<abs_in_loop_body_01>>
- } /+ ← closed: loop markup document/text line by line +/
+ } /+ ← srcDocLoop closed: loop markup document/text line by line +/
/+ ↓ post loop markup document/text +/
<<abs_post>>
<<abs_post_doc_reloop_processing>>
@@ -587,11 +587,11 @@ line = (line).replaceAll(rgx.true_dollar, "$$$$");
/+ dollar represented as $$ needed to stop submatching on $
(substitutions using ${identifiers} must take into account (i.e. happen earlier))
+/
-debug(source) { // source lines
+debug(source) {
writeln(line);
}
debug(srclines) {
- if (!line.empty) { // source lines, not empty
+ if (!line.empty) {
writefln(
"* %s",
line
@@ -765,18 +765,18 @@ if there is a blurb section you need to:
];
bullet = false;
if (auto m = line.matchFirst(rgx.para_indent)) {
- debug(paraindent) { // para indent
+ debug(paraindent) {
writeln(line);
}
indent["hang_position"] = (m.captures[1]).to!int;
indent["base_position"] = 0;
} else if (line.matchFirst(rgx.para_bullet)) {
- debug(parabullet) { // para bullet
+ debug(parabullet) {
writeln(line);
}
bullet = true;
} else if (auto m = line.matchFirst(rgx.para_indent_hang)) {
- debug(paraindenthang) { // para indent hang
+ debug(paraindenthang) {
writeln(line);
}
indent=[
@@ -784,7 +784,7 @@ if there is a blurb section you need to:
"base_position" : (m.captures[2]).to!int,
];
} else if (auto m = line.matchFirst(rgx.para_bullet_indent)) {
- debug(parabulletindent) { // para bullet indent
+ debug(parabulletindent) {
writeln(line);
}
indent=[
@@ -1152,7 +1152,7 @@ if ((obj_type_status["heading"] == State.on)
/+ heading object (current line empty) +/
obj_cite_digits = (an_object["lev_markup_number"].to!int == 0)
? ocn_emit(OCNstatus.reset)
- : ocn_emit(OCNstatus.on); // : ocn_emit(obj_type_status["ocn_status"]);
+ : ocn_emit(OCNstatus.on);
an_object["is"] = "heading";
an_object_key="body_nugget";
auto substantive_object_and_anchor_tags_tuple
@@ -1405,8 +1405,6 @@ if (an_object["glossary_nugget"].length == 0) {
comp_obj_heading_.metainfo.parent_ocn = 1;
comp_obj_heading_.metainfo.parent_lev_markup = 0;
the_glossary_section ~= comp_obj_heading_;
-} else {
- writeln("gloss");
}
debug(glossary) {
foreach (gloss; the_glossary_section) {
@@ -1652,7 +1650,7 @@ if (the_glossary_section.length > 1) {
toc_txt_ = format(
"{ %s }#%s",
"Glossary",
- "glossary", // _anchor_tag
+ "glossary",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = toc_txt_.to!string.strip;
@@ -1675,7 +1673,7 @@ if (the_bibliography_section.length > 1){
toc_txt_ = format(
"{ %s }#%s",
"Bibliography",
- "bibliography", // _anchor_tag
+ "bibliography",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = toc_txt_.to!string.strip;
@@ -1699,7 +1697,7 @@ if (the_bookindex_section["scroll"].length > 1) {
toc_txt_ = format(
"{ %s }#%s",
"Book Index",
- "bookindex", // _anchor_tag
+ "bookindex",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = toc_txt_.to!string.strip;
@@ -1721,7 +1719,7 @@ if (the_blurb_section.length > 1) {
toc_txt_ = format(
"{ %s }#%s",
"Blurb",
- "blurb", // _anchor_tag
+ "blurb",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.has.inline_links = true;
@@ -2142,7 +2140,7 @@ auto get_decendants(S)(S document_sections) {
string[] _ocn_open_key = ["","","","","","","",""];
auto _doc_sect_length = document_sections.length - 1;
int _last_ocn;
- foreach (_lg, ref obj; document_sections) { // TODO the_document_body_section
+ foreach (_lg, ref obj; document_sections) {
if (obj.metainfo.is_a == "heading") {
foreach (_dts_lv, dom_tag_status; obj.metainfo.dom_structure_markedup_tags_status) {
switch (dom_tag_status) {
@@ -2181,7 +2179,6 @@ auto get_decendants(S)(S document_sections) {
Tuple!(int, int)[] pairs;
foreach (pair; _heading_ocn_decendants.byPair) {
pairs ~= tuple(pair[0].to!int, pair[1]);
- // pairs ~= tuple(pair.key.to!int, pair.value);
}
return pairs.sort;
}
@@ -2269,8 +2266,7 @@ foreach (ref obj; the_document_head_section) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2304,8 +2300,7 @@ if (the_table_of_contents_section["scroll"].length > 1) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2371,8 +2366,7 @@ if (the_document_body_section.length > 1) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2423,8 +2417,7 @@ if (the_endnotes_section.length > 1) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2467,8 +2460,7 @@ if (the_glossary_section.length > 1) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2514,8 +2506,7 @@ if (the_bibliography_section.length > 1) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2566,8 +2557,7 @@ if (the_bookindex_section["scroll"].length > 1) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2606,8 +2596,7 @@ if (the_bookindex_section["scroll"].length > 1) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2656,8 +2645,7 @@ if (the_blurb_section.length > 1) {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -3135,7 +3123,7 @@ void _start_block_(L,T,N)(
debug(asserts) {
static assert(is(typeof(line) == char[]));
static assert(is(typeof(obj_type_status) == int[string]));
- static assert(is(typeof(object_number_poem) == string[string]));
+ static assert(is(typeof(object_number_poem) == string[string]));
}
#+END_SRC
@@ -3646,7 +3634,7 @@ void _group_block_(L,O,T)(
obj_type_status["group"] = TriState.closing;
obj_type_status["tic_group"] = TriState.off;
} else {
- debug(group) { // group
+ debug(group) {
writeln(line);
}
an_object[an_object_key] ~= line ~= "\n"; // build group array (or string)
@@ -3727,7 +3715,7 @@ void _poem_block_(L,O,T,C,N,CMM)(
static assert(is(typeof(an_object) == string[string]));
static assert(is(typeof(obj_type_status) == int[string]));
static assert(is(typeof(cntr) == int));
- static assert(is(typeof(object_number_poem) == string[string]));
+ static assert(is(typeof(object_number_poem) == string[string]));
}
static auto rgx = Rgx();
if (obj_type_status["curly_poem"] == TriState.on) {
@@ -3735,7 +3723,7 @@ void _poem_block_(L,O,T,C,N,CMM)(
if (an_object_key in an_object
|| processing.length > 0) {
an_object[an_object_key] = "";
- debug(poem) { // poem (curly) close
+ debug(poem) {
writefln(
"* [poem curly] %s",
line
@@ -3744,7 +3732,7 @@ void _poem_block_(L,O,T,C,N,CMM)(
if (processing.length > 0) {
an_object[an_object_key] = processing["verse"];
}
- debug(poem) { // poem (curly) close
+ debug(poem) {
writeln(__LINE__);
writefln(
"* %s %s",
@@ -3843,7 +3831,7 @@ void _poem_block_(L,O,T,C,N,CMM)(
} else if (obj_type_status["tic_poem"] == TriState.on) {
if (auto m = line.matchFirst(rgx.block_tic_close)) { // tic_poem_close
an_object[an_object_key]="verse";
- debug(poem) { // poem (curly) close
+ debug(poem) {
writefln(
"* [poem tic] %s",
line
@@ -4413,7 +4401,7 @@ auto _book_index_(L,I,O,T,B)(
static auto rgx = Rgx();
if (auto m = line.match(rgx.book_index)) {
/+ match book_index +/
- debug(bookindexmatch) { // book index
+ debug(bookindexmatch) {
writefln(
"* [bookindex] %s\n",
m.captures[1].to!string,
@@ -4425,7 +4413,7 @@ auto _book_index_(L,I,O,T,B)(
obj_type_status["book_index"] = State.on;
if (opt_action.backmatter && opt_action.section_bookindex) {
book_idx_tmp = m.captures[1].to!string;
- debug(bookindexmatch) { // book index
+ debug(bookindexmatch) {
writefln(
"* [bookindex] %s\n",
book_idx_tmp,
@@ -4439,7 +4427,7 @@ auto _book_index_(L,I,O,T,B)(
if (opt_action.backmatter
&& opt_action.section_bookindex) {
an_object["bookindex_nugget"] = book_idx_tmp ~ m.captures[1].to!string;
- debug(bookindexmatch) { // book index
+ debug(bookindexmatch) {
writefln(
"* [bookindex] %s\n",
book_idx_tmp,
@@ -4470,11 +4458,11 @@ auto _heading_found_(L,X,H,R,T)(
return ref T obj_type_status
) {
debug(asserts) {
- static assert(is(typeof(line) == char[]));
- static assert(is(typeof(_make_unmarked_headings) == string[]));
- static assert(is(typeof(heading_match_str) == string[string]));
- static assert(is(typeof(heading_match_rgx) == Regex!(char)[string]));
- static assert(is(typeof(obj_type_status) == int[string]));
+ static assert(is(typeof(line) == char[]));
+ static assert(is(typeof(_make_unmarked_headings) == string[]));
+ static assert(is(typeof(heading_match_str) == string[string]));
+ static assert(is(typeof(heading_match_rgx) == Regex!(char)[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
if ((_make_unmarked_headings.length > 2)
@@ -4774,7 +4762,7 @@ auto _heading_matched_(L,C,O,K,Lv,Lc,T,CMM)(
default:
an_object["lev_markup_number"] = lv["lv"].to!string;
}
- debug(heading) { // heading
+ debug(heading) {
writeln(line.strip);
}
}
@@ -4801,32 +4789,32 @@ void _para_match_(L,O,K,I,B,T,C)(
static assert(is(typeof(indent) == int[string]));
static assert(is(typeof(bullet) == bool));
static assert(is(typeof(obj_type_status) == int[string]));
- static assert(is(typeof(line_occur) == int[string]));
+ static assert(is(typeof(line_occur) == int[string]));
}
static auto rgx = Rgx();
if (line_occur["para"] == State.off) {
line = font_faces_line(line);
/+ para matches +/
obj_type_status["para"] = State.on;
- an_object[an_object_key] ~= line; // body_nugget
+ an_object[an_object_key] ~= line;
indent=[
"hang_position" : 0,
"base_position" : 0,
];
bullet = false;
if (auto m = line.matchFirst(rgx.para_indent)) {
- debug(paraindent) { // para indent
+ debug(paraindent) {
writeln(line);
}
indent["hang_position"] = (m.captures[1]).to!int;
indent["base_position"] = 0;
} else if (line.matchFirst(rgx.para_bullet)) {
- debug(parabullet) { // para bullet
+ debug(parabullet) {
writeln(line);
}
bullet = true;
} else if (auto m = line.matchFirst(rgx.para_indent_hang)) {
- debug(paraindenthang) { // para indent hang
+ debug(paraindenthang) {
writeln(line);
}
indent=[
@@ -4834,7 +4822,7 @@ void _para_match_(L,O,K,I,B,T,C)(
"base_position" : (m.captures[2]).to!int,
];
} else if (auto m = line.matchFirst(rgx.para_bullet_indent)) {
- debug(parabulletindent) { // para bullet indent
+ debug(parabulletindent) {
writeln(line);
}
indent=[
@@ -5833,16 +5821,16 @@ static struct ObjInlineMarkup {
comp_obj_toc.has.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
- comp_obj_toc = comp_obj_toc.init;
- comp_obj_toc.metainfo.is_of_part = "frontmatter";
- comp_obj_toc.metainfo.is_of_section = "toc";
- comp_obj_toc.metainfo.is_of_type = "para";
- comp_obj_toc.metainfo.is_a = "toc";
- comp_obj_toc.metainfo.ocn = 0;
- comp_obj_toc.metainfo.object_number_off = "";
- comp_obj_toc.metainfo.object_number_type = 0;
- comp_obj_toc.attrib.bullet = false;
- comp_obj_toc.has.inline_links = true;
+ comp_obj_toc = comp_obj_toc.init;
+ comp_obj_toc.metainfo.is_of_part = "frontmatter";
+ comp_obj_toc.metainfo.is_of_section = "toc";
+ comp_obj_toc.metainfo.is_of_type = "para";
+ comp_obj_toc.metainfo.is_a = "toc";
+ comp_obj_toc.metainfo.ocn = 0;
+ comp_obj_toc.metainfo.object_number_off = "";
+ comp_obj_toc.metainfo.object_number_type = 0;
+ comp_obj_toc.attrib.bullet = false;
+ comp_obj_toc.has.inline_links = true;
switch (obj_["lev_markup_number"].to!int) {
case 0:
indent=[
@@ -5851,11 +5839,11 @@ static struct ObjInlineMarkup {
];
toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "toc.fnSuffix";
toc_txt_= munge.url_links(toc_txt_);
- comp_obj_toc.attrib.indent_hang = indent["hang_position"];
- comp_obj_toc.attrib.indent_base = indent["base_position"];
- comp_obj_toc.text = toc_txt_.to!string.strip;
- comp_obj_toc.has.inline_links = true;
- the_table_of_contents_section["seg"] ~= comp_obj_toc;
+ comp_obj_toc.attrib.indent_hang = indent["hang_position"];
+ comp_obj_toc.attrib.indent_base = indent["base_position"];
+ comp_obj_toc.text = toc_txt_.to!string.strip;
+ comp_obj_toc.has.inline_links = true;
+ the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 1: .. case 3:
indent=[
@@ -5867,11 +5855,11 @@ static struct ObjInlineMarkup {
heading_toc_,
);
toc_txt_= munge.url_links(toc_txt_);
- comp_obj_toc.attrib.indent_hang = indent["hang_position"];
- comp_obj_toc.attrib.indent_base = indent["base_position"];
- comp_obj_toc.text = toc_txt_.to!string.strip;
- comp_obj_toc.has.inline_links = true;
- the_table_of_contents_section["seg"] ~= comp_obj_toc;
+ comp_obj_toc.attrib.indent_hang = indent["hang_position"];
+ comp_obj_toc.attrib.indent_base = indent["base_position"];
+ comp_obj_toc.text = toc_txt_.to!string.strip;
+ comp_obj_toc.has.inline_links = true;
+ the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 4:
toc_txt_ = format(
@@ -5887,11 +5875,11 @@ static struct ObjInlineMarkup {
"hang_position" : obj_["lev_markup_number"].to!int,
"base_position" : obj_["lev_markup_number"].to!int,
];
- comp_obj_toc.attrib.indent_hang = indent["hang_position"];
- comp_obj_toc.attrib.indent_base = indent["base_position"];
- comp_obj_toc.text = toc_txt_.to!string.strip;
- comp_obj_toc.has.inline_links = true;
- the_table_of_contents_section["seg"] ~= comp_obj_toc;
+ comp_obj_toc.attrib.indent_hang = indent["hang_position"];
+ comp_obj_toc.attrib.indent_base = indent["base_position"];
+ comp_obj_toc.text = toc_txt_.to!string.strip;
+ comp_obj_toc.has.inline_links = true;
+ the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 5: .. case 7:
toc_txt_ = format(
@@ -5916,11 +5904,11 @@ static struct ObjInlineMarkup {
"hang_position" : obj_["lev_markup_number"].to!int,
"base_position" : obj_["lev_markup_number"].to!int,
];
- comp_obj_toc.attrib.indent_hang = indent["hang_position"];
- comp_obj_toc.attrib.indent_base = indent["base_position"];
- comp_obj_toc.text = toc_txt_.to!string.strip;
- comp_obj_toc.has.inline_links = true;
- the_table_of_contents_section["seg"] ~= comp_obj_toc;
+ comp_obj_toc.attrib.indent_hang = indent["hang_position"];
+ comp_obj_toc.attrib.indent_base = indent["base_position"];
+ comp_obj_toc.text = toc_txt_.to!string.strip;
+ comp_obj_toc.has.inline_links = true;
+ the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
default:
break;
@@ -6464,15 +6452,15 @@ struct ObjAttributes {
(oa_j.type == JSON_TYPE.OBJECT)
);
if (obj_is_ == "heading") {
- oa_j.object["object_number"] = _comp_obj_heading.metainfo.ocn;
- oa_j.object["lev_markup_number"] = _comp_obj_heading.metainfo.heading_lev_markup;
- oa_j.object["lev_collapsed_number"] = _comp_obj_heading.metainfo.heading_lev_collapsed;
+ oa_j.object["object_number"] = _comp_obj_heading.metainfo.ocn;
+ oa_j.object["lev_markup_number"] = _comp_obj_heading.metainfo.heading_lev_markup;
+ oa_j.object["lev_collapsed_number"] = _comp_obj_heading.metainfo.heading_lev_collapsed;
oa_j.object["heading_ptr"]
= _comp_obj_heading.ptr.heading;
oa_j.object["doc_object_ptr"]
= _comp_obj_heading.ptr.doc_object;
}
- oa_j.object["parent_object_number"] = _comp_obj_heading.metainfo.parent_ocn;
+ oa_j.object["parent_object_number"] = _comp_obj_heading.metainfo.parent_ocn;
oa_j.object["parent_lev_markup_number"] = _comp_obj_heading.metainfo.parent_lev_markup;
_obj_attrib = oa_j.toString();
return _obj_attrib;
@@ -6505,7 +6493,7 @@ struct BookIndexNuggetHash {
)
in {
debug(asserts) {
- static assert(is(typeof(bookindex_section) == string));
+ static assert(is(typeof(bookindex_section) == string));
static assert(is(typeof(obj_cite_digits.on) == int));
}
debug(bookindexraw) {
@@ -6778,25 +6766,25 @@ struct BookIndexReportSection {
bi_tmp_seg ~= " \\\\\n ";
++skn;
}
- bi_tmp_scroll = (bi_tmp_scroll).replaceFirst(rgx.trailing_linebreak, "");
- bi_tmp_seg = (bi_tmp_seg).replaceFirst(rgx.trailing_linebreak, "");
- comp_obj_para = comp_obj_para.init;
- comp_obj_para.metainfo.is_of_part = "backmatter";
- comp_obj_para.metainfo.is_of_section = "bookindex";
- comp_obj_para.metainfo.is_of_type = "para";
- comp_obj_para.metainfo.is_a = "bookindex";
- comp_obj_para.text = bi_tmp_scroll.to!string.strip;
- comp_obj_para.metainfo.ocn = 0;
- comp_obj_para.metainfo.object_number_off = "";
- comp_obj_para.metainfo.object_number_type = 0;
- comp_obj_para.tags.anchor_tags = bi_tmp_tags;
- comp_obj_para.attrib.indent_hang = 0;
- comp_obj_para.attrib.indent_base = 1;
- comp_obj_para.attrib.bullet = false;
- comp_obj_para.has.inline_links = true;
- bookindex_section["scroll"] ~= comp_obj_para;
- comp_obj_para.text = bi_tmp_seg.to!string.strip;
- bookindex_section["seg"] ~= comp_obj_para;
+ bi_tmp_scroll = (bi_tmp_scroll).replaceFirst(rgx.trailing_linebreak, "");
+ bi_tmp_seg = (bi_tmp_seg).replaceFirst(rgx.trailing_linebreak, "");
+ comp_obj_para = comp_obj_para.init;
+ comp_obj_para.metainfo.is_of_part = "backmatter";
+ comp_obj_para.metainfo.is_of_section = "bookindex";
+ comp_obj_para.metainfo.is_of_type = "para";
+ comp_obj_para.metainfo.is_a = "bookindex";
+ comp_obj_para.text = bi_tmp_scroll.to!string.strip;
+ comp_obj_para.metainfo.ocn = 0;
+ comp_obj_para.metainfo.object_number_off = "";
+ comp_obj_para.metainfo.object_number_type = 0;
+ comp_obj_para.tags.anchor_tags = bi_tmp_tags;
+ comp_obj_para.attrib.indent_hang = 0;
+ comp_obj_para.attrib.indent_base = 1;
+ comp_obj_para.attrib.bullet = false;
+ comp_obj_para.has.inline_links = true;
+ bookindex_section["scroll"] ~= comp_obj_para;
+ comp_obj_para.text = bi_tmp_seg.to!string.strip;
+ bookindex_section["seg"] ~= comp_obj_para;
++mkn;
}
} else { // no book index, (figure out what to do here)
@@ -6846,11 +6834,11 @@ struct NotesSection {
)
in {
assert((contents_am[cntr].metainfo.is_a == "para")
- || (contents_am[cntr].metainfo.is_a == "heading")
- || (contents_am[cntr].metainfo.is_a == "quote")
- || (contents_am[cntr].metainfo.is_a == "group")
- || (contents_am[cntr].metainfo.is_a == "block")
- || (contents_am[cntr].metainfo.is_a == "verse"));
+ || (contents_am[cntr].metainfo.is_a == "heading")
+ || (contents_am[cntr].metainfo.is_a == "quote")
+ || (contents_am[cntr].metainfo.is_a == "group")
+ || (contents_am[cntr].metainfo.is_a == "block")
+ || (contents_am[cntr].metainfo.is_a == "verse"));
assert(cntr >= previous_count);
assert(
(contents_am[cntr].text).match(
@@ -6876,7 +6864,7 @@ struct NotesSection {
".fnSuffix#noteref_\n ", m.captures[1], " ",
m.captures[2]); // sometimes need segment name (segmented html & epub)
}
- // TODO NEXT you need anchor for segments at this point ->
+ // you need anchor for segments at this point ->
object_notes["anchor"] ~= "note_" ~ m.captures[1] ~ "』";
object_notes["notes"] ~= (segment_anchor_tag_that_object_belongs_to.empty)
? (munge.url_links(
@@ -7195,7 +7183,7 @@ struct NodeStructureMetadata {
assert(obj_cite_digits.on.to!int >= 0);
}
body {
- assert(is_ != "heading"); // should not be necessary
+ assert(is_ != "heading"); // should not be necessary
assert(obj_cite_digits.on.to!int >= 0); // should not be necessary
if (lv7 > State.off) {
p_["lev_markup_number"] = DocStructMarkupHeading.h_text_4;
@@ -7718,7 +7706,7 @@ struct HeadingAttrib {
#+name: meta_structs_init
#+BEGIN_SRC d
-struct DocObj_MetaInfo_ { // metainfo
+struct DocObj_MetaInfo_ {
string is_of_part = ""; // frontmatter, body, backmatter
string is_of_section = ""; // toc, body, glossary, biography, book index, blurb
string is_of_type = ""; // para, block ?
@@ -7785,9 +7773,9 @@ struct DocObj_MetaInfo_ { // metainfo
int[] dom_structure_collapsed_tags_status = [ 0, 0, 0, 0, 0, 0, 0, 0,];
int parent_lev_markup = 0;
int parent_ocn = 0;
- int last_decendant_ocn = 0; // DONE
+ int last_decendant_ocn = 0;
}
-struct DocObj_TxtAttrib_ { // attrib
+struct DocObj_TxtAttrib_ {
int indent_base = 0;
int indent_hang = 0;
bool bullet = false;
@@ -7799,22 +7787,22 @@ struct DocObj_Has_ { // has
bool inline_notes_star = false;
bool contains_image_without_dimensions = false;
}
-struct DocObj_Table_ { // table
+struct DocObj_Table_ {
int number_of_columns = 0;
double[] column_widths = [];
string[] column_aligns = [];
bool heading = false;
bool walls = false; // not implemented
}
-struct DocObj_CodeBlock_ { // code_block
+struct DocObj_CodeBlock_ {
string syntax = "";
}
-struct DocObj_Pointer_ { // ptr
+struct DocObj_Pointer_ {
int doc_object = 0;
int html_segnames = 0;
int heading = 0;
}
-struct DocObj_Tags_ { // tags
+struct DocObj_Tags_ {
string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ]; // TODO redundant? see markedup and collapsed ancestors DONE
string segment_anchor_tag = "";
string segname_prev = "";
diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org
index cb8200e..22d07d8 100644
--- a/org/meta_conf_make_meta.org
+++ b/org/meta_conf_make_meta.org
@@ -625,21 +625,21 @@ if ("make" in _json.object) {
) {
_struct_composite.make_str.texpdf_font = _json.object["make"]["texpdf_font"].str;
}
- _struct_composite.make.bold = _mk.bold(_struct_composite.make_str.bold);
- _struct_composite.make.breaks = _mk.breaks(_struct_composite.make_str.breaks);
- _struct_composite.make.cover_image = _mk.cover_image(_struct_composite.make_str.cover_image);
- _struct_composite.make.css = _mk.css(_struct_composite.make_str.css);
- _struct_composite.make.emphasis = _mk.emphasis(_struct_composite.make_str.emphasis);
- _struct_composite.make.footer = _mk.footer(_struct_composite.make_str.footer);
- _struct_composite.make.headings = _mk.headings(_struct_composite.make_str.headings);
- _struct_composite.make.home_button_image = _mk.home_button_image(_struct_composite.make_str.home_button_image);
- _struct_composite.make.home_button_text = _mk.home_button_text(_struct_composite.make_str.home_button_text);
- _struct_composite.make.italics = _mk.italics(_struct_composite.make_str.italics);
- _struct_composite.make.auto_num_top_at_level = _mk.auto_num_top_at_level(_struct_composite.make_str.auto_num_top_at_level);
- _struct_composite.make.auto_num_top_lv = _mk.auto_num_top_lv(_struct_composite.make_str.auto_num_top_lv);
- _struct_composite.make.auto_num_depth = _mk.auto_num_depth(_struct_composite.make_str.auto_num_depth);
- _struct_composite.make.substitute = _mk.substitute(_struct_composite.make_str.substitute);
- _struct_composite.make.texpdf_font = _mk.texpdf_font(_struct_composite.make_str.texpdf_font);
+ _struct_composite.make.bold = _mk.bold(_struct_composite.make_str.bold);
+ _struct_composite.make.breaks = _mk.breaks(_struct_composite.make_str.breaks);
+ _struct_composite.make.cover_image = _mk.cover_image(_struct_composite.make_str.cover_image);
+ _struct_composite.make.css = _mk.css(_struct_composite.make_str.css);
+ _struct_composite.make.emphasis = _mk.emphasis(_struct_composite.make_str.emphasis);
+ _struct_composite.make.footer = _mk.footer(_struct_composite.make_str.footer);
+ _struct_composite.make.headings = _mk.headings(_struct_composite.make_str.headings);
+ _struct_composite.make.home_button_image = _mk.home_button_image(_struct_composite.make_str.home_button_image);
+ _struct_composite.make.home_button_text = _mk.home_button_text(_struct_composite.make_str.home_button_text);
+ _struct_composite.make.italics = _mk.italics(_struct_composite.make_str.italics);
+ _struct_composite.make.auto_num_top_at_level = _mk.auto_num_top_at_level(_struct_composite.make_str.auto_num_top_at_level);
+ _struct_composite.make.auto_num_top_lv = _mk.auto_num_top_lv(_struct_composite.make_str.auto_num_top_lv);
+ _struct_composite.make.auto_num_depth = _mk.auto_num_depth(_struct_composite.make_str.auto_num_depth);
+ _struct_composite.make.substitute = _mk.substitute(_struct_composite.make_str.substitute);
+ _struct_composite.make.texpdf_font = _mk.texpdf_font(_struct_composite.make_str.texpdf_font);
}
#+END_SRC
@@ -695,7 +695,7 @@ if ("webserv" in _json.object) {
_struct_composite.conf.webserv_cgi_file_links = _json.object["webserv"]["cgi_file_links"].str;
}
}
-if ("processing" in _json.object) { // TODO check & match logic with sdlang
+if ("processing" in _json.object) {
if ("path" in _json.object["processing"]
&& (_json.object["processing"]["path"].type().to!string == "STRING")
) {
@@ -884,11 +884,7 @@ if ("date" in _json.object) {
_struct_composite.meta.date_valid = _json.object["date"]["valid"].str;
}
}
-if ("links" in _json.object) {
- // if ("" in _json.object["links"]) {
- // _struct_composite.meta.links_ = _json.object["links"][""].str;
- // }
-}
+if ("links" in _json.object) {}
if ("notes" in _json.object) {
if ("abstract" in _json.object["notes"]
&& (_json.object["notes"]["abstract"].type().to!string == "STRING")
@@ -923,11 +919,7 @@ if ("original" in _json.object) {
_struct_composite.meta.original_title = _json.object["original"]["title"].str;
}
}
-if ("publisher" in _json.object) {
- // if ("" in _json.object["publisher"]) {
- // _struct_composite.meta.publisher = _json.object["publisher"][""].str;
- // }
-}
+if ("publisher" in _json.object) {}
if ("rights" in _json.object) {
if ("copyright" in _json.object["rights"]
&& (_json.object["rights"]["copyright"].type().to!string == "STRING")
@@ -998,7 +990,6 @@ if (_struct_composite.meta.creator_author.empty) {
_struct_composite.meta.creator_translator = _json.object["creator"]["translator"].str;
}
}
- // dochead_meta["creator"]["author_raw"] = dochead_meta["creator"]["author"];
string[] authors_arr;
auto authors_raw_arr = _struct_composite.meta.creator_author.split(_rgx.arr_delimiter);
foreach (author_raw; authors_raw_arr) {
@@ -1018,9 +1009,7 @@ if (_struct_composite.meta.title_main.empty) {
}
if ("full" in _json.object["title"]
&& (_json.object["title"]["full"].type().to!string == "STRING")
- ) {
- // _struct_composite.meta.title_full = _json.object["title"]["full"].str;
- }
+ ) {}
if ("language" in _json.object["title"]
&& (_json.object["title"]["language"].type().to!string == "STRING")
) {
diff --git a/org/meta_debugs.org b/org/meta_debugs.org
index 1807ec8..1d5bb14 100644
--- a/org/meta_debugs.org
+++ b/org/meta_debugs.org
@@ -115,18 +115,6 @@ debug(dumpdoc) {
__FILE__,
__LINE__,
);
- // if (key.length > 0) {
- // foreach (obj; contents[key]) {
- // if (obj.metainfo.is_of_part != "empty") {
- // writefln(
- // "[%s][%s]\n%s",
- // obj.object_number,
- // obj.metainfo.is_a,
- // obj.text
- // );
- // }
- // }
- // }
}
#+END_SRC
@@ -687,7 +675,6 @@ debug(anchor) {
obj.marked_up_level,
obj.object_number,
obj.anchor_tags,
- // "[", obj["is"], "] ",
obj.text
);
}
@@ -734,7 +721,6 @@ debug(headings) {
"%s~ [%s] %s",
obj.marked_up_level,
obj.object_number,
- // "[", obj["is"], "] ",
obj.text
);
}
diff --git a/org/output_hub.org b/org/output_hub.org
index 2f905e1..89be2ca 100644
--- a/org/output_hub.org
+++ b/org/output_hub.org
@@ -29,36 +29,9 @@ template outputHub() {
<<output_imports>>
void outputHub(D,I)(D doc_abstraction, I doc_matters) {
mixin SiSUoutputRgxInit;
+ mixin Msg;
+ auto msg = Msg!()(doc_matters);
static auto rgx = Rgx();
- debug (substitutions) {
- enum Substitute { match, markup, html, }
- writeln(__LINE__, ":", __FILE__, ": DEBUG substitutions:");
- writeln("Doc Title: ", doc_matters.conf_make_meta.meta.title_full);
- if (doc_matters.conf_make_meta.make.bold) {
- writeln("regex to match: ", doc_matters.conf_make_meta.make.bold[Substitute.match]);
- writeln("substitution to make: ", doc_matters.conf_make_meta.make.bold[Substitute.html]);
-
- auto _w = "1. Debian test string. Debian again. (the problem) do not use initialized only not repopulated"
- .replaceAll(
- regex(doc_matters.conf_make_meta.make.bold[Substitute.match]),
- doc_matters.conf_make_meta.make.bold[Substitute.html]
- );
- writeln(_w);
-
- writeln("2a. Debian test string. Debian again. (the problem) do not use initialized only not repopulated"
- .replaceAll(
- regex(doc_matters.conf_make_meta.make.bold[Substitute.match]),
- doc_matters.conf_make_meta.make.bold[Substitute.html]
- ));
-
- auto _v = regex(doc_matters.conf_make_meta.make.bold[Substitute.match]);
- writeln("2b. Debian test string. Debian again. (the problem) do not use initialized only not repopulated"
- .replaceAll(
- _v,
- doc_matters.conf_make_meta.make.bold[Substitute.html]
- ));
- }
- }
<<output_options>>
}
}
@@ -103,37 +76,18 @@ if (doc_matters.opt.action.verbose) {
#+BEGIN_SRC d
if ((doc_matters.opt.action.source)
|| (doc_matters.opt.action.sisupod)) {
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.source)) {
- writeln("sisu source processing... ");
+ if (doc_matters.opt.action.source) {
+ msg.v("sisu source processing...");
}
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.sisupod)) {
- writeln("sisupod source processing... ");
+ if (doc_matters.opt.action.sisupod) {
+ msg.v("sisupod source processing...");
}
SiSUpod!()(doc_matters);
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)
- && (doc_matters.opt.action.source)) {
- writeln("sisu source done");
+ if (doc_matters.opt.action.source) {
+ msg.vv("sisu source done");
}
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)
- && (doc_matters.opt.action.sisupod)) {
- writeln("sisupod done");
- }
-}
-#+END_SRC
-
-*** text
-[[./output_text.org][output_text]]
-
-#+name: output_options
-#+BEGIN_SRC d
-if (doc_matters.opt.action.text) {
- /+ mixin outputText; +/
- if ((doc_matters.opt.action.verbose)) {
- writeln("text processing... ");
+ if (doc_matters.opt.action.sisupod) {
+ msg.v("sisupod source done");
}
}
#+END_SRC
@@ -144,28 +98,20 @@ if (doc_matters.opt.action.text) {
#+name: output_options
#+BEGIN_SRC d
if (doc_matters.opt.action.html_seg) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("html seg processing... ");
- }
+ msg.v("html seg source processing...");
outputHTML!().seg(doc_abstraction, doc_matters);
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)) {
- writeln("html seg done");
- }
- outputHTML!().css(doc_matters);
- outputHTML!().images_cp(doc_matters);
+ msg.vv("html seg done");
}
if (doc_matters.opt.action.html_scroll) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("html scroll processing... ");
- }
+ msg.v("html scroll source processing...");
outputHTML!().scroll(doc_abstraction, doc_matters);
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)) {
- writeln("html scroll done");
- }
+ msg.vv("html scroll done");
+}
+if (doc_matters.opt.action.html_stuff) {
+ msg.v("html copying images & css...");
outputHTML!().css(doc_matters);
outputHTML!().images_cp(doc_matters);
+ msg.vv("html css & images done");
}
#+END_SRC
@@ -175,35 +121,9 @@ if (doc_matters.opt.action.html_scroll) {
#+name: output_options
#+BEGIN_SRC d
if (doc_matters.opt.action.epub) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("epub3 processing... ");
- }
+ msg.v("epub3 source processing...");
outputEPub3!()(doc_abstraction, doc_matters);
- // epub.css_write;
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)) {
- writeln("epub3 done");
- }
-}
-#+END_SRC
-
-*** pdf
-
-#+name: output_options
-#+BEGIN_SRC d
-if (doc_matters.opt.action.pdf) {
- /+ mixin outputPDF; +/
- writeln("pdf processing");
-}
-#+END_SRC
-
-*** odt
-
-#+name: output_options
-#+BEGIN_SRC d
-if (doc_matters.opt.action.odt) {
- /+ mixin outputODT; +/
- writeln("odt processing");
+ msg.vv("epub3 done");
}
#+END_SRC
@@ -215,10 +135,9 @@ if (doc_matters.opt.action.odt) {
#+name: output_options
#+BEGIN_SRC d
if (doc_matters.opt.action.sqlite_discrete) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("sqlite processing... ");
- }
+ msg.v("sqlite processing...");
SQLiteHubDiscreteBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
+ msg.vv("sqlite done");
}
#+END_SRC
@@ -230,15 +149,13 @@ if (doc_matters.opt.action.sqlite_discrete) {
if (doc_matters.opt.action.sqlite_insert
|| doc_matters.opt.action.sqlite_update
) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("sqlite processing... ");
- }
+ msg.v("sqlite update processing...");
SQLiteHubBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
+ msg.vv("sqlite update done");
} else if (doc_matters.opt.action.sqlite_delete) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("sqlite processing... ");
- }
+ msg.v("sqlite delete processing...");
SQLiteHubBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
+ msg.vv("sqlite delete done");
}
#+END_SRC
@@ -249,9 +166,12 @@ if (doc_matters.opt.action.sqlite_insert
#+BEGIN_SRC d
if ((opt_action.sqlite_db_drop)) {
if ((opt_action.verbose)) {
- writeln("sqlite drop db... ");
+ writeln("sqlite drop db...");
}
SQLiteDbDrop!()(opt_action);
+ if ((opt_action.very_verbose)) {
+ writeln("sqlite drop db done");
+ }
}
#+END_SRC
@@ -261,19 +181,12 @@ if ((opt_action.sqlite_db_drop)) {
#+BEGIN_SRC d
if ((opt_action.sqlite_db_create)) {
if ((opt_action.verbose)) {
- writeln("sqlite create table... ");
+ writeln("sqlite create table...");
}
SQLiteTablesCreate!()(env, opt_action);
-}
-#+END_SRC
-
-*** postgresql
-
-#+name: output_options
-#+BEGIN_SRC d
-if (doc_matters.opt.action.postgresql) {
- /+ mixin outputPostgreSQL; +/
- writeln("pgsql processing");
+ if ((opt_action.very_verbose)) {
+ writeln("sqlite create table done");
+ }
}
#+END_SRC
diff --git a/org/output_sisupod.org b/org/output_sisupod.org
index 2876dc7..d6fbc5d 100644
--- a/org/output_sisupod.org
+++ b/org/output_sisupod.org
@@ -180,14 +180,14 @@ auto fn_sisupod = pths_sisupod.sisupod_filename(doc_matters.src.filename).zpod;
writeln("WARNING (io) src out NOT found (document make): ", fn_src_in);
}
}
-} { /+ TODO bundle primary file +/
+} { /+ bundle primary file +/
auto fn_src_in = doc_matters.src.file_with_absolute_path.to!string;
auto fn_src_out_sisupod_zip_base
= pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).zpod.to!string;
auto fn_src_out_filesystem
- = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.to!string; // needed without root path:
+ = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.to!string; // without root path:
auto fn_src_out_inside_pod
- = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).zpod.to!string; // needed without root path:
+ = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).zpod.to!string; // without root path:
string[] filelist_src_out_sisupod_arr;
string[] filelist_src_zpod_arr;
if (exists(fn_src_in)) {
diff --git a/org/output_sqlite.org b/org/output_sqlite.org
index eeff4f1..11a853a 100644
--- a/org/output_sqlite.org
+++ b/org/output_sqlite.org
@@ -46,7 +46,9 @@ template SQLiteHubBuildTablesAndPopulate() {
I doc_matters,
) {
<<sqlite_db_statement_composite_collection>>
- writeln(" ", pth_sqlite.sqlite_file);
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", pth_sqlite.sqlite_file);
+ }
}
}
SQLiteDbStatementComposite!()(db, doc_abstraction, doc_matters);
@@ -72,7 +74,9 @@ template SQLiteHubDiscreteBuildTablesAndPopulate() {
I doc_matters,
) {
<<sqlite_db_statement_composite_discrete>>
- writeln(" ", pth_sqlite.sqlite_file(doc_matters.src.filename));
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", pth_sqlite.sqlite_file(doc_matters.src.filename));
+ }
}
}
SQLiteDiscreteDbStatementComposite!()(db, doc_abstraction, doc_matters);
@@ -229,9 +233,9 @@ template SQLiteTablesCreate() {
}
if (opt_action.sqlite_db_create) {
string _db_statement;
- auto pth_sqlite = SiSUpathsSQLite!()(opt_action.sqlite_filename, opt_action.output_dir_set); // ISSUE
+ auto pth_sqlite = SiSUpathsSQLite!()(opt_action.sqlite_filename, opt_action.output_dir_set);
pth_sqlite.base.mkdirRecurse;
- auto db = Database(pth_sqlite.sqlite_file); // ISSUE
+ auto db = Database(pth_sqlite.sqlite_file);
{
_db_statement ~= SQLiteTablesReCreate!()();
}
@@ -248,7 +252,7 @@ template SQLiteDbDrop() {
void SQLiteDbDrop(O)(O opt_action) {
writeln("db drop");
if ((opt_action.sqlite_db_drop)) {
- auto pth_sqlite = SiSUpathsSQLite!()(opt_action.sqlite_filename, opt_action.output_dir_set); // ISSUE
+ auto pth_sqlite = SiSUpathsSQLite!()(opt_action.sqlite_filename, opt_action.output_dir_set);
writeln("remove(", pth_sqlite.sqlite_file, ")");
try {
remove(pth_sqlite.sqlite_file);
@@ -968,12 +972,12 @@ foreach (part; doc_matters.xml.keys_seq.sql) {
break;
}
break;
- case "body": // assert(part == "body", part); // TODO broken
+ case "body": // assert(part == "body", part);
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
case "heading":
- debug (asserts) { // TODO consider and fix or remove
+ debug (asserts) {
if (part != "body") {
writeln(__LINE__, ": ", obj.text);
}
@@ -1071,7 +1075,7 @@ foreach (part; doc_matters.xml.keys_seq.sql) {
break;
}
if (obj.metainfo.is_a == "heading") {
- if ((doc_matters.opt.action.verbose)) {
+ if ((doc_matters.opt.action.very_verbose)) {
writeln(
"markup: ", obj.metainfo.heading_lev_markup,
"> ", obj.metainfo.dom_structure_markedup_tags_status,
@@ -1127,8 +1131,8 @@ DROP TABLE IF EXISTS urls;
#+BEGIN_SRC sql
CREATE TABLE metadata_and_text (
uid VARCHAR(256) UNIQUE, /* filename, language char, pod/txt (decide on delimiter [,;:/]) */
- src_composite_id_per_txt VARCHAR(256) NOT NULL, /* UNIQUE, /* z pod name if any + src filename + language code */
- src_composite_id_per_pod VARCHAR(256) NOT NULL, /* z pod name if any + src filename */
+ src_composite_id_per_txt VARCHAR(256) NOT NULL, /* UNIQUE, /* z pod name if any + src filename + language code */
+ src_composite_id_per_pod VARCHAR(256) NOT NULL, /* z pod name if any + src filename */
title VARCHAR(800) NOT NULL,
title_main VARCHAR(400) NOT NULL,
title_sub VARCHAR(400) NULL,
diff --git a/org/output_xmls.org b/org/output_xmls.org
index 6854f4d..6be553f 100644
--- a/org/output_xmls.org
+++ b/org/output_xmls.org
@@ -435,7 +435,7 @@ auto inline_images(O)(
_img_pth = "../../../image/";
}
if (_txt.match(rgx.inline_image)) {
- _txt = _txt.replaceAll( // TODO bug where image dimensions (w or h) not given & consequently set to 0; should not be used (calculate earlier, abstraction)
+ _txt = _txt.replaceAll(
rgx.inline_image,
("$1<img src=\""
~ _img_pth
@@ -1394,7 +1394,7 @@ void scroll(D,I)(
break;
}
break;
- case "body": assert(part == "body" || "head"); // surprise
+ case "body": assert(part == "body" || "head");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -1524,7 +1524,9 @@ void scroll_write_output(M,C)(
} catch (ErrnoException ex) {
// Handle error
}
- writeln(" ", pth_html.fn_scroll(doc_matters.src.filename));
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", pth_html.fn_scroll(doc_matters.src.filename));
+ }
}
#+END_SRC
@@ -1587,10 +1589,9 @@ void seg(D,M)(
segment_filename = obj.tags.segment_anchor_tag;
doc_html[segment_filename] ~= xhtml_format.html_head(doc_matters, "seg");
auto navigation_bar = xhtml_format.nav_pre_next_svg(obj);
- doc_html[segment_filename] ~= navigation_bar.toc_pre_next; // navigation bar
+ doc_html[segment_filename] ~= navigation_bar.toc_pre_next;
previous_seg_filename = segment_filename;
foreach (top_level_heading; top_level_headings) {
- // writeln(top_level_heading);
doc_html[segment_filename] ~= top_level_heading;
}
auto t = xhtml_format.heading_seg(obj, _txt, suffix, "seg");
@@ -1793,7 +1794,9 @@ void seg_write_output(M,D,E)(
} catch (ErrnoException ex) {
// handle error
}
- writeln(" ", pth_html.fn_seg(doc_matters.src.filename, "toc"));
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", pth_html.fn_seg(doc_matters.src.filename, "toc"));
+ }
}
#+END_SRC
@@ -2687,7 +2690,9 @@ void epub3_write_output_files(M,D,E,Mt,Mic,Otnx,Otn,Oc)(
} catch (ErrnoException ex) {
// Handle error
}
- writeln(" ", fn_epub);
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", fn_epub);
+ }
#+END_SRC
** zip debug, read zip archive
diff --git a/org/output_xmls_css.org b/org/output_xmls_css.org
index 31041c7..a0511e8 100644
--- a/org/output_xmls_css.org
+++ b/org/output_xmls_css.org
@@ -1275,10 +1275,5 @@ Consider what if anything should be used here
background-color: #00704e;
}
#+END_SRC
-*** epub xhtml
-
-#+name: css_epub
-#+BEGIN_SRC css
-#+END_SRC
* __END__
diff --git a/org/sdp.org b/org/sdp.org
index e85d040..8796a6b 100644
--- a/org/sdp.org
+++ b/org/sdp.org
@@ -47,7 +47,7 @@ version (Posix) {
#+END_SRC
* 1. sdp (sisu document parser) :sdp:
-
+** notes
- deal with imports
- get options
- get command line instructions
@@ -233,17 +233,13 @@ bool[string] opts = [
"concordance" : false,
"debug" : false,
"digest" : false,
- "docbook" : false,
"epub" : false,
"html" : false,
"html-seg" : false,
"html-scroll" : false,
"manifest" : false,
"ocn" : true,
- "odt" : false,
- "pdf" : false,
- "postgresql" : false,
- "qrcode" : false,
+ "quiet" : false,
"sisupod" : false,
"source" : false,
"sqlite-discrete" : false,
@@ -255,9 +251,8 @@ bool[string] opts = [
"sqlite-update" : false,
"text" : false,
"verbose" : false,
+ "very-verbose" : false,
"xhtml" : false,
- "xml-dom" : false,
- "xml-sax" : false,
"section_toc" : true,
"section_body" : true,
"section_endnotes" : true,
@@ -276,52 +271,46 @@ string[string] settings = [
];
auto helpInfo = getopt(args,
std.getopt.config.passThrough,
- "abstraction", "--abstraction document abstraction ", &opts["abstraction"],
- "assert", "--assert set optional assertions on", &opts["assertions"],
- "concordance", "--concordance file for document", &opts["concordance"],
- "debug", "--debug", &opts["debug"],
- "digest", "--digest hash digest for each object", &opts["digest"],
- "docbook", "--docbook process docbook output", &opts["docbook"],
- "epub", "--epub process epub output", &opts["epub"],
- "html", "--html process html output", &opts["html"],
- "html-seg", "--html-seg process html output", &opts["html-seg"],
- "html-scroll", "--html-seg process html output", &opts["html-scroll"],
- "manifest", "--manifest process manifest output", &opts["manifest"],
- "ocn", "--ocn object cite numbers (default)", &opts["ocn"],
- "odf", "--odf process odf:odt output", &opts["odt"],
- "odt", "--odt process odf:odt output", &opts["odt"],
- "pdf", "--pdf process pdf output", &opts["pdf"],
- "pg", "--pg process postgresql output", &opts["postgresql"],
- "postgresql", "--postgresql process postgresql output", &opts["postgresql"],
- "qrcode", "--qrcode with document metadata", &opts["qrcode"],
- "sisupod", "--sisupod sisupod source content bundled", &opts["sisupod"],
- "source", "--source markup source text content", &opts["source"],
- "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"],
- "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"],
- "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"],
- "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"],
- "sqlite-delete", "--sqlite process sqlite output", &opts["sqlite-delete"],
- "sqlite-insert", "--sqlite process sqlite output", &opts["sqlite-insert"],
- "sqlite-update", "--sqlite process sqlite output", &opts["sqlite-update"],
- "text", "--text process text output", &opts["text"],
- "txt", "--txt process text output", &opts["text"],
- "verbose|v", "--verbose output to terminal", &opts["verbose"],
- "xhtml", "--xhtml process xhtml output", &opts["xhtml"],
- "xml-dom", "--xml-dom process xml dom output", &opts["xml-dom"],
- "xml-sax", "--xml-sax process xml sax output", &opts["xml-sax"],
- "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"],
- "section-body", "--section-body process document body (default)", &opts["section_body"],
- "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"],
- "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"],
- "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"],
- "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"],
- "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"],
- "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"],
- "skip-output", "--skip-output", &opts["skip-output"],
- "output-dir", "--output-dir=[dir path]", &settings["output-dir"],
- "site-config-dir", "--site-config-dir=[dir path]", &settings["site-config-dir"],
- "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"],
- "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"],
+ "abstraction", "--abstraction document abstraction ", &opts["abstraction"],
+ "assert", "--assert set optional assertions on", &opts["assertions"],
+ "concordance", "--concordance file for document", &opts["concordance"],
+ "debug", "--debug", &opts["debug"],
+ "digest", "--digest hash digest for each object", &opts["digest"],
+ "epub", "--epub process epub output", &opts["epub"],
+ "html", "--html process html output", &opts["html"],
+ "html-seg", "--html-seg process html output", &opts["html-seg"],
+ "html-scroll", "--html-seg process html output", &opts["html-scroll"],
+ "manifest", "--manifest process manifest output", &opts["manifest"],
+ "ocn", "--ocn object cite numbers (default)", &opts["ocn"],
+ "quiet", "--quiet output to terminal", &opts["quiet"],
+ "sisupod", "--sisupod sisupod source content bundled", &opts["sisupod"],
+ "source", "--source markup source text content", &opts["source"],
+ "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"],
+ "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"],
+ "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"],
+ "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"],
+ // "sqlite-db-populate", "--sqlite-db-populate create db & tables, insert specified", &opts["sqlite-db-populate"],
+ "sqlite-delete", "--sqlite process sqlite output", &opts["sqlite-delete"],
+ "sqlite-insert", "--sqlite process sqlite output", &opts["sqlite-insert"],
+ "sqlite-update", "--sqlite process sqlite output", &opts["sqlite-update"],
+ "text", "--text process text output", &opts["text"],
+ "txt", "--txt process text output", &opts["text"],
+ "verbose|v", "--verbose output to terminal", &opts["verbose"],
+ "very-verbose", "--very-verbose output to terminal", &opts["very-verbose"],
+ "xhtml", "--xhtml process xhtml output", &opts["xhtml"],
+ "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"],
+ "section-body", "--section-body process document body (default)", &opts["section_body"],
+ "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"],
+ "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"],
+ "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"],
+ "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"],
+ "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"],
+ "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"],
+ "skip-output", "--skip-output", &opts["skip-output"],
+ "output-dir", "--output-dir=[dir path]", &settings["output-dir"],
+ "site-config-dir", "--site-config-dir=[dir path]", &settings["site-config-dir"],
+ "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"],
+ "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"],
);
if (helpInfo.helpWanted) {
defaultGetoptPrinter("Some information about the program.", helpInfo.options);
@@ -345,41 +334,45 @@ struct OptActions {
auto digest() {
return opts["digest"];
}
- auto docbook() {
- return opts["docbook"];
- }
auto epub() {
return opts["epub"];
}
auto html() {
- bool _is;
- if (
+ bool _is = (
opts["html"]
|| opts["html-seg"]
|| opts["html-scroll"]
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
auto html_seg() {
- bool _is;
- if (
+ bool _is = (
opts["html"]
|| opts["html-seg"]
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
auto html_scroll() {
- bool _is;
- if (
+ bool _is = (
+ opts["html"]
+ || opts["html-scroll"]
+ )
+ ? true
+ : false;
+ return _is;
+ }
+ auto html_stuff() {
+ bool _is = (
opts["html"]
|| opts["html-scroll"]
- ) {
- _is = true;
- } else { _is = false; }
+ || opts["html-seg"]
+ )
+ ? true
+ : false;
return _is;
}
auto manifest() {
@@ -388,17 +381,8 @@ struct OptActions {
auto ocn() {
return opts["ocn"];
}
- auto odt() {
- return opts["odt"];
- }
- auto pdf() {
- return opts["pdf"];
- }
- auto postgresql() {
- return opts["postgresql"];
- }
- auto qrcode() {
- return opts["qrcode"];
+ auto quiet() {
+ return opts["quiet"];
}
auto sisupod() {
return opts["sisupod"];
@@ -410,23 +394,21 @@ struct OptActions {
return opts["sqlite-discrete"];
}
auto sqlite_db_drop() {
- bool _is;
- if (
+ bool _is = (
opts["sqlite-db-recreate"]
|| opts["sqlite-db-drop"]
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
auto sqlite_db_create() {
- bool _is;
- if (
+ bool _is = (
opts["sqlite-db-recreate"]
|| opts["sqlite-db-create"]
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
auto sqlite_insert() {
@@ -442,17 +424,20 @@ struct OptActions {
return opts["text"];
}
auto verbose() {
- return opts["verbose"];
+ bool _is = (
+ opts["verbose"]
+ || opts["very-verbose"]
+ )
+ ? true
+ : false;
+ return _is;
+ }
+ auto very_verbose() {
+ return opts["very-verbose"];
}
auto xhtml() {
return opts["xhtml"];
}
- auto xml_dom() {
- return opts["xml-dom"];
- }
- auto xml_sax() {
- return opts["xml-sax"];
- }
auto section_toc() {
return opts["section_toc"];
}
@@ -490,29 +475,21 @@ struct OptActions {
return settings["sqlite-filename"];
}
auto abstraction() {
- bool _is;
- if (
+ bool _is = (
opts["abstraction"]
|| concordance
- || docbook
|| epub
|| html
|| manifest
- || odt
- || pdf
- || postgresql
- || qrcode
|| sisupod
|| source
|| sqlite_discrete
|| sqlite_delete
|| sqlite_insert
|| sqlite_update
- || text
- || xhtml
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
}
@@ -600,7 +577,7 @@ foreach(arg; args[1..$]) {
_manifests ~= _manifest_matter;
}
} else if (arg.match(rgx.src_pth_zip)) {
- // fns_src ~= arg; // gather input markup source file names for processing
+ // fns_src ~= arg; // gather input markup source file names for processing
} else { // anything remaining, unused
arg_unrecognized ~= " " ~ arg;
}
@@ -639,7 +616,7 @@ if (!(_opt_action.skip_output)) {
#+NAME: sdp_each_file_do_scope
#+BEGIN_SRC d
scope(success) {
- debug(checkdoc) {
+ if (!(_opt_action.quiet)) {
writefln(
"%s\n%s",
"~ document complete, ok ~",
@@ -730,7 +707,7 @@ if (!(doc_matters.opt.action.skip_output)) {
#+NAME: sdp_each_file_do_scope_exit
#+BEGIN_SRC d
scope(exit) {
- debug(checkdoc) {
+ if (!(_opt_action.quiet)) {
writefln(
"processed file: %s",
manifest.src.filename
@@ -763,7 +740,7 @@ template SiSUabstraction() {
auto SiSUabstraction(E,O,M)(
E _env,
O _opt_action,
- M _manifest,
+ M _manifest
){
<<sdp_conf_files>>
<<sdp_each_file_do_read_and_split_sisu_markup_file_content_into_header_and_body>>
@@ -1265,7 +1242,7 @@ consider
**** ocn
|-------------+-----------------------+-----------------------+----------------+------|
-| *objects | section / part | ocn described | how used* | type |
+| objects | section / part | ocn described | how used | type |
|-------------+-----------------------+-----------------------+----------------+------|
| regular ocn | | | | |
|-------------+-----------------------+-----------------------+----------------+------|
diff --git a/org/source_files_read.org b/org/source_files_read.org
index fb53f54..8f5430a 100644
--- a/org/source_files_read.org
+++ b/org/source_files_read.org
@@ -65,7 +65,6 @@ static template readConfigSite() {
if (exists(conf_file)) {
debug(io) {
writeln("WARNING (io debug) in config file found: ", conf_file);
- // writeln(__LINE__, ": found: ", conf_file, " in ", pth);
}
config_file_str = conf_file.readText;
break;
diff --git a/src/sdp/meta/conf_make_meta_json.d b/src/sdp/meta/conf_make_meta_json.d
index bf67c62..dbba9af 100644
--- a/src/sdp/meta/conf_make_meta_json.d
+++ b/src/sdp/meta/conf_make_meta_json.d
@@ -190,21 +190,21 @@ static template contentJSONtoSiSUstruct() {
) {
_struct_composite.make_str.texpdf_font = _json.object["make"]["texpdf_font"].str;
}
- _struct_composite.make.bold = _mk.bold(_struct_composite.make_str.bold);
- _struct_composite.make.breaks = _mk.breaks(_struct_composite.make_str.breaks);
- _struct_composite.make.cover_image = _mk.cover_image(_struct_composite.make_str.cover_image);
- _struct_composite.make.css = _mk.css(_struct_composite.make_str.css);
- _struct_composite.make.emphasis = _mk.emphasis(_struct_composite.make_str.emphasis);
- _struct_composite.make.footer = _mk.footer(_struct_composite.make_str.footer);
- _struct_composite.make.headings = _mk.headings(_struct_composite.make_str.headings);
- _struct_composite.make.home_button_image = _mk.home_button_image(_struct_composite.make_str.home_button_image);
- _struct_composite.make.home_button_text = _mk.home_button_text(_struct_composite.make_str.home_button_text);
- _struct_composite.make.italics = _mk.italics(_struct_composite.make_str.italics);
- _struct_composite.make.auto_num_top_at_level = _mk.auto_num_top_at_level(_struct_composite.make_str.auto_num_top_at_level);
- _struct_composite.make.auto_num_top_lv = _mk.auto_num_top_lv(_struct_composite.make_str.auto_num_top_lv);
- _struct_composite.make.auto_num_depth = _mk.auto_num_depth(_struct_composite.make_str.auto_num_depth);
- _struct_composite.make.substitute = _mk.substitute(_struct_composite.make_str.substitute);
- _struct_composite.make.texpdf_font = _mk.texpdf_font(_struct_composite.make_str.texpdf_font);
+ _struct_composite.make.bold = _mk.bold(_struct_composite.make_str.bold);
+ _struct_composite.make.breaks = _mk.breaks(_struct_composite.make_str.breaks);
+ _struct_composite.make.cover_image = _mk.cover_image(_struct_composite.make_str.cover_image);
+ _struct_composite.make.css = _mk.css(_struct_composite.make_str.css);
+ _struct_composite.make.emphasis = _mk.emphasis(_struct_composite.make_str.emphasis);
+ _struct_composite.make.footer = _mk.footer(_struct_composite.make_str.footer);
+ _struct_composite.make.headings = _mk.headings(_struct_composite.make_str.headings);
+ _struct_composite.make.home_button_image = _mk.home_button_image(_struct_composite.make_str.home_button_image);
+ _struct_composite.make.home_button_text = _mk.home_button_text(_struct_composite.make_str.home_button_text);
+ _struct_composite.make.italics = _mk.italics(_struct_composite.make_str.italics);
+ _struct_composite.make.auto_num_top_at_level = _mk.auto_num_top_at_level(_struct_composite.make_str.auto_num_top_at_level);
+ _struct_composite.make.auto_num_top_lv = _mk.auto_num_top_lv(_struct_composite.make_str.auto_num_top_lv);
+ _struct_composite.make.auto_num_depth = _mk.auto_num_depth(_struct_composite.make_str.auto_num_depth);
+ _struct_composite.make.substitute = _mk.substitute(_struct_composite.make_str.substitute);
+ _struct_composite.make.texpdf_font = _mk.texpdf_font(_struct_composite.make_str.texpdf_font);
}
/+ conf ------------------------------------------------------------------- +/
if ("webserv" in _json.object) {
@@ -254,7 +254,7 @@ static template contentJSONtoSiSUstruct() {
_struct_composite.conf.webserv_cgi_file_links = _json.object["webserv"]["cgi_file_links"].str;
}
}
- if ("processing" in _json.object) { // TODO check & match logic with sdlang
+ if ("processing" in _json.object) {
if ("path" in _json.object["processing"]
&& (_json.object["processing"]["path"].type().to!string == "STRING")
) {
@@ -437,11 +437,7 @@ static template contentJSONtoSiSUstruct() {
_struct_composite.meta.date_valid = _json.object["date"]["valid"].str;
}
}
- if ("links" in _json.object) {
- // if ("" in _json.object["links"]) {
- // _struct_composite.meta.links_ = _json.object["links"][""].str;
- // }
- }
+ if ("links" in _json.object) {}
if ("notes" in _json.object) {
if ("abstract" in _json.object["notes"]
&& (_json.object["notes"]["abstract"].type().to!string == "STRING")
@@ -476,11 +472,7 @@ static template contentJSONtoSiSUstruct() {
_struct_composite.meta.original_title = _json.object["original"]["title"].str;
}
}
- if ("publisher" in _json.object) {
- // if ("" in _json.object["publisher"]) {
- // _struct_composite.meta.publisher = _json.object["publisher"][""].str;
- // }
- }
+ if ("publisher" in _json.object) {}
if ("rights" in _json.object) {
if ("copyright" in _json.object["rights"]
&& (_json.object["rights"]["copyright"].type().to!string == "STRING")
@@ -551,7 +543,6 @@ static template contentJSONtoSiSUstruct() {
_struct_composite.meta.creator_translator = _json.object["creator"]["translator"].str;
}
}
- // dochead_meta["creator"]["author_raw"] = dochead_meta["creator"]["author"];
string[] authors_arr;
auto authors_raw_arr = _struct_composite.meta.creator_author.split(_rgx.arr_delimiter);
foreach (author_raw; authors_raw_arr) {
@@ -571,9 +562,7 @@ static template contentJSONtoSiSUstruct() {
}
if ("full" in _json.object["title"]
&& (_json.object["title"]["full"].type().to!string == "STRING")
- ) {
- // _struct_composite.meta.title_full = _json.object["title"]["full"].str;
- }
+ ) {}
if ("language" in _json.object["title"]
&& (_json.object["title"]["language"].type().to!string == "STRING")
) {
diff --git a/src/sdp/meta/doc_debugs.d b/src/sdp/meta/doc_debugs.d
index 66b5f0e..73b0f3b 100644
--- a/src/sdp/meta/doc_debugs.d
+++ b/src/sdp/meta/doc_debugs.d
@@ -59,18 +59,6 @@ template SiSUdebugs() {
__FILE__,
__LINE__,
);
- // if (key.length > 0) {
- // foreach (obj; contents[key]) {
- // if (obj.metainfo.is_of_part != "empty") {
- // writefln(
- // "[%s][%s]\n%s",
- // obj.object_number,
- // obj.metainfo.is_a,
- // obj.text
- // );
- // }
- // }
- // }
}
debug(section_head) {
key="head";
@@ -417,7 +405,6 @@ template SiSUdebugs() {
obj.marked_up_level,
obj.object_number,
obj.anchor_tags,
- // "[", obj["is"], "] ",
obj.text
);
}
@@ -452,7 +439,6 @@ template SiSUdebugs() {
"%s~ [%s] %s",
obj.marked_up_level,
obj.object_number,
- // "[", obj["is"], "] ",
obj.text
);
}
diff --git a/src/sdp/meta/metadoc.d b/src/sdp/meta/metadoc.d
index e7c107a..ff550b5 100644
--- a/src/sdp/meta/metadoc.d
+++ b/src/sdp/meta/metadoc.d
@@ -31,7 +31,7 @@ template SiSUabstraction() {
auto SiSUabstraction(E,O,M)(
E _env,
O _opt_action,
- M _manifest,
+ M _manifest
){
auto _config_document_struct = readConfigDoc!()(_manifest, _env); // document config file
auto _config_local_site_struct = readConfigSite!()(_manifest, _env); // local site config
diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d
index 661e106..8de0711 100644
--- a/src/sdp/meta/metadoc_from_src.d
+++ b/src/sdp/meta/metadoc_from_src.d
@@ -402,11 +402,11 @@ template SiSUdocAbstraction() {
/+ dollar represented as $$ needed to stop submatching on $
(substitutions using ${identifiers} must take into account (i.e. happen earlier))
+/
- debug(source) { // source lines
+ debug(source) {
writeln(line);
}
debug(srclines) {
- if (!line.empty) { // source lines, not empty
+ if (!line.empty) {
writefln(
"* %s",
line
@@ -538,18 +538,18 @@ template SiSUdocAbstraction() {
];
bullet = false;
if (auto m = line.matchFirst(rgx.para_indent)) {
- debug(paraindent) { // para indent
+ debug(paraindent) {
writeln(line);
}
indent["hang_position"] = (m.captures[1]).to!int;
indent["base_position"] = 0;
} else if (line.matchFirst(rgx.para_bullet)) {
- debug(parabullet) { // para bullet
+ debug(parabullet) {
writeln(line);
}
bullet = true;
} else if (auto m = line.matchFirst(rgx.para_indent_hang)) {
- debug(paraindenthang) { // para indent hang
+ debug(paraindenthang) {
writeln(line);
}
indent=[
@@ -557,7 +557,7 @@ template SiSUdocAbstraction() {
"base_position" : (m.captures[2]).to!int,
];
} else if (auto m = line.matchFirst(rgx.para_bullet_indent)) {
- debug(parabulletindent) { // para bullet indent
+ debug(parabulletindent) {
writeln(line);
}
indent=[
@@ -829,7 +829,7 @@ template SiSUdocAbstraction() {
/+ heading object (current line empty) +/
obj_cite_digits = (an_object["lev_markup_number"].to!int == 0)
? ocn_emit(OCNstatus.reset)
- : ocn_emit(OCNstatus.on); // : ocn_emit(obj_type_status["ocn_status"]);
+ : ocn_emit(OCNstatus.on);
an_object["is"] = "heading";
an_object_key="body_nugget";
auto substantive_object_and_anchor_tags_tuple
@@ -1018,7 +1018,7 @@ template SiSUdocAbstraction() {
previous_length = the_document_body_section.length.to!int;
}
}
- } /+ ← closed: loop markup document/text line by line +/
+ } /+ ← srcDocLoop closed: loop markup document/text line by line +/
/+ ↓ post loop markup document/text +/
auto en_tuple
= note_section.endnote_objects(obj_cite_digits, opt_action);
@@ -1050,8 +1050,6 @@ template SiSUdocAbstraction() {
comp_obj_heading_.metainfo.parent_ocn = 1;
comp_obj_heading_.metainfo.parent_lev_markup = 0;
the_glossary_section ~= comp_obj_heading_;
- } else {
- writeln("gloss");
}
debug(glossary) {
foreach (gloss; the_glossary_section) {
@@ -1227,7 +1225,7 @@ template SiSUdocAbstraction() {
toc_txt_ = format(
"{ %s }#%s",
"Glossary",
- "glossary", // _anchor_tag
+ "glossary",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = toc_txt_.to!string.strip;
@@ -1250,7 +1248,7 @@ template SiSUdocAbstraction() {
toc_txt_ = format(
"{ %s }#%s",
"Bibliography",
- "bibliography", // _anchor_tag
+ "bibliography",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = toc_txt_.to!string.strip;
@@ -1274,7 +1272,7 @@ template SiSUdocAbstraction() {
toc_txt_ = format(
"{ %s }#%s",
"Book Index",
- "bookindex", // _anchor_tag
+ "bookindex",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.text = toc_txt_.to!string.strip;
@@ -1296,7 +1294,7 @@ template SiSUdocAbstraction() {
toc_txt_ = format(
"{ %s }#%s",
"Blurb",
- "blurb", // _anchor_tag
+ "blurb",
);
toc_txt_= munge.url_links(toc_txt_);
comp_obj_toc.has.inline_links = true;
@@ -1599,7 +1597,7 @@ template SiSUdocAbstraction() {
string[] _ocn_open_key = ["","","","","","","",""];
auto _doc_sect_length = document_sections.length - 1;
int _last_ocn;
- foreach (_lg, ref obj; document_sections) { // TODO the_document_body_section
+ foreach (_lg, ref obj; document_sections) {
if (obj.metainfo.is_a == "heading") {
foreach (_dts_lv, dom_tag_status; obj.metainfo.dom_structure_markedup_tags_status) {
switch (dom_tag_status) {
@@ -1638,7 +1636,6 @@ template SiSUdocAbstraction() {
Tuple!(int, int)[] pairs;
foreach (pair; _heading_ocn_decendants.byPair) {
pairs ~= tuple(pair[0].to!int, pair[1]);
- // pairs ~= tuple(pair.key.to!int, pair.value);
}
return pairs.sort;
}
@@ -1708,8 +1705,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -1737,8 +1733,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -1798,8 +1793,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -1842,8 +1836,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -1878,8 +1871,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -1917,8 +1909,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -1961,8 +1952,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2001,8 +1991,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2045,8 +2034,7 @@ template SiSUdocAbstraction() {
|| (opt_action.epub)
|| (opt_action.sqlite_discrete)
|| (opt_action.sqlite_insert)
- || (opt_action.sqlite_update)
- || (opt_action.postgresql)) {
+ || (opt_action.sqlite_update)) {
obj = obj_dom_structure_set_markup_tags(obj, dom_structure_markedup_tags_status, obj.metainfo.heading_lev_markup);
obj = obj_dom_set_collapsed_tags(obj, dom_structure_collapsed_tags_status, obj.metainfo.heading_lev_collapsed);
}
@@ -2432,7 +2420,7 @@ template SiSUdocAbstraction() {
debug(asserts) {
static assert(is(typeof(line) == char[]));
static assert(is(typeof(obj_type_status) == int[string]));
- static assert(is(typeof(object_number_poem) == string[string]));
+ static assert(is(typeof(object_number_poem) == string[string]));
}
static auto rgx = Rgx();
string code_block_syntax = "";
@@ -2669,7 +2657,7 @@ template SiSUdocAbstraction() {
obj_type_status["group"] = TriState.closing;
obj_type_status["tic_group"] = TriState.off;
} else {
- debug(group) { // group
+ debug(group) {
writeln(line);
}
an_object[an_object_key] ~= line ~= "\n"; // build group array (or string)
@@ -2732,7 +2720,7 @@ template SiSUdocAbstraction() {
static assert(is(typeof(an_object) == string[string]));
static assert(is(typeof(obj_type_status) == int[string]));
static assert(is(typeof(cntr) == int));
- static assert(is(typeof(object_number_poem) == string[string]));
+ static assert(is(typeof(object_number_poem) == string[string]));
}
static auto rgx = Rgx();
if (obj_type_status["curly_poem"] == TriState.on) {
@@ -2740,7 +2728,7 @@ template SiSUdocAbstraction() {
if (an_object_key in an_object
|| processing.length > 0) {
an_object[an_object_key] = "";
- debug(poem) { // poem (curly) close
+ debug(poem) {
writefln(
"* [poem curly] %s",
line
@@ -2749,7 +2737,7 @@ template SiSUdocAbstraction() {
if (processing.length > 0) {
an_object[an_object_key] = processing["verse"];
}
- debug(poem) { // poem (curly) close
+ debug(poem) {
writeln(__LINE__);
writefln(
"* %s %s",
@@ -2848,7 +2836,7 @@ template SiSUdocAbstraction() {
} else if (obj_type_status["tic_poem"] == TriState.on) {
if (auto m = line.matchFirst(rgx.block_tic_close)) { // tic_poem_close
an_object[an_object_key]="verse";
- debug(poem) { // poem (curly) close
+ debug(poem) {
writefln(
"* [poem tic] %s",
line
@@ -3519,7 +3507,7 @@ template SiSUdocAbstraction() {
static auto rgx = Rgx();
if (auto m = line.match(rgx.book_index)) {
/+ match book_index +/
- debug(bookindexmatch) { // book index
+ debug(bookindexmatch) {
writefln(
"* [bookindex] %s\n",
m.captures[1].to!string,
@@ -3531,7 +3519,7 @@ template SiSUdocAbstraction() {
obj_type_status["book_index"] = State.on;
if (opt_action.backmatter && opt_action.section_bookindex) {
book_idx_tmp = m.captures[1].to!string;
- debug(bookindexmatch) { // book index
+ debug(bookindexmatch) {
writefln(
"* [bookindex] %s\n",
book_idx_tmp,
@@ -3545,7 +3533,7 @@ template SiSUdocAbstraction() {
if (opt_action.backmatter
&& opt_action.section_bookindex) {
an_object["bookindex_nugget"] = book_idx_tmp ~ m.captures[1].to!string;
- debug(bookindexmatch) { // book index
+ debug(bookindexmatch) {
writefln(
"* [bookindex] %s\n",
book_idx_tmp,
@@ -3569,11 +3557,11 @@ template SiSUdocAbstraction() {
return ref T obj_type_status
) {
debug(asserts) {
- static assert(is(typeof(line) == char[]));
- static assert(is(typeof(_make_unmarked_headings) == string[]));
- static assert(is(typeof(heading_match_str) == string[string]));
- static assert(is(typeof(heading_match_rgx) == Regex!(char)[string]));
- static assert(is(typeof(obj_type_status) == int[string]));
+ static assert(is(typeof(line) == char[]));
+ static assert(is(typeof(_make_unmarked_headings) == string[]));
+ static assert(is(typeof(heading_match_str) == string[string]));
+ static assert(is(typeof(heading_match_rgx) == Regex!(char)[string]));
+ static assert(is(typeof(obj_type_status) == int[string]));
}
static auto rgx = Rgx();
if ((_make_unmarked_headings.length > 2)
@@ -3861,7 +3849,7 @@ template SiSUdocAbstraction() {
default:
an_object["lev_markup_number"] = lv["lv"].to!string;
}
- debug(heading) { // heading
+ debug(heading) {
writeln(line.strip);
}
}
@@ -3882,32 +3870,32 @@ template SiSUdocAbstraction() {
static assert(is(typeof(indent) == int[string]));
static assert(is(typeof(bullet) == bool));
static assert(is(typeof(obj_type_status) == int[string]));
- static assert(is(typeof(line_occur) == int[string]));
+ static assert(is(typeof(line_occur) == int[string]));
}
static auto rgx = Rgx();
if (line_occur["para"] == State.off) {
line = font_faces_line(line);
/+ para matches +/
obj_type_status["para"] = State.on;
- an_object[an_object_key] ~= line; // body_nugget
+ an_object[an_object_key] ~= line;
indent=[
"hang_position" : 0,
"base_position" : 0,
];
bullet = false;
if (auto m = line.matchFirst(rgx.para_indent)) {
- debug(paraindent) { // para indent
+ debug(paraindent) {
writeln(line);
}
indent["hang_position"] = (m.captures[1]).to!int;
indent["base_position"] = 0;
} else if (line.matchFirst(rgx.para_bullet)) {
- debug(parabullet) { // para bullet
+ debug(parabullet) {
writeln(line);
}
bullet = true;
} else if (auto m = line.matchFirst(rgx.para_indent_hang)) {
- debug(paraindenthang) { // para indent hang
+ debug(paraindenthang) {
writeln(line);
}
indent=[
@@ -3915,7 +3903,7 @@ template SiSUdocAbstraction() {
"base_position" : (m.captures[2]).to!int,
];
} else if (auto m = line.matchFirst(rgx.para_bullet_indent)) {
- debug(parabulletindent) { // para bullet indent
+ debug(parabulletindent) {
writeln(line);
}
indent=[
@@ -4718,16 +4706,16 @@ template SiSUdocAbstraction() {
comp_obj_toc.has.inline_links = true;
the_table_of_contents_section["scroll"] ~= comp_obj_toc;
}
- comp_obj_toc = comp_obj_toc.init;
- comp_obj_toc.metainfo.is_of_part = "frontmatter";
- comp_obj_toc.metainfo.is_of_section = "toc";
- comp_obj_toc.metainfo.is_of_type = "para";
- comp_obj_toc.metainfo.is_a = "toc";
- comp_obj_toc.metainfo.ocn = 0;
- comp_obj_toc.metainfo.object_number_off = "";
- comp_obj_toc.metainfo.object_number_type = 0;
- comp_obj_toc.attrib.bullet = false;
- comp_obj_toc.has.inline_links = true;
+ comp_obj_toc = comp_obj_toc.init;
+ comp_obj_toc.metainfo.is_of_part = "frontmatter";
+ comp_obj_toc.metainfo.is_of_section = "toc";
+ comp_obj_toc.metainfo.is_of_type = "para";
+ comp_obj_toc.metainfo.is_a = "toc";
+ comp_obj_toc.metainfo.ocn = 0;
+ comp_obj_toc.metainfo.object_number_off = "";
+ comp_obj_toc.metainfo.object_number_type = 0;
+ comp_obj_toc.attrib.bullet = false;
+ comp_obj_toc.has.inline_links = true;
switch (obj_["lev_markup_number"].to!int) {
case 0:
indent=[
@@ -4736,11 +4724,11 @@ template SiSUdocAbstraction() {
];
toc_txt_ = "{ Table of Contents }" ~ mkup.mark_internal_site_lnk ~ "toc.fnSuffix";
toc_txt_= munge.url_links(toc_txt_);
- comp_obj_toc.attrib.indent_hang = indent["hang_position"];
- comp_obj_toc.attrib.indent_base = indent["base_position"];
- comp_obj_toc.text = toc_txt_.to!string.strip;
- comp_obj_toc.has.inline_links = true;
- the_table_of_contents_section["seg"] ~= comp_obj_toc;
+ comp_obj_toc.attrib.indent_hang = indent["hang_position"];
+ comp_obj_toc.attrib.indent_base = indent["base_position"];
+ comp_obj_toc.text = toc_txt_.to!string.strip;
+ comp_obj_toc.has.inline_links = true;
+ the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 1: .. case 3:
indent=[
@@ -4752,11 +4740,11 @@ template SiSUdocAbstraction() {
heading_toc_,
);
toc_txt_= munge.url_links(toc_txt_);
- comp_obj_toc.attrib.indent_hang = indent["hang_position"];
- comp_obj_toc.attrib.indent_base = indent["base_position"];
- comp_obj_toc.text = toc_txt_.to!string.strip;
- comp_obj_toc.has.inline_links = true;
- the_table_of_contents_section["seg"] ~= comp_obj_toc;
+ comp_obj_toc.attrib.indent_hang = indent["hang_position"];
+ comp_obj_toc.attrib.indent_base = indent["base_position"];
+ comp_obj_toc.text = toc_txt_.to!string.strip;
+ comp_obj_toc.has.inline_links = true;
+ the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 4:
toc_txt_ = format(
@@ -4772,11 +4760,11 @@ template SiSUdocAbstraction() {
"hang_position" : obj_["lev_markup_number"].to!int,
"base_position" : obj_["lev_markup_number"].to!int,
];
- comp_obj_toc.attrib.indent_hang = indent["hang_position"];
- comp_obj_toc.attrib.indent_base = indent["base_position"];
- comp_obj_toc.text = toc_txt_.to!string.strip;
- comp_obj_toc.has.inline_links = true;
- the_table_of_contents_section["seg"] ~= comp_obj_toc;
+ comp_obj_toc.attrib.indent_hang = indent["hang_position"];
+ comp_obj_toc.attrib.indent_base = indent["base_position"];
+ comp_obj_toc.text = toc_txt_.to!string.strip;
+ comp_obj_toc.has.inline_links = true;
+ the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
case 5: .. case 7:
toc_txt_ = format(
@@ -4801,11 +4789,11 @@ template SiSUdocAbstraction() {
"hang_position" : obj_["lev_markup_number"].to!int,
"base_position" : obj_["lev_markup_number"].to!int,
];
- comp_obj_toc.attrib.indent_hang = indent["hang_position"];
- comp_obj_toc.attrib.indent_base = indent["base_position"];
- comp_obj_toc.text = toc_txt_.to!string.strip;
- comp_obj_toc.has.inline_links = true;
- the_table_of_contents_section["seg"] ~= comp_obj_toc;
+ comp_obj_toc.attrib.indent_hang = indent["hang_position"];
+ comp_obj_toc.attrib.indent_base = indent["base_position"];
+ comp_obj_toc.text = toc_txt_.to!string.strip;
+ comp_obj_toc.has.inline_links = true;
+ the_table_of_contents_section["seg"] ~= comp_obj_toc;
break;
default:
break;
@@ -5235,15 +5223,15 @@ template SiSUdocAbstraction() {
(oa_j.type == JSON_TYPE.OBJECT)
);
if (obj_is_ == "heading") {
- oa_j.object["object_number"] = _comp_obj_heading.metainfo.ocn;
- oa_j.object["lev_markup_number"] = _comp_obj_heading.metainfo.heading_lev_markup;
- oa_j.object["lev_collapsed_number"] = _comp_obj_heading.metainfo.heading_lev_collapsed;
+ oa_j.object["object_number"] = _comp_obj_heading.metainfo.ocn;
+ oa_j.object["lev_markup_number"] = _comp_obj_heading.metainfo.heading_lev_markup;
+ oa_j.object["lev_collapsed_number"] = _comp_obj_heading.metainfo.heading_lev_collapsed;
oa_j.object["heading_ptr"]
= _comp_obj_heading.ptr.heading;
oa_j.object["doc_object_ptr"]
= _comp_obj_heading.ptr.doc_object;
}
- oa_j.object["parent_object_number"] = _comp_obj_heading.metainfo.parent_ocn;
+ oa_j.object["parent_object_number"] = _comp_obj_heading.metainfo.parent_ocn;
oa_j.object["parent_lev_markup_number"] = _comp_obj_heading.metainfo.parent_lev_markup;
_obj_attrib = oa_j.toString();
return _obj_attrib;
@@ -5264,7 +5252,7 @@ template SiSUdocAbstraction() {
)
in {
debug(asserts) {
- static assert(is(typeof(bookindex_section) == string));
+ static assert(is(typeof(bookindex_section) == string));
static assert(is(typeof(obj_cite_digits.on) == int));
}
debug(bookindexraw) {
@@ -5512,25 +5500,25 @@ template SiSUdocAbstraction() {
bi_tmp_seg ~= " \\\\\n ";
++skn;
}
- bi_tmp_scroll = (bi_tmp_scroll).replaceFirst(rgx.trailing_linebreak, "");
- bi_tmp_seg = (bi_tmp_seg).replaceFirst(rgx.trailing_linebreak, "");
- comp_obj_para = comp_obj_para.init;
- comp_obj_para.metainfo.is_of_part = "backmatter";
- comp_obj_para.metainfo.is_of_section = "bookindex";
- comp_obj_para.metainfo.is_of_type = "para";
- comp_obj_para.metainfo.is_a = "bookindex";
- comp_obj_para.text = bi_tmp_scroll.to!string.strip;
- comp_obj_para.metainfo.ocn = 0;
- comp_obj_para.metainfo.object_number_off = "";
- comp_obj_para.metainfo.object_number_type = 0;
- comp_obj_para.tags.anchor_tags = bi_tmp_tags;
- comp_obj_para.attrib.indent_hang = 0;
- comp_obj_para.attrib.indent_base = 1;
- comp_obj_para.attrib.bullet = false;
- comp_obj_para.has.inline_links = true;
- bookindex_section["scroll"] ~= comp_obj_para;
- comp_obj_para.text = bi_tmp_seg.to!string.strip;
- bookindex_section["seg"] ~= comp_obj_para;
+ bi_tmp_scroll = (bi_tmp_scroll).replaceFirst(rgx.trailing_linebreak, "");
+ bi_tmp_seg = (bi_tmp_seg).replaceFirst(rgx.trailing_linebreak, "");
+ comp_obj_para = comp_obj_para.init;
+ comp_obj_para.metainfo.is_of_part = "backmatter";
+ comp_obj_para.metainfo.is_of_section = "bookindex";
+ comp_obj_para.metainfo.is_of_type = "para";
+ comp_obj_para.metainfo.is_a = "bookindex";
+ comp_obj_para.text = bi_tmp_scroll.to!string.strip;
+ comp_obj_para.metainfo.ocn = 0;
+ comp_obj_para.metainfo.object_number_off = "";
+ comp_obj_para.metainfo.object_number_type = 0;
+ comp_obj_para.tags.anchor_tags = bi_tmp_tags;
+ comp_obj_para.attrib.indent_hang = 0;
+ comp_obj_para.attrib.indent_base = 1;
+ comp_obj_para.attrib.bullet = false;
+ comp_obj_para.has.inline_links = true;
+ bookindex_section["scroll"] ~= comp_obj_para;
+ comp_obj_para.text = bi_tmp_seg.to!string.strip;
+ bookindex_section["seg"] ~= comp_obj_para;
++mkn;
}
} else { // no book index, (figure out what to do here)
@@ -5563,11 +5551,11 @@ template SiSUdocAbstraction() {
)
in {
assert((contents_am[cntr].metainfo.is_a == "para")
- || (contents_am[cntr].metainfo.is_a == "heading")
- || (contents_am[cntr].metainfo.is_a == "quote")
- || (contents_am[cntr].metainfo.is_a == "group")
- || (contents_am[cntr].metainfo.is_a == "block")
- || (contents_am[cntr].metainfo.is_a == "verse"));
+ || (contents_am[cntr].metainfo.is_a == "heading")
+ || (contents_am[cntr].metainfo.is_a == "quote")
+ || (contents_am[cntr].metainfo.is_a == "group")
+ || (contents_am[cntr].metainfo.is_a == "block")
+ || (contents_am[cntr].metainfo.is_a == "verse"));
assert(cntr >= previous_count);
assert(
(contents_am[cntr].text).match(
@@ -5593,7 +5581,7 @@ template SiSUdocAbstraction() {
".fnSuffix#noteref_\n ", m.captures[1], " ",
m.captures[2]); // sometimes need segment name (segmented html & epub)
}
- // TODO NEXT you need anchor for segments at this point ->
+ // you need anchor for segments at this point ->
object_notes["anchor"] ~= "note_" ~ m.captures[1] ~ "』";
object_notes["notes"] ~= (segment_anchor_tag_that_object_belongs_to.empty)
? (munge.url_links(
@@ -5846,7 +5834,7 @@ template SiSUdocAbstraction() {
assert(obj_cite_digits.on.to!int >= 0);
}
body {
- assert(is_ != "heading"); // should not be necessary
+ assert(is_ != "heading"); // should not be necessary
assert(obj_cite_digits.on.to!int >= 0); // should not be necessary
if (lv7 > State.off) {
p_["lev_markup_number"] = DocStructMarkupHeading.h_text_4;
diff --git a/src/sdp/meta/object_setter.d b/src/sdp/meta/object_setter.d
index ed99b2a..fc0781e 100644
--- a/src/sdp/meta/object_setter.d
+++ b/src/sdp/meta/object_setter.d
@@ -6,7 +6,7 @@
module sdp.meta.object_setter;
template ObjectSetter() {
/+ structs +/
- struct DocObj_MetaInfo_ { // metainfo
+ struct DocObj_MetaInfo_ {
string is_of_part = ""; // frontmatter, body, backmatter
string is_of_section = ""; // toc, body, glossary, biography, book index, blurb
string is_of_type = ""; // para, block ?
@@ -73,9 +73,9 @@ template ObjectSetter() {
int[] dom_structure_collapsed_tags_status = [ 0, 0, 0, 0, 0, 0, 0, 0,];
int parent_lev_markup = 0;
int parent_ocn = 0;
- int last_decendant_ocn = 0; // DONE
+ int last_decendant_ocn = 0;
}
- struct DocObj_TxtAttrib_ { // attrib
+ struct DocObj_TxtAttrib_ {
int indent_base = 0;
int indent_hang = 0;
bool bullet = false;
@@ -87,22 +87,22 @@ template ObjectSetter() {
bool inline_notes_star = false;
bool contains_image_without_dimensions = false;
}
- struct DocObj_Table_ { // table
+ struct DocObj_Table_ {
int number_of_columns = 0;
double[] column_widths = [];
string[] column_aligns = [];
bool heading = false;
bool walls = false; // not implemented
}
- struct DocObj_CodeBlock_ { // code_block
+ struct DocObj_CodeBlock_ {
string syntax = "";
}
- struct DocObj_Pointer_ { // ptr
+ struct DocObj_Pointer_ {
int doc_object = 0;
int html_segnames = 0;
int heading = 0;
}
- struct DocObj_Tags_ { // tags
+ struct DocObj_Tags_ {
string[] heading_ancestors_text = [ "", "", "", "", "", "", "", "", ]; // TODO redundant? see markedup and collapsed ancestors DONE
string segment_anchor_tag = "";
string segname_prev = "";
diff --git a/src/sdp/output/epub3.d b/src/sdp/output/epub3.d
index d10b7f2..52e3ce2 100644
--- a/src/sdp/output/epub3.d
+++ b/src/sdp/output/epub3.d
@@ -761,7 +761,9 @@ template outputEPub3() {
} catch (ErrnoException ex) {
// Handle error
}
- writeln(" ", fn_epub);
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", fn_epub);
+ }
debug(epub_archive) {
if (exists(fn_epub)) {
try {
diff --git a/src/sdp/output/html.d b/src/sdp/output/html.d
index ba53eef..f1c25e8 100644
--- a/src/sdp/output/html.d
+++ b/src/sdp/output/html.d
@@ -53,7 +53,7 @@ template outputHTML() {
break;
}
break;
- case "body": assert(part == "body" || "head"); // surprise
+ case "body": assert(part == "body" || "head");
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
@@ -177,7 +177,9 @@ template outputHTML() {
} catch (ErrnoException ex) {
// Handle error
}
- writeln(" ", pth_html.fn_scroll(doc_matters.src.filename));
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", pth_html.fn_scroll(doc_matters.src.filename));
+ }
}
void seg(D,M)(
const D doc_abstraction,
@@ -233,10 +235,9 @@ template outputHTML() {
segment_filename = obj.tags.segment_anchor_tag;
doc_html[segment_filename] ~= xhtml_format.html_head(doc_matters, "seg");
auto navigation_bar = xhtml_format.nav_pre_next_svg(obj);
- doc_html[segment_filename] ~= navigation_bar.toc_pre_next; // navigation bar
+ doc_html[segment_filename] ~= navigation_bar.toc_pre_next;
previous_seg_filename = segment_filename;
foreach (top_level_heading; top_level_headings) {
- // writeln(top_level_heading);
doc_html[segment_filename] ~= top_level_heading;
}
auto t = xhtml_format.heading_seg(obj, _txt, suffix, "seg");
@@ -433,7 +434,9 @@ template outputHTML() {
} catch (ErrnoException ex) {
// handle error
}
- writeln(" ", pth_html.fn_seg(doc_matters.src.filename, "toc"));
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", pth_html.fn_seg(doc_matters.src.filename, "toc"));
+ }
}
void css(M)(
auto ref M doc_matters,
diff --git a/src/sdp/output/hub.d b/src/sdp/output/hub.d
index 47713f5..75be424 100644
--- a/src/sdp/output/hub.d
+++ b/src/sdp/output/hub.d
@@ -14,132 +14,64 @@ template outputHub() {
sdp.output.paths_output;
void outputHub(D,I)(D doc_abstraction, I doc_matters) {
mixin SiSUoutputRgxInit;
+ mixin Msg;
+ auto msg = Msg!()(doc_matters);
static auto rgx = Rgx();
- debug (substitutions) {
- enum Substitute { match, markup, html, }
- writeln(__LINE__, ":", __FILE__, ": DEBUG substitutions:");
- writeln("Doc Title: ", doc_matters.conf_make_meta.meta.title_full);
- if (doc_matters.conf_make_meta.make.bold) {
- writeln("regex to match: ", doc_matters.conf_make_meta.make.bold[Substitute.match]);
- writeln("substitution to make: ", doc_matters.conf_make_meta.make.bold[Substitute.html]);
-
- auto _w = "1. Debian test string. Debian again. (the problem) do not use initialized only not repopulated"
- .replaceAll(
- regex(doc_matters.conf_make_meta.make.bold[Substitute.match]),
- doc_matters.conf_make_meta.make.bold[Substitute.html]
- );
- writeln(_w);
-
- writeln("2a. Debian test string. Debian again. (the problem) do not use initialized only not repopulated"
- .replaceAll(
- regex(doc_matters.conf_make_meta.make.bold[Substitute.match]),
- doc_matters.conf_make_meta.make.bold[Substitute.html]
- ));
-
- auto _v = regex(doc_matters.conf_make_meta.make.bold[Substitute.match]);
- writeln("2b. Debian test string. Debian again. (the problem) do not use initialized only not repopulated"
- .replaceAll(
- _v,
- doc_matters.conf_make_meta.make.bold[Substitute.html]
- ));
- }
- }
if (doc_matters.opt.action.verbose) {
writeln(doc_matters.xml.keys_seq.seg);
}
if ((doc_matters.opt.action.source)
|| (doc_matters.opt.action.sisupod)) {
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.source)) {
- writeln("sisu source processing... ");
+ if (doc_matters.opt.action.source) {
+ msg.v("sisu source processing...");
}
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.sisupod)) {
- writeln("sisupod source processing... ");
+ if (doc_matters.opt.action.sisupod) {
+ msg.v("sisupod source processing...");
}
SiSUpod!()(doc_matters);
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)
- && (doc_matters.opt.action.source)) {
- writeln("sisu source done");
- }
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)
- && (doc_matters.opt.action.sisupod)) {
- writeln("sisupod done");
+ if (doc_matters.opt.action.source) {
+ msg.vv("sisu source done");
}
- }
- if (doc_matters.opt.action.text) {
- /+ mixin outputText; +/
- if ((doc_matters.opt.action.verbose)) {
- writeln("text processing... ");
+ if (doc_matters.opt.action.sisupod) {
+ msg.v("sisupod source done");
}
}
if (doc_matters.opt.action.html_seg) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("html seg processing... ");
- }
+ msg.v("html seg source processing...");
outputHTML!().seg(doc_abstraction, doc_matters);
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)) {
- writeln("html seg done");
- }
- outputHTML!().css(doc_matters);
- outputHTML!().images_cp(doc_matters);
+ msg.vv("html seg done");
}
if (doc_matters.opt.action.html_scroll) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("html scroll processing... ");
- }
+ msg.v("html scroll source processing...");
outputHTML!().scroll(doc_abstraction, doc_matters);
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)) {
- writeln("html scroll done");
- }
+ msg.vv("html scroll done");
+ }
+ if (doc_matters.opt.action.html_stuff) {
+ msg.v("html copying images & css...");
outputHTML!().css(doc_matters);
outputHTML!().images_cp(doc_matters);
+ msg.vv("html css & images done");
}
if (doc_matters.opt.action.epub) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("epub3 processing... ");
- }
+ msg.v("epub3 source processing...");
outputEPub3!()(doc_abstraction, doc_matters);
- // epub.css_write;
- if ((doc_matters.opt.action.verbose)
- && (doc_matters.opt.action.debug_do)) {
- writeln("epub3 done");
- }
- }
- if (doc_matters.opt.action.pdf) {
- /+ mixin outputPDF; +/
- writeln("pdf processing");
- }
- if (doc_matters.opt.action.odt) {
- /+ mixin outputODT; +/
- writeln("odt processing");
+ msg.vv("epub3 done");
}
if (doc_matters.opt.action.sqlite_discrete) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("sqlite processing... ");
- }
+ msg.v("sqlite processing...");
SQLiteHubDiscreteBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
+ msg.vv("sqlite done");
}
if (doc_matters.opt.action.sqlite_insert
|| doc_matters.opt.action.sqlite_update
) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("sqlite processing... ");
- }
+ msg.v("sqlite update processing...");
SQLiteHubBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
+ msg.vv("sqlite update done");
} else if (doc_matters.opt.action.sqlite_delete) {
- if ((doc_matters.opt.action.verbose)) {
- writeln("sqlite processing... ");
- }
+ msg.v("sqlite delete processing...");
SQLiteHubBuildTablesAndPopulate!()(doc_abstraction, doc_matters);
- }
- if (doc_matters.opt.action.postgresql) {
- /+ mixin outputPostgreSQL; +/
- writeln("pgsql processing");
+ msg.vv("sqlite delete done");
}
}
}
@@ -157,15 +89,21 @@ template outputHubOp() {
static auto rgx = Rgx();
if ((opt_action.sqlite_db_drop)) {
if ((opt_action.verbose)) {
- writeln("sqlite drop db... ");
+ writeln("sqlite drop db...");
}
SQLiteDbDrop!()(opt_action);
+ if ((opt_action.very_verbose)) {
+ writeln("sqlite drop db done");
+ }
}
if ((opt_action.sqlite_db_create)) {
if ((opt_action.verbose)) {
- writeln("sqlite create table... ");
+ writeln("sqlite create table...");
}
SQLiteTablesCreate!()(env, opt_action);
+ if ((opt_action.very_verbose)) {
+ writeln("sqlite create table done");
+ }
}
}
}
diff --git a/src/sdp/output/package.d b/src/sdp/output/package.d
index 2aa6544..40b4c20 100644
--- a/src/sdp/output/package.d
+++ b/src/sdp/output/package.d
@@ -15,6 +15,7 @@ public import
// std.uni,
std.utf;
public import
+ sdp.share.defaults,
sdp.source.paths_source,
sdp.output.defaults,
sdp.output.paths_output,
diff --git a/src/sdp/output/paths_output.d b/src/sdp/output/paths_output.d
index 3b18c75..112f47c 100644
--- a/src/sdp/output/paths_output.d
+++ b/src/sdp/output/paths_output.d
@@ -236,8 +236,6 @@ template SiSUpathsSQLiteDiscrete() {
auto out_pth = SiSUoutPaths!()(output_pth_root, lng);
string base_dir = "sqlite";
return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array;
- // return asNormalizedPath((out_pth.output_root).chainPath(base_dir)).array; // single file for each file, multiple languages
- // return asNormalizedPath((out_pth.output_base).chainPath(base_dir)).array; // separate files for each language
}
string seg(string fn_src) {
return asNormalizedPath(base.chainPath(base_filename(fn_src))).array;
diff --git a/src/sdp/output/source_sisupod.d b/src/sdp/output/source_sisupod.d
index 97077de..44cf56b 100644
--- a/src/sdp/output/source_sisupod.d
+++ b/src/sdp/output/source_sisupod.d
@@ -124,14 +124,14 @@ template SiSUpod() {
writeln("WARNING (io) src out NOT found (document make): ", fn_src_in);
}
}
- } { /+ TODO bundle primary file +/
+ } { /+ bundle primary file +/
auto fn_src_in = doc_matters.src.file_with_absolute_path.to!string;
auto fn_src_out_sisupod_zip_base
= pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).zpod.to!string;
auto fn_src_out_filesystem
- = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.to!string; // needed without root path:
+ = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).filesystem_open_zpod.to!string; // without root path:
auto fn_src_out_inside_pod
- = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).zpod.to!string; // needed without root path:
+ = pths_sisupod.fn_doc(doc_matters.src.filename, doc_matters.src.language).zpod.to!string; // without root path:
string[] filelist_src_out_sisupod_arr;
string[] filelist_src_zpod_arr;
if (exists(fn_src_in)) {
diff --git a/src/sdp/output/sqlite.d b/src/sdp/output/sqlite.d
index 41d504e..0221264 100644
--- a/src/sdp/output/sqlite.d
+++ b/src/sdp/output/sqlite.d
@@ -47,7 +47,9 @@ template SQLiteHubBuildTablesAndPopulate() {
}
db.close;
}
- writeln(" ", pth_sqlite.sqlite_file);
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", pth_sqlite.sqlite_file);
+ }
}
}
SQLiteDbStatementComposite!()(db, doc_abstraction, doc_matters);
@@ -77,7 +79,9 @@ template SQLiteHubDiscreteBuildTablesAndPopulate() {
}
db.close;
}
- writeln(" ", pth_sqlite.sqlite_file(doc_matters.src.filename));
+ if (!(doc_matters.opt.action.quiet)) {
+ writeln(" ", pth_sqlite.sqlite_file(doc_matters.src.filename));
+ }
}
}
SQLiteDiscreteDbStatementComposite!()(db, doc_abstraction, doc_matters);
@@ -589,8 +593,8 @@ template SQLiteTablesReCreate() {
DROP TABLE IF EXISTS urls;
CREATE TABLE metadata_and_text (
uid VARCHAR(256) UNIQUE, /* filename, language char, pod/txt (decide on delimiter [,;:/]) */
- src_composite_id_per_txt VARCHAR(256) NOT NULL, /* UNIQUE, /* z pod name if any + src filename + language code */
- src_composite_id_per_pod VARCHAR(256) NOT NULL, /* z pod name if any + src filename */
+ src_composite_id_per_txt VARCHAR(256) NOT NULL, /* UNIQUE, /* z pod name if any + src filename + language code */
+ src_composite_id_per_pod VARCHAR(256) NOT NULL, /* z pod name if any + src filename */
title VARCHAR(800) NOT NULL,
title_main VARCHAR(400) NOT NULL,
title_sub VARCHAR(400) NULL,
@@ -945,12 +949,12 @@ template SQLiteInsertDocObjectsLoop() {
break;
}
break;
- case "body": // assert(part == "body", part); // TODO broken
+ case "body": // assert(part == "body", part);
switch (obj.metainfo.is_of_type) {
case "para":
switch (obj.metainfo.is_a) {
case "heading":
- debug (asserts) { // TODO consider and fix or remove
+ debug (asserts) {
if (part != "body") {
writeln(__LINE__, ": ", obj.text);
}
@@ -1048,7 +1052,7 @@ template SQLiteInsertDocObjectsLoop() {
break;
}
if (obj.metainfo.is_a == "heading") {
- if ((doc_matters.opt.action.verbose)) {
+ if ((doc_matters.opt.action.very_verbose)) {
writeln(
"markup: ", obj.metainfo.heading_lev_markup,
"> ", obj.metainfo.dom_structure_markedup_tags_status,
@@ -1092,8 +1096,8 @@ template SQLiteTablesCreate() {
DROP TABLE IF EXISTS urls;
CREATE TABLE metadata_and_text (
uid VARCHAR(256) UNIQUE, /* filename, language char, pod/txt (decide on delimiter [,;:/]) */
- src_composite_id_per_txt VARCHAR(256) NOT NULL, /* UNIQUE, /* z pod name if any + src filename + language code */
- src_composite_id_per_pod VARCHAR(256) NOT NULL, /* z pod name if any + src filename */
+ src_composite_id_per_txt VARCHAR(256) NOT NULL, /* UNIQUE, /* z pod name if any + src filename + language code */
+ src_composite_id_per_pod VARCHAR(256) NOT NULL, /* z pod name if any + src filename */
title VARCHAR(800) NOT NULL,
title_main VARCHAR(400) NOT NULL,
title_sub VARCHAR(400) NULL,
@@ -1212,9 +1216,9 @@ template SQLiteTablesCreate() {
}
if (opt_action.sqlite_db_create) {
string _db_statement;
- auto pth_sqlite = SiSUpathsSQLite!()(opt_action.sqlite_filename, opt_action.output_dir_set); // ISSUE
+ auto pth_sqlite = SiSUpathsSQLite!()(opt_action.sqlite_filename, opt_action.output_dir_set);
pth_sqlite.base.mkdirRecurse;
- auto db = Database(pth_sqlite.sqlite_file); // ISSUE
+ auto db = Database(pth_sqlite.sqlite_file);
{
_db_statement ~= SQLiteTablesReCreate!()();
}
@@ -1226,7 +1230,7 @@ template SQLiteDbDrop() {
void SQLiteDbDrop(O)(O opt_action) {
writeln("db drop");
if ((opt_action.sqlite_db_drop)) {
- auto pth_sqlite = SiSUpathsSQLite!()(opt_action.sqlite_filename, opt_action.output_dir_set); // ISSUE
+ auto pth_sqlite = SiSUpathsSQLite!()(opt_action.sqlite_filename, opt_action.output_dir_set);
writeln("remove(", pth_sqlite.sqlite_file, ")");
try {
remove(pth_sqlite.sqlite_file);
diff --git a/src/sdp/output/xmls.d b/src/sdp/output/xmls.d
index 874329f..32b46e5 100644
--- a/src/sdp/output/xmls.d
+++ b/src/sdp/output/xmls.d
@@ -326,7 +326,7 @@ template outputXHTMLs() {
_img_pth = "../../../image/";
}
if (_txt.match(rgx.inline_image)) {
- _txt = _txt.replaceAll( // TODO bug where image dimensions (w or h) not given & consequently set to 0; should not be used (calculate earlier, abstraction)
+ _txt = _txt.replaceAll(
rgx.inline_image,
("$1<img src=\""
~ _img_pth
diff --git a/src/sdp/sdp.d b/src/sdp/sdp.d
index 50df3f2..20b2228 100755
--- a/src/sdp/sdp.d
+++ b/src/sdp/sdp.d
@@ -62,17 +62,13 @@ void main(string[] args) {
"concordance" : false,
"debug" : false,
"digest" : false,
- "docbook" : false,
"epub" : false,
"html" : false,
"html-seg" : false,
"html-scroll" : false,
"manifest" : false,
"ocn" : true,
- "odt" : false,
- "pdf" : false,
- "postgresql" : false,
- "qrcode" : false,
+ "quiet" : false,
"sisupod" : false,
"source" : false,
"sqlite-discrete" : false,
@@ -84,9 +80,8 @@ void main(string[] args) {
"sqlite-update" : false,
"text" : false,
"verbose" : false,
+ "very-verbose" : false,
"xhtml" : false,
- "xml-dom" : false,
- "xml-sax" : false,
"section_toc" : true,
"section_body" : true,
"section_endnotes" : true,
@@ -105,52 +100,46 @@ void main(string[] args) {
];
auto helpInfo = getopt(args,
std.getopt.config.passThrough,
- "abstraction", "--abstraction document abstraction ", &opts["abstraction"],
- "assert", "--assert set optional assertions on", &opts["assertions"],
- "concordance", "--concordance file for document", &opts["concordance"],
- "debug", "--debug", &opts["debug"],
- "digest", "--digest hash digest for each object", &opts["digest"],
- "docbook", "--docbook process docbook output", &opts["docbook"],
- "epub", "--epub process epub output", &opts["epub"],
- "html", "--html process html output", &opts["html"],
- "html-seg", "--html-seg process html output", &opts["html-seg"],
- "html-scroll", "--html-seg process html output", &opts["html-scroll"],
- "manifest", "--manifest process manifest output", &opts["manifest"],
- "ocn", "--ocn object cite numbers (default)", &opts["ocn"],
- "odf", "--odf process odf:odt output", &opts["odt"],
- "odt", "--odt process odf:odt output", &opts["odt"],
- "pdf", "--pdf process pdf output", &opts["pdf"],
- "pg", "--pg process postgresql output", &opts["postgresql"],
- "postgresql", "--postgresql process postgresql output", &opts["postgresql"],
- "qrcode", "--qrcode with document metadata", &opts["qrcode"],
- "sisupod", "--sisupod sisupod source content bundled", &opts["sisupod"],
- "source", "--source markup source text content", &opts["source"],
- "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"],
- "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"],
- "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"],
- "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"],
- "sqlite-delete", "--sqlite process sqlite output", &opts["sqlite-delete"],
- "sqlite-insert", "--sqlite process sqlite output", &opts["sqlite-insert"],
- "sqlite-update", "--sqlite process sqlite output", &opts["sqlite-update"],
- "text", "--text process text output", &opts["text"],
- "txt", "--txt process text output", &opts["text"],
- "verbose|v", "--verbose output to terminal", &opts["verbose"],
- "xhtml", "--xhtml process xhtml output", &opts["xhtml"],
- "xml-dom", "--xml-dom process xml dom output", &opts["xml-dom"],
- "xml-sax", "--xml-sax process xml sax output", &opts["xml-sax"],
- "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"],
- "section-body", "--section-body process document body (default)", &opts["section_body"],
- "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"],
- "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"],
- "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"],
- "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"],
- "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"],
- "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"],
- "skip-output", "--skip-output", &opts["skip-output"],
- "output-dir", "--output-dir=[dir path]", &settings["output-dir"],
- "site-config-dir", "--site-config-dir=[dir path]", &settings["site-config-dir"],
- "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"],
- "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"],
+ "abstraction", "--abstraction document abstraction ", &opts["abstraction"],
+ "assert", "--assert set optional assertions on", &opts["assertions"],
+ "concordance", "--concordance file for document", &opts["concordance"],
+ "debug", "--debug", &opts["debug"],
+ "digest", "--digest hash digest for each object", &opts["digest"],
+ "epub", "--epub process epub output", &opts["epub"],
+ "html", "--html process html output", &opts["html"],
+ "html-seg", "--html-seg process html output", &opts["html-seg"],
+ "html-scroll", "--html-seg process html output", &opts["html-scroll"],
+ "manifest", "--manifest process manifest output", &opts["manifest"],
+ "ocn", "--ocn object cite numbers (default)", &opts["ocn"],
+ "quiet", "--quiet output to terminal", &opts["quiet"],
+ "sisupod", "--sisupod sisupod source content bundled", &opts["sisupod"],
+ "source", "--source markup source text content", &opts["source"],
+ "sqlite-discrete", "--sqlite process discrete sqlite output", &opts["sqlite-discrete"],
+ "sqlite-db-create", "--sqlite-db-create create db, create tables", &opts["sqlite-db-create"],
+ "sqlite-db-drop", "--sqlite-db-drop drop tables & db", &opts["sqlite-db-drop"],
+ "sqlite-db-recreate", "--sqlite-db-recreate create db, create tables", &opts["sqlite-db-recreate"],
+ // "sqlite-db-populate", "--sqlite-db-populate create db & tables, insert specified", &opts["sqlite-db-populate"],
+ "sqlite-delete", "--sqlite process sqlite output", &opts["sqlite-delete"],
+ "sqlite-insert", "--sqlite process sqlite output", &opts["sqlite-insert"],
+ "sqlite-update", "--sqlite process sqlite output", &opts["sqlite-update"],
+ "text", "--text process text output", &opts["text"],
+ "txt", "--txt process text output", &opts["text"],
+ "verbose|v", "--verbose output to terminal", &opts["verbose"],
+ "very-verbose", "--very-verbose output to terminal", &opts["very-verbose"],
+ "xhtml", "--xhtml process xhtml output", &opts["xhtml"],
+ "section-toc", "--section-toc process table of contents (default)", &opts["section_toc"],
+ "section-body", "--section-body process document body (default)", &opts["section_body"],
+ "section-endnotes", "--section-endnotes process document endnotes (default)", &opts["section_endnotes"],
+ "section-glossary", "--section-glossary process document glossary (default)", &opts["section_glossary"],
+ "section-biblio", "--section-biblio process document biblio (default)", &opts["section_biblio"],
+ "section-bookindex", "--section-bookindex process document bookindex (default)", &opts["section_bookindex"],
+ "section-blurb", "--section-blurb process document blurb (default)", &opts["section_blurb"],
+ "backmatter", "--section-backmatter process document backmatter (default)", &opts["backmatter"],
+ "skip-output", "--skip-output", &opts["skip-output"],
+ "output-dir", "--output-dir=[dir path]", &settings["output-dir"],
+ "site-config-dir", "--site-config-dir=[dir path]", &settings["site-config-dir"],
+ "sqlite-filename", "--sqlite-filename=[filename].sqlite", &settings["sqlite-filename"],
+ "lang", "--lang=[lang code e.g. =en or =en,es]", &settings["lang"],
);
if (helpInfo.helpWanted) {
defaultGetoptPrinter("Some information about the program.", helpInfo.options);
@@ -168,41 +157,45 @@ void main(string[] args) {
auto digest() {
return opts["digest"];
}
- auto docbook() {
- return opts["docbook"];
- }
auto epub() {
return opts["epub"];
}
auto html() {
- bool _is;
- if (
+ bool _is = (
opts["html"]
|| opts["html-seg"]
|| opts["html-scroll"]
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
auto html_seg() {
- bool _is;
- if (
+ bool _is = (
opts["html"]
|| opts["html-seg"]
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
auto html_scroll() {
- bool _is;
- if (
+ bool _is = (
+ opts["html"]
+ || opts["html-scroll"]
+ )
+ ? true
+ : false;
+ return _is;
+ }
+ auto html_stuff() {
+ bool _is = (
opts["html"]
|| opts["html-scroll"]
- ) {
- _is = true;
- } else { _is = false; }
+ || opts["html-seg"]
+ )
+ ? true
+ : false;
return _is;
}
auto manifest() {
@@ -211,17 +204,8 @@ void main(string[] args) {
auto ocn() {
return opts["ocn"];
}
- auto odt() {
- return opts["odt"];
- }
- auto pdf() {
- return opts["pdf"];
- }
- auto postgresql() {
- return opts["postgresql"];
- }
- auto qrcode() {
- return opts["qrcode"];
+ auto quiet() {
+ return opts["quiet"];
}
auto sisupod() {
return opts["sisupod"];
@@ -233,23 +217,21 @@ void main(string[] args) {
return opts["sqlite-discrete"];
}
auto sqlite_db_drop() {
- bool _is;
- if (
+ bool _is = (
opts["sqlite-db-recreate"]
|| opts["sqlite-db-drop"]
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
auto sqlite_db_create() {
- bool _is;
- if (
+ bool _is = (
opts["sqlite-db-recreate"]
|| opts["sqlite-db-create"]
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
auto sqlite_insert() {
@@ -265,17 +247,20 @@ void main(string[] args) {
return opts["text"];
}
auto verbose() {
- return opts["verbose"];
+ bool _is = (
+ opts["verbose"]
+ || opts["very-verbose"]
+ )
+ ? true
+ : false;
+ return _is;
+ }
+ auto very_verbose() {
+ return opts["very-verbose"];
}
auto xhtml() {
return opts["xhtml"];
}
- auto xml_dom() {
- return opts["xml-dom"];
- }
- auto xml_sax() {
- return opts["xml-sax"];
- }
auto section_toc() {
return opts["section_toc"];
}
@@ -313,29 +298,21 @@ void main(string[] args) {
return settings["sqlite-filename"];
}
auto abstraction() {
- bool _is;
- if (
+ bool _is = (
opts["abstraction"]
|| concordance
- || docbook
|| epub
|| html
|| manifest
- || odt
- || pdf
- || postgresql
- || qrcode
|| sisupod
|| source
|| sqlite_discrete
|| sqlite_delete
|| sqlite_insert
|| sqlite_update
- || text
- || xhtml
- ) {
- _is = true;
- } else { _is = false; }
+ )
+ ? true
+ : false;
return _is;
}
}
@@ -411,7 +388,7 @@ void main(string[] args) {
_manifests ~= _manifest_matter;
}
} else if (arg.match(rgx.src_pth_zip)) {
- // fns_src ~= arg; // gather input markup source file names for processing
+ // fns_src ~= arg; // gather input markup source file names for processing
} else { // anything remaining, unused
arg_unrecognized ~= " " ~ arg;
}
@@ -429,7 +406,7 @@ void main(string[] args) {
foreach(manifest; _manifests[1..$]) {
if (!empty(manifest.src.filename)) {
scope(success) {
- debug(checkdoc) {
+ if (!(_opt_action.quiet)) {
writefln(
"%s\n%s",
"~ document complete, ok ~",
@@ -483,7 +460,7 @@ void main(string[] args) {
}
}
scope(exit) {
- debug(checkdoc) {
+ if (!(_opt_action.quiet)) {
writefln(
"processed file: %s",
manifest.src.filename
diff --git a/src/sdp/share/defaults.d b/src/sdp/share/defaults.d
new file mode 100644
index 0000000..ed76846
--- /dev/null
+++ b/src/sdp/share/defaults.d
@@ -0,0 +1,22 @@
+/++
+ shared default settings
++/
+module sdp.share.defaults;
+template Msg() {
+ import std.stdio;
+ auto Msg(I)(I doc_matters) {
+ struct Msg_ {
+ void v()(string message) {
+ if (!(doc_matters.opt.action.quiet) && doc_matters.opt.action.verbose) {
+ writeln(message);
+ }
+ }
+ void vv()(string message) {
+ if (!(doc_matters.opt.action.quiet) && doc_matters.opt.action.very_verbose) {
+ writeln(message);
+ }
+ }
+ }
+ return Msg_();
+ }
+}
diff --git a/src/sdp/source/paths_source.d b/src/sdp/source/paths_source.d
index 5637c80..462fc85 100644
--- a/src/sdp/source/paths_source.d
+++ b/src/sdp/source/paths_source.d
@@ -241,7 +241,7 @@ template PathMatters() {
}
string base_dir() {
string _dir;
- if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ if (
auto m = (absolute_path_to_src)
.match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
) {
@@ -259,7 +259,7 @@ template PathMatters() {
}
string base_parent_dir_path() {
string _dir;
- if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ if (
auto m = (absolute_path_to_src)
.match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
) {
@@ -276,7 +276,7 @@ template PathMatters() {
.match(rgx.src_formalised_file_path_parts)
) {
_dir = asNormalizedPath(m.captures["pth"]).array;
- } else if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ } else if (
auto m = (absolute_path_to_src)
.match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
) {
@@ -322,7 +322,7 @@ template PathMatters() {
}
auto base_parent_dir() {
string _dir;
- if ( // TODO this should catch generated --source sisupod, untested, needs manifest
+ if (
auto m = (absolute_path_to_src)
.match(regex(r"[/](?P<dir>(?:[a-zA-Z0-9._-]+))/sisupod/" ~ filename.stripExtension))
) {
diff --git a/src/sdp/source/read_config_files.d b/src/sdp/source/read_config_files.d
index 56ba065..7e6221e 100644
--- a/src/sdp/source/read_config_files.d
+++ b/src/sdp/source/read_config_files.d
@@ -115,7 +115,6 @@ static template readConfigSite() {
if (exists(conf_file)) {
debug(io) {
writeln("WARNING (io debug) in config file found: ", conf_file);
- // writeln(__LINE__, ": found: ", conf_file, " in ", pth);
}
config_file_str = conf_file.readText;
break;