aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/doc_reform.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/doc_reform.org')
-rw-r--r--org/doc_reform.org104
1 files changed, 46 insertions, 58 deletions
diff --git a/org/doc_reform.org b/org/doc_reform.org
index 32b08be..5b1fc23 100644
--- a/org/doc_reform.org
+++ b/org/doc_reform.org
@@ -27,7 +27,7 @@ struct Version {
int minor;
int patch;
}
-enum _ver = Version(0, 6, 0);
+enum _ver = Version(0, 7, 0);
#+END_SRC
** compilation restrictions (supported compilers)
@@ -583,6 +583,7 @@ struct OptActions {
|| manifest
|| pod
|| source
+ || sqlite_discrete
) {
_is = true;
} else { _is = false; }
@@ -932,7 +933,7 @@ template DocReformAbstraction() {
<<doc_reform_mixin>>
enum headBody { header, body_content, insert_file_list, image_list }
enum makeMeta { make, meta }
- enum docAbst { doc_abstraction, section_keys, segnames, segnames_0_4, tag_assoc, images }
+ enum docAbst { doc_abstract_obj, doc_has }
static auto rgx = Rgx();
auto DocReformAbstraction(E,P,O,M)(
E _env,
@@ -1068,17 +1069,9 @@ auto da = DocReformDocAbstraction!()(
true,
);
static assert(!isTypeTuple!(da));
-static assert(da.length==6);
-auto doc_abstraction = da[docAbst.doc_abstraction]; /+ head ~ toc ~ body ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~ blurb; +/
-auto _document_section_keys_sequenced = da[docAbst.section_keys];
-string[] _doc_html_segnames = da[docAbst.segnames];
-string[] _doc_epub_segnames_0_4 = da[docAbst.segnames_0_4];
-debug(segnames) {
- writeln("segnames lv4: ", _doc_html_segnames);
- writeln("segnames lv0 to 4: ", _doc_epub_segnames_0_4);
-}
-auto _doc_tag_assoc = da[docAbst.tag_assoc];
-auto _images = da[docAbst.images];
+static assert(da.length==2);
+auto doc_abstraction = da[docAbst.doc_abstract_obj]; /+ head ~ toc ~ body ~ endnotes_seg ~ glossary ~ bibliography ~ bookindex ~ blurb; +/
+auto _doc_has_struct = da[docAbst.doc_has];
if ((_opt_action.debug_do)
|| (_opt_action.very_verbose)
) {
@@ -1151,6 +1144,9 @@ struct DocumentMatters {
auto conf_make_meta() { // TODO meld with all make instructions
return _make_and_meta_struct;
}
+ auto has() {
+ return _doc_has_struct;
+ }
#+END_SRC
**** env related
@@ -1198,17 +1194,6 @@ struct DocumentMatters {
auto src_path_info() {
return DocReformPathsSRC!()(_manifest.env.pwd, _manifest.src.file_with_absolute_path); // would like (to have and use) relative path
}
- auto srcs() {
- struct SRC_ {
- auto file_insert_list() {
- return _header_body_insertfilelist_imagelist[headBody.insert_file_list];
- }
- auto image_list() {
- return _images;
- }
- }
- return SRC_();
- }
auto pod() {
return _manifest.pod;
}
@@ -1220,26 +1205,19 @@ struct DocumentMatters {
}
return SQLite_();
}
- auto xml() {
- struct XML_ {
- auto keys_seq() {
- /+ contains .seg & .scroll sequences +/
- return _document_section_keys_sequenced;
- }
- string[] segnames() {
- return _doc_html_segnames;
- }
- string[] segnames_lv_0_to_4() {
- return _doc_epub_segnames_0_4;
+ auto output_path() {
+ return _manifest.output.path;
+ }
+ auto srcs() {
+ struct SRC_ {
+ auto file_insert_list() {
+ return _header_body_insertfilelist_imagelist[headBody.insert_file_list];
}
- auto tag_associations() {
- return _doc_tag_assoc;
+ auto image_list() {
+ return _doc_has_struct.imagelist;
}
}
- return XML_();
- }
- auto output_path() {
- return _manifest.output.path;
+ return SRC_();
}
#+END_SRC
@@ -1320,7 +1298,7 @@ string[string] check = [
"last_object_number_body" : "0",
"last_object_number_book_index" : "0",
];
-foreach (k; doc_matters.xml.keys_seq.seg) {
+foreach (k; doc_matters.has.keys_seq.seg) {
foreach (obj; doc_abstraction[k]) {
if (obj.metainfo.is_of_part != "empty") {
if (!empty(obj.metainfo.object_number)) {
@@ -1352,48 +1330,58 @@ char_repeat_number = (char_repeat_number > min_repeat_number)
? char_repeat_number
: min_repeat_number;
writefln(
- "%s\n\"%s\", %s\n%s\n%s\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n(%s: %s)\n%s",
+ "%s\n\"%s\", %s\n%s\n%s\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%30-s%10-d\n%s",
markup.repeat_character_by_number_provided("-", char_repeat_number),
doc_matters.conf_make_meta.meta.title_full,
doc_matters.conf_make_meta.meta.creator_author,
doc_matters.src.filename,
markup.repeat_character_by_number_provided("-", char_repeat_number),
- "length toc arr:",
+ "- toc arr length:",
to!int(doc_abstraction["toc"].length),
- "length doc_abstraction arr:",
+ "- doc_abstraction arr length:",
to!int(doc_abstraction["body"].length),
- "last doc body ocn:",
+ " doc body last obj on.#:",
to!int(check["last_object_number_body"]),
- "last object_number:",
- to!int(check["last_object_number"]),
- "length endnotes:", // subtract headings
+ " - number of tables:",
+ doc_matters.has.tables,
+ " - number of codeblocks:",
+ doc_matters.has.codeblocks,
+ " - number of poems:",
+ doc_matters.has.poems,
+ " - number of blocks:",
+ doc_matters.has.blocks,
+ " - number of groups:",
+ doc_matters.has.groups,
+ " - number of images:",
+ doc_matters.has.images,
+ "- endnotes length:", // subtract headings
(doc_abstraction["endnotes"].length > 2)
? (to!int(doc_abstraction["endnotes"].length - 2))
: 0,
- "length glossary:",
+ "- glossary length:",
(doc_abstraction["glossary"].length > 1)
? (to!int(doc_abstraction["glossary"].length))
: 0,
- "length biblio:",
+ "- biblio length:",
(doc_abstraction["bibliography"].length > 1)
? (to!int(doc_abstraction["bibliography"].length))
: 0,
- "length bookindex:",
+ "- bookindex length:",
(doc_abstraction["bookindex"].length > 1)
? (to!int(doc_abstraction["bookindex"].length))
: 0,
- " last book idx ocn:",
+ " book idx last obj on.#:",
to!int(check["last_object_number_book_index"]),
- "length blurb:",
+ "- blurb length:",
(doc_abstraction["blurb"].length > 1)
? (to!int(doc_abstraction["blurb"].length))
: 0,
+ "* last obj on.#:",
+ to!int(check["last_object_number"]),
"number of segments:",
- (doc_matters.xml.segnames.length > 1)
- ? (to!int(doc_matters.xml.segnames.length))
+ (doc_matters.has.segnames_lv4.length > 1)
+ ? (to!int(doc_matters.has.segnames_lv4.length))
: 0,
- __FILE__,
- __LINE__,
markup.repeat_character_by_number_provided("-", min_repeat_number),
);
#+END_SRC