aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/meta
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-11-06 09:12:06 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitf9257293164f7681243e35b9608a4cb6c2d3e16b (patch)
tree74e8887aaccec6d0fd999c24e6a6666eabae685a /src/sdp/meta
parentsqlite document db discrete & collection, started (diff)
Diffstat (limited to 'src/sdp/meta')
-rw-r--r--src/sdp/meta/conf_make_meta_sdlang.d2
-rw-r--r--src/sdp/meta/metadoc.d26
-rw-r--r--src/sdp/meta/metadoc_from_src.d19
3 files changed, 42 insertions, 5 deletions
diff --git a/src/sdp/meta/conf_make_meta_sdlang.d b/src/sdp/meta/conf_make_meta_sdlang.d
index 478cea4..728f095 100644
--- a/src/sdp/meta/conf_make_meta_sdlang.d
+++ b/src/sdp/meta/conf_make_meta_sdlang.d
@@ -210,7 +210,7 @@ static template SiSUextractSDLang() {
_conf_composite.meta.title_main =
to!string(_maintag.getTagValues("main"));
} else if ("main" !in _maintag.maybe.attributes) {
- writeln(__LINE__, ": ", _maintag.values[0]);
+ writeln(_maintag.values[0]); // document title
_conf_composite.meta.title_main =
(_maintag.values[0]).to!string; // test that this exists
}
diff --git a/src/sdp/meta/metadoc.d b/src/sdp/meta/metadoc.d
index e302db8..b2f6270 100644
--- a/src/sdp/meta/metadoc.d
+++ b/src/sdp/meta/metadoc.d
@@ -1,10 +1,10 @@
module sdp.meta.metadoc;
template SiSUabstraction() {
- import sdp.meta;
import
std.getopt,
std.process;
import
+ sdp.meta,
sdp.meta.metadoc_summary,
sdp.meta.metadoc_from_src,
sdp.meta.conf_make_meta,
@@ -39,19 +39,34 @@ template SiSUabstraction() {
auto conf_files_composite_make = confFilesSDLtoStruct!()(sdl_root_config_share, sdl_root_config_local);
/+ ↓ read file (filename with path) +/
/+ ↓ file tuple of header and content +/
+ debug(steps) {
+ writeln(__LINE__, ":", __FILE__, ": step1 commence → (get document header & body & insert files)");
+ }
auto _header_body_inserts =
SiSUrawMarkupContent!()(fn_src);
static assert(!isTypeTuple!(_header_body_inserts));
static assert(_header_body_inserts.length==3);
+ debug(steps) {
+ writeln(__LINE__, ":", __FILE__, ": step1 complete");
+ }
debug(header_and_body) {
writeln(header);
writeln(_header_body_inserts.length);
writeln(_header_body_inserts.length[headBody.body_content][0]);
}
/+ ↓ split header into make and meta +/
+ debug(steps) {
+ writeln(__LINE__, ":", __FILE__, ": step2 commence → (doc header: make & meta as struct)");
+ }
auto _make_and_meta_struct =
docHeaderMakeAndMetaTupExtractAndConvertToStruct!()(conf_files_composite_make, _header_body_inserts[headBody.header]); // breakage ...
+ debug(steps) {
+ writeln(__LINE__, ":", __FILE__, ": step2 complete");
+ }
/+ ↓ document abstraction: process document, return abstraction as tuple +/
+ debug(steps) {
+ writeln(__LINE__, ":", __FILE__, ": step3 commence → (document abstraction (da); da keys; segnames; doc_matters)");
+ }
auto da = SiSUdocAbstraction!()(
_header_body_inserts[headBody.body_content],
_make_and_meta_struct,
@@ -64,6 +79,12 @@ template SiSUabstraction() {
string[] _doc_html_segnames = da[docAbst.segnames];
string[] _doc_epub_segnames_0_4 = da[docAbst.segnames_0_4];
auto _images = da[docAbst.images];
+ debug(steps) {
+ writeln(__LINE__, ":", __FILE__, ": step3 complete");
+ }
+ debug(steps) {
+ writeln(__LINE__, ":", __FILE__, ": step4 commence → (doc_matters)");
+ }
struct DocumentMatters {
auto keys_seq() {
/+ contains .seg & .scroll sequences +/
@@ -118,6 +139,9 @@ template SiSUabstraction() {
}
}
auto doc_matters = DocumentMatters();
+ debug(steps) {
+ writeln(__LINE__, ":", __FILE__, ": step4 complete");
+ }
auto t = tuple(doc_abstraction, doc_matters);
static assert(t.length==2);
return t;
diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d
index 80de1f2..24c4699 100644
--- a/src/sdp/meta/metadoc_from_src.d
+++ b/src/sdp/meta/metadoc_from_src.d
@@ -1365,7 +1365,10 @@ template SiSUdocAbstraction() {
segnames_0_4 ~= obj.segment_anchor_tag;
}
if (obj.heading_lev_markup == 0) {
- assert( obj.ocn == 1, "Title OCN should be 1 not: " ~ obj.ocn.to!string); // bug introduced 0.18.1
+ /+ TODO second hit (of two) with same assertion failure, check, fix and reinstate
+ assert( obj.ocn == 1,
+ "Title OCN should be 1 not: " ~ obj.ocn.to!string); // bug introduced 0.18.1
+ +/
obj.ocn = 1;
obj.obj_cite_number = "1";
obj.obj_cite_number_type = OCNtype.ocn;
@@ -1672,7 +1675,10 @@ template SiSUdocAbstraction() {
obj.obj_cite_number_type = OCNtype.bkidx;
}
}
- assert(obj_cite_digit_bkidx == ocn_bidx_);
+ /+ TODO assert failure, reinstate
+ assert(obj_cite_digit_bkidx == ocn_bidx_
+ obj_cite_digit_bkidx ~ " == ocn_" ~ ocn_ ~ "?");
+ +/
}
/+ optional only one 1~ level +/
if (the_blurb_section.length > 1) {
@@ -5399,7 +5405,14 @@ template SiSUdocAbstraction() {
);
if (lev_markup_number.match(rgx.levels_numbered)) {
if (lev_markup_number.to!int == 0) {
- assert(obj_cite_digits.on.to!int == 1);
+ /+ TODO first hit (of two) with this assertion failure, check, fix & reinstate
+ assert(obj_cite_digits.on.to!int == 1,
+ "ERROR header lev markup number is: " ~
+ lev_markup_number.to!string ~
+ " obj_cite_digits.on.to!int should == 1 but is: " ~
+ obj_cite_digits.on.to!string ~
+ "\n" ~ _text);
+ +/
}
}
}