aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/meta
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp/meta')
-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
5 files changed, 131 insertions, 168 deletions
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 = "";