aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/ao_abstract_doc_source.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-11-09 17:52:33 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:13 -0400
commit2301a8251d111ca2e020f524ce036c11e4306a14 (patch)
treeaed462b441e64efe989dca5c5d5eee306d9d53be /src/sdp/ao_abstract_doc_source.d
parenta bit of naming and tidying (diff)
0.9.0 document sections
Diffstat (limited to 'src/sdp/ao_abstract_doc_source.d')
-rw-r--r--src/sdp/ao_abstract_doc_source.d323
1 files changed, 265 insertions, 58 deletions
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d
index 8d2ff70..421c094 100644
--- a/src/sdp/ao_abstract_doc_source.d
+++ b/src/sdp/ao_abstract_doc_source.d
@@ -18,8 +18,9 @@ template SiSUdocAbstraction() {
/+ initialize +/
auto rgx = Rgx();
ObjComposite[][string] the_table_of_contents_section;
- ObjComposite[] the_document_head_section, the_document_body_section, the_bibliography_section;
+ ObjComposite[] the_document_head_section, the_document_body_section, the_bibliography_section, the_glossary_section, the_blurb_section;
string[string] an_object, processing;
+ string an_object_key;
string[] anchor_tags;
string segment_object_belongs_to;
auto set_abstract_object = ObjectAbstractSet();
@@ -93,8 +94,10 @@ template SiSUdocAbstraction() {
destroy(biblio_arr_json);
}
line_occur = [
- "heading" : 0,
- "para" : 0,
+ "heading" : 0,
+ "para" : 0,
+ "glossary" : 0,
+ "blurb" : 0,
];
auto type = flags_type_init;
void tell_lo(int obj_cite_number, in char[] line) {
@@ -150,6 +153,22 @@ template SiSUdocAbstraction() {
"h_3": regex(r"^(none)"),
"h_4": regex(r"^(none)")
];
+ an_object["glossary_nugget"] = "";
+ an_object["blurb_nugget"] = "";
+ auto toc_head =
+ set_abstract_object.contents_heading(
+ "Table of Contents", // nugget/object
+ "", // attrib
+ 0, // obj_cite_number
+ ["toc"], // anchor tag
+ "1", // lev
+ 4, // lev_markup_number
+ 2, // lev_collapsed_number
+ );
+ the_table_of_contents_section = [
+ "seg": [toc_head],
+ "scroll": [toc_head],
+ ];
/+ abstraction init ↑ +/
/+ ↓ loop markup document/text line by line +/
srcDocLoop:
@@ -196,11 +215,140 @@ template SiSUdocAbstraction() {
&& (!matchFirst(line, rgx.comment))) {
/+ within section (block object): biblio +/
_biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json);
+ type["glossary_section"] = State.off;
+ type["biblio_section"] = State.on;
+ type["blurb_section"] = State.off;
debug(bibliobuild) {
writeln("- ", biblio_entry_str_json);
writeln("-> ", biblio_arr_json.length);
}
continue;
+ } else if ((matchFirst(line, rgx.heading_glossary)
+ || (type["glossary_section"] == State.on))
+ && (!matchFirst(line, rgx.heading))
+ && (!matchFirst(line, rgx.comment))) {
+ /+ within section (block object): glossary +/
+ debug(glossary) {
+ writeln(__LINE__);
+ writeln(line);
+ }
+ // _glossary_block_(line, type);
+ type["glossary_section"] = State.on;
+ type["biblio_section"] = State.off;
+ type["blurb_section"] = State.off;
+ indent=[
+ "hang_position" : "0",
+ "base_position" : "0",
+ ];
+ bullet = false;
+ type["para"] = State.on;
+ line_occur["para"] = State.off;
+ an_object_key="glossary_nugget"; //
+ if (matchFirst(line, rgx.heading_glossary)) {
+ the_glossary_section ~=
+ set_abstract_object.contents_heading(
+ "Glossary", // nugget/object
+ "", // attrib
+ 0, // obj_cite_number
+ [""], // anchor tag
+ "B", // lev
+ 1, // lev_markup_number
+ 1, // lev_collapsed_number
+ );
+ the_glossary_section ~=
+ set_abstract_object.contents_heading(
+ "Glossary", // nugget/object
+ "", // attrib
+ 0, // obj_cite_number
+ ["glossary"], // anchor tag
+ "1", // lev
+ 4, // lev_markup_number
+ 2, // lev_collapsed_number
+ );
+ // } else if (matchFirst(line, rgx.heading)) {
+ // _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, type, dochead_meta_aa); // levels?
+ } else {
+ _para_match_(line, an_object, an_object_key, indent, bullet, type, line_occur);
+ the_glossary_section ~=
+ set_abstract_object.contents_para(
+ "para", // an_object["is"],
+ to!string(line), // an_object["substantive"],
+ "", // attrib
+ 0, // obj_cite_number,
+ indent,
+ bullet
+ );
+ }
+ type["obj_cite_number_status"] = TriState.off;
+ continue;
+ } else if ((matchFirst(line, rgx.heading_blurb)
+ || (type["blurb_section"] == State.on))
+ && (!matchFirst(line, rgx.heading))
+ && (!matchFirst(line, rgx.comment))) {
+ /+ within section (block object): blurb +/
+ debug(blurb) {
+ writeln(__LINE__);
+ writeln(line);
+ }
+ // _blurb_block_(line, type);
+ type["glossary_section"] = State.off;
+ type["biblio_section"] = State.off;
+ type["blurb_section"] = State.on;
+ indent=[
+ "hang_position" : "0",
+ "base_position" : "0",
+ ];
+ bullet = false;
+ type["para"] = State.on;
+ line_occur["para"] = State.off;
+ an_object_key="blurb_nugget";
+ if (matchFirst(line, rgx.heading_blurb)) {
+ the_blurb_section ~=
+ set_abstract_object.contents_heading(
+ "Blurb", // nugget/object
+ "", // attrib
+ 0, // obj_cite_number
+ [""], // anchor tag
+ "B", // lev
+ 1, // lev_markup_number
+ 1, // lev_collapsed_number
+ );
+ the_blurb_section ~=
+ set_abstract_object.contents_heading(
+ "Blurb", // nugget/object
+ "", // attrib
+ 0, // obj_cite_number
+ ["blurb"], // anchor tag
+ "1", // lev
+ 4, // lev_markup_number
+ 2, // lev_collapsed_number
+ );
+ } else if (matchFirst(line, rgx.heading)) {
+ _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, type, dochead_meta_aa);
+ the_blurb_section ~=
+ set_abstract_object.contents_heading(
+ to!string(line), // an_object["substantive"],
+ "", // attrib
+ 0, // obj_cite_number
+ [""], // anchor tag
+ to!string(an_object["lev"]),
+ to!int(an_object["lev_markup_number"]),
+ to!int(an_object["lev_collapsed_number"]),
+ );
+ } else {
+ _para_match_(line, an_object, an_object_key, indent, bullet, type, line_occur);
+ the_blurb_section ~=
+ set_abstract_object.contents_para(
+ "para", // an_object["is"],
+ to!string(line), // an_object["substantive"],
+ "", // attrib
+ obj_cite_number,
+ indent,
+ bullet
+ );
+ }
+ type["obj_cite_number_status"] = TriState.off;
+ continue;
} else if (type["poem"] == TriState.on) {
/+ within block object: poem +/
_poem_block_(line, an_object, type, counter, obj_cite_number_poem, dochead_make_aa);
@@ -270,14 +418,15 @@ template SiSUdocAbstraction() {
_book_index_(line, book_idx_tmp, an_object, type);
} else {
/+ not book_index +/
+ an_object_key="body_nugget";
if (auto m = matchFirst(line, rgx.comment)) {
/+ matched comment +/
debug(comment) {
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n";
+ an_object[an_object_key] ~= line ~= "\n";
the_document_body_section ~=
- set_abstract_object.contents_comment(strip(an_object["body_nugget"]));
+ set_abstract_object.contents_comment(strip(an_object[an_object_key]));
_common_reset_(line_occur, an_object, type);
processing.remove("verse");
++counter;
@@ -308,24 +457,25 @@ template SiSUdocAbstraction() {
+/
if (matchFirst(line, rgx.heading)) {
/+ heading match +/
- _heading_matched_(line, line_occur, an_object, lv, collapsed_lev, type, dochead_meta_aa);
+ _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, type, dochead_meta_aa);
} else if (line_occur["para"] == State.off) {
/+ para match +/
- _para_match_(line, an_object, indent, bullet, type, line_occur);
+ an_object_key="body_nugget";
+ _para_match_(line, an_object, an_object_key, indent, bullet, type, line_occur);
}
} else if (line_occur["heading"] > State.off) {
/+ heading +/
debug(heading) { // heading
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n";
+ an_object[an_object_key] ~= line ~= "\n";
++line_occur["heading"];
} else if (line_occur["para"] > State.off) {
/+ paragraph +/
debug(para) {
writeln(line);
}
- an_object["body_nugget"] ~= line;
+ an_object[an_object_key] ~= line;
++line_occur["para"];
}
}
@@ -363,8 +513,9 @@ template SiSUdocAbstraction() {
bookindex_unordered_hashes =
bkidx_hash(an_object["bookindex_nugget"], obj_cite_number);
an_object["is"] = "heading";
+ an_object_key="body_nugget";
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa); // tuple this with anchor tags?
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); // tuple this with anchor tags?
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
if (to!int(an_object["lev_markup_number"]) == 4) {
@@ -390,7 +541,7 @@ template SiSUdocAbstraction() {
an_object["is"]
); // heading
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
++heading_pointer;
debug(segments) {
writeln(an_object["lev_markup_number"]);
@@ -433,11 +584,11 @@ template SiSUdocAbstraction() {
an_object["is"]
);
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa); // ...
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_para(
an_object["is"],
@@ -470,6 +621,12 @@ template SiSUdocAbstraction() {
if (((the_document_body_section[$-1].is_a == "para")
|| (the_document_body_section[$-1].is_a == "heading"))
&& (counter-1 > previous_count)) {
+ if ((the_document_body_section[$-1].is_a == "heading")
+ && (the_document_body_section[$-1].heading_attrib.lev_markup_number < 5)) {
+ type["biblio_section"] = State.off;
+ type["glossary_section"] = State.off;
+ type["blurb_section"] = State.off;
+ }
if (match(the_document_body_section[$-1].object,
rgx.inline_notes_delimiter_al_regular_number_note)) {
previous_count=the_document_body_section.length -1;
@@ -494,7 +651,7 @@ template SiSUdocAbstraction() {
* book index
+/
// TODO FIGURE OUT, you need this possibility
- // obj_im.obj_inline_markup_and_anchor_tags("doc_end_reset", "", dochead_make_aa);
+ // obj_im.obj_inline_markup_and_anchor_tags("doc_end_reset", an_object_key, "", dochead_make_aa);
debug(toc) {
writefln(
"%s %s",
@@ -520,6 +677,46 @@ template SiSUdocAbstraction() {
writeln(o);
}
}
+ if (an_object["glossary_nugget"].length == 0) {
+ writeln("no gloss");
+ the_glossary_section ~=
+ set_abstract_object.contents_heading(
+ "(skip) there is no Glossary section", // nugget/object
+ "", // attrib
+ 0, // obj_cite_number
+ [""], // anchor tag
+ "B", // lev
+ 1, // lev_markup_number
+ 1, // lev_collapsed_number
+ );
+ } else {
+ writeln("gloss");
+ }
+ debug(glossary) {
+ foreach (gloss; the_glossary_section) {
+ writeln(gloss.object);
+ }
+ }
+ if (an_object["blurb_nugget"].length == 0) {
+ writeln("no blurb");
+ the_blurb_section ~=
+ set_abstract_object.contents_heading(
+ "(skip) there is no Blurb section", // nugget/object
+ "", // attrib
+ 0, // obj_cite_number
+ [""], // anchor tag
+ "B", // lev
+ 1, // lev_markup_number
+ 1, // lev_collapsed_number
+ );
+ } else {
+ writeln("blurb");
+ }
+ debug(blurb) {
+ foreach (blurb; the_blurb_section) {
+ writeln(blurb.object);
+ }
+ }
auto biblio_unsorted_incomplete = biblio_arr_json.dup;
// destroy(biblio_arr_json);
auto biblio = Bibliography();
@@ -613,10 +810,11 @@ template SiSUdocAbstraction() {
"body": the_document_body_section,
"endnotes_seg": the_endnotes_section["seg"],
"endnotes_scroll": the_endnotes_section["scroll"],
- // "glossary": the_glossary_section, // TODO
+ "glossary": the_glossary_section,
"bibliography": the_bibliography_section,
"bookindex_scroll": the_bookindex_section["scroll"],
"bookindex_seg": the_bookindex_section["seg"],
+ "blurb": the_blurb_section,
];
auto t = tuple(
document_the,
@@ -850,7 +1048,7 @@ template SiSUdocAbstraction() {
debug(code) { // code (curly) line
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // code (curly) line
+ an_object[an_object_key] ~= line ~= "\n"; // code (curly) line
}
} else if (type["tic_code"] == TriState.on) {
if (matchFirst(line, rgx.block_tic_close)) {
@@ -864,7 +1062,7 @@ template SiSUdocAbstraction() {
debug(code) { // code (tic) line
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // code (tic) line
+ an_object[an_object_key] ~= line ~= "\n"; // code (tic) line
}
}
}
@@ -896,6 +1094,8 @@ template SiSUdocAbstraction() {
) {
if (matchFirst(line, rgx.heading_biblio)) {
type["biblio_section"] = TriState.on;
+ type["blurb_section"] = State.off;
+ type["glossary_section"] = State.off;
}
if (line.empty) {
debug {
@@ -1014,7 +1214,7 @@ template SiSUdocAbstraction() {
) {
if (type["curly_poem"] == TriState.on) {
if (matchFirst(line, rgx.block_curly_poem_close)) {
- an_object["body_nugget"]="verse"; // check that this is as you please
+ an_object[an_object_key]="verse"; // check that this is as you please
debug(poem) { // poem (curly) close
writefln(
"* [poem curly] %s",
@@ -1022,7 +1222,7 @@ template SiSUdocAbstraction() {
);
}
if (processing.length > 0) {
- an_object["body_nugget"] = processing["verse"];
+ an_object[an_object_key] = processing["verse"];
}
debug(poem) { // poem (curly) close
writeln(__LINE__);
@@ -1036,16 +1236,16 @@ template SiSUdocAbstraction() {
debug(poem) { // poem (curly) close
writeln(
obj_cite_number,
- an_object["body_nugget"]
+ an_object[an_object_key]
);
}
an_object["is"] = "verse";
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block(
an_object["is"],
@@ -1074,12 +1274,12 @@ template SiSUdocAbstraction() {
}
if (type["verse_new"] == State.on) {
verse_line=1;
- an_object["body_nugget"] = processing["verse"];
+ an_object[an_object_key] = processing["verse"];
debug(poem) { // poem verse
writefln(
"* %s curly\n%s",
obj_cite_number,
- an_object["body_nugget"]
+ an_object[an_object_key]
);
}
processing.remove("verse");
@@ -1093,11 +1293,11 @@ template SiSUdocAbstraction() {
an_object["is"]
);
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block(
an_object["is"],
@@ -1112,7 +1312,7 @@ template SiSUdocAbstraction() {
}
} else if (type["tic_poem"] == TriState.on) {
if (auto m = matchFirst(line, rgx.block_tic_close)) { // tic_poem_close
- an_object["body_nugget"]="verse"; // check that this is as you please
+ an_object[an_object_key]="verse"; // check that this is as you please
debug(poem) { // poem (curly) close
writefln(
"* [poem tic] %s",
@@ -1120,7 +1320,7 @@ template SiSUdocAbstraction() {
);
}
if (processing.length > 0) { // needs looking at
- an_object["body_nugget"] = processing["verse"];
+ an_object[an_object_key] = processing["verse"];
}
if (an_object.length > 0) {
debug(poem) { // poem (tic) close
@@ -1130,11 +1330,11 @@ template SiSUdocAbstraction() {
processing.remove("verse");
an_object["is"] = "verse";
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block(
an_object["is"],
@@ -1162,12 +1362,12 @@ template SiSUdocAbstraction() {
}
if (type["verse_new"] == State.on) {
verse_line=1;
- an_object["body_nugget"] = processing["verse"];
+ an_object[an_object_key] = processing["verse"];
debug(poem) { // poem (tic) close
writefln(
"* %s tic\n%s",
obj_cite_number,
- an_object["body_nugget"]
+ an_object[an_object_key]
);
}
processing.remove("verse");
@@ -1182,11 +1382,11 @@ template SiSUdocAbstraction() {
an_object["is"]
);
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block(
an_object["is"],
@@ -1218,7 +1418,7 @@ template SiSUdocAbstraction() {
debug(group) { // group
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // build group array (or string)
+ an_object[an_object_key] ~= line ~= "\n"; // build group array (or string)
}
} else if (type["tic_group"] == TriState.on) {
if (matchFirst(line, rgx.block_tic_close)) {
@@ -1232,7 +1432,7 @@ template SiSUdocAbstraction() {
debug(group) { // group
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // build group array (or string)
+ an_object[an_object_key] ~= line ~= "\n"; // build group array (or string)
}
}
}
@@ -1253,7 +1453,7 @@ template SiSUdocAbstraction() {
debug(block) { // block
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // build block array (or string)
+ an_object[an_object_key] ~= line ~= "\n"; // build block array (or string)
}
} else if (type["tic_block"] == TriState.on) {
if (matchFirst(line, rgx.block_tic_close)) {
@@ -1267,7 +1467,7 @@ template SiSUdocAbstraction() {
debug(block) { // block
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // build block array (or string)
+ an_object[an_object_key] ~= line ~= "\n"; // build block array (or string)
}
}
}
@@ -1288,7 +1488,7 @@ template SiSUdocAbstraction() {
debug(quote) { // quote
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // build quote array (or string)
+ an_object[an_object_key] ~= line ~= "\n"; // build quote array (or string)
}
} else if (type["tic_quote"] == TriState.on) {
if (matchFirst(line, rgx.block_tic_close)) {
@@ -1302,7 +1502,7 @@ template SiSUdocAbstraction() {
debug(quote) { // quote
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // build quote array (or string)
+ an_object[an_object_key] ~= line ~= "\n"; // build quote array (or string)
}
}
}
@@ -1323,7 +1523,7 @@ template SiSUdocAbstraction() {
debug(table) { // table
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // build table array (or string)
+ an_object[an_object_key] ~= line ~= "\n"; // build table array (or string)
}
} else if (type["tic_table"] == TriState.on) {
if (matchFirst(line, rgx.block_tic_close)) {
@@ -1337,7 +1537,7 @@ template SiSUdocAbstraction() {
debug(table) { // table
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n"; // build table array (or string)
+ an_object[an_object_key] ~= line ~= "\n"; // build table array (or string)
}
}
}
@@ -1381,11 +1581,11 @@ template SiSUdocAbstraction() {
an_object["is"]
);
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block_code(
an_object["is"],
@@ -1442,11 +1642,11 @@ template SiSUdocAbstraction() {
an_object["is"]
);
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block(
an_object["is"],
@@ -1477,11 +1677,11 @@ template SiSUdocAbstraction() {
an_object["is"]
);
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block(
an_object["is"],
@@ -1511,11 +1711,11 @@ template SiSUdocAbstraction() {
an_object["is"]
);
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block(
an_object["is"],
@@ -1546,11 +1746,11 @@ template SiSUdocAbstraction() {
an_object["is"]
);
auto substantive_object_and_anchor_tags_tuple =
- obj_im.obj_inline_markup_and_anchor_tags(an_object, dochead_make_aa);
+ obj_im.obj_inline_markup_and_anchor_tags(an_object, an_object_key, dochead_make_aa);
an_object["substantive"] = substantive_object_and_anchor_tags_tuple[0];
anchor_tags = substantive_object_and_anchor_tags_tuple[1];
an_object["attrib"] =
- obj_att.obj_attributes(an_object["is"], an_object["body_nugget"], _node);
+ obj_att.obj_attributes(an_object["is"], an_object[an_object_key], _node);
the_document_body_section ~=
set_abstract_object.contents_block(
an_object["is"],
@@ -1751,6 +1951,7 @@ template SiSUdocAbstraction() {
char[] line,
ref int[string] line_occur,
ref string[string] an_object,
+ ref string an_object_key,
ref int[string] lv,
ref int[string] collapsed_lev,
ref int[string] type,
@@ -1759,17 +1960,21 @@ template SiSUdocAbstraction() {
if (auto m = match(line, rgx.heading)) {
/+ heading match +/
type["heading"] = State.on;
- type["biblio_section"] = State.off;
+ if (match(line, rgx.heading_seg_and_above)) {
+ type["biblio_section"] = State.off;
+ type["glossary_section"] = State.off;
+ type["blurb_section"] = State.off;
+ }
type["para"] = State.off;
++line_occur["heading"];
- an_object["body_nugget"] ~= line ~= "\n";
+ an_object[an_object_key] ~= line ~= "\n";
an_object["lev"] ~= m.captures[1];
assertions_doc_structure(an_object, lv); // includes most of the logic for collapsed levels
switch (an_object["lev"]) {
case "A":
- an_object["body_nugget"]=replaceFirst(an_object["body_nugget"],
+ an_object[an_object_key]=replaceFirst(an_object[an_object_key],
rgx.variable_doc_title, (dochead_meta_aa["title"]["full"] ~ ","));
- an_object["body_nugget"]=replaceFirst(an_object["body_nugget"],
+ an_object[an_object_key]=replaceFirst(an_object[an_object_key],
rgx.variable_doc_author, dochead_meta_aa["creator"]["author"]);
collapsed_lev["h0"] = 1;
an_object["lev_collapsed_number"] =
@@ -1888,6 +2093,7 @@ template SiSUdocAbstraction() {
auto _para_match_(
char[] line,
ref string[string] an_object,
+ ref string an_object_key,
ref string[string] indent,
ref bool bullet,
ref int[string] type,
@@ -1896,7 +2102,7 @@ template SiSUdocAbstraction() {
if (line_occur["para"] == State.off) {
/+ para matches +/
type["para"] = State.on;
- an_object["body_nugget"] ~= line;
+ an_object[an_object_key] ~= line; // body_nugget
indent=[
"hang_position" : "0",
"base_position" : "0",
@@ -2120,11 +2326,12 @@ template SiSUdocAbstraction() {
string[string] obj_txt;
auto obj_inline_markup_and_anchor_tags(
string[string] obj_,
+ string obj_key_,
string[string][string] dochead_make_aa
)
in { }
body {
- obj_txt["munge"]=obj_["body_nugget"].dup;
+ obj_txt["munge"]=obj_[obj_key_].dup;
obj_txt["munge"]=(match(obj_["is"], ctRegex!(`verse|code`)))
? obj_txt["munge"]
: strip(obj_txt["munge"]);