aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ao_abstract_doc_source.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/ao_abstract_doc_source.org')
-rw-r--r--org/ao_abstract_doc_source.org364
1 files changed, 304 insertions, 60 deletions
diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org
index 4b6adb1..6b1906d 100644
--- a/org/ao_abstract_doc_source.org
+++ b/org/ao_abstract_doc_source.org
@@ -45,8 +45,9 @@ mixin InternalMarkup;
/+ 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();
@@ -125,8 +126,10 @@ scope(exit) {
#+name: abs_init_rest
#+BEGIN_SRC d
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) {
@@ -182,6 +185,22 @@ auto heading_match_rgx = [
"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],
+];
#+END_SRC
** _2. loop: process document body_ [+6] :loop:
@@ -248,6 +267,9 @@ if ((matchFirst(line, rgx.heading_biblio)
&& (!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);
@@ -255,6 +277,159 @@ if ((matchFirst(line, rgx.heading_biblio)
continue;
#+END_SRC
+****** TODO within section: glossary :glossary:
+
+if there is a glossary section you need to:
+- extract it
+- create standard headings
+- markup contents in standard way like regular paragraphs
+ - need indentation and regular paragraph inline markup
+- reconstitute the document with the glossary section following the endnotes
+
+#+name: abs_in_loop_body_non_code_obj
+#+BEGIN_SRC d
+} 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;
+#+END_SRC
+
+****** TODO within section: blurb :blurb:
+
+if there is a blurb section you need to:
+- extract it
+- create standard headings (or use line provided in 1~ heading)
+- markup contents in standard way like regular paragraphs
+ - need regular paragraph inline markup
+- reconstitute the document with the blurb section at the very end of the doucment
+
+#+name: abs_in_loop_body_non_code_obj
+#+BEGIN_SRC d
+} 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;
+#+END_SRC
+
+***** in block group [+1] :block:active:
****** within block group: poem :poem:
#+name: abs_in_loop_body_non_code_obj
@@ -385,14 +560,15 @@ if ((matchFirst(line, rgx.book_index))
#+name: abs_in_loop_body_not_block_obj
#+BEGIN_SRC d
+ 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;
@@ -429,10 +605,11 @@ if ((matchFirst(line, rgx.book_index))
+/
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);
}
#+END_SRC
@@ -445,7 +622,7 @@ if ((matchFirst(line, rgx.book_index))
debug(heading) { // heading
writeln(line);
}
- an_object["body_nugget"] ~= line ~= "\n";
+ an_object[an_object_key] ~= line ~= "\n";
++line_occur["heading"];
#+END_SRC
@@ -458,7 +635,7 @@ if ((matchFirst(line, rgx.book_index))
debug(para) {
writeln(line);
}
- an_object["body_nugget"] ~= line;
+ an_object[an_object_key] ~= line;
++line_occur["para"];
}
}
@@ -511,8 +688,9 @@ if ((type["heading"] == State.on)
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) {
@@ -538,7 +716,7 @@ if ((type["heading"] == State.on)
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"]);
@@ -587,11 +765,11 @@ if ((type["heading"] == State.on)
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"],
@@ -629,6 +807,12 @@ if (the_document_body_section.length > 0) {
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;
@@ -658,7 +842,7 @@ debug(objectrelated2) { // check
* 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);
#+END_SRC
*** document sections
@@ -699,9 +883,59 @@ debug(endnotes) {
}
#+END_SRC
-**** glossary section?
+**** TODO glossary section?
-**** TODO [#B] bibliography section (objects) :bibliography:
+#+name: abs_post
+#+BEGIN_SRC d
+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);
+ }
+}
+#+END_SRC
+
+**** TODO blurb section?
+
+#+name: abs_post
+#+BEGIN_SRC d
+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);
+ }
+}
+#+END_SRC
+
+**** DONE [#B] bibliography section (objects) :bibliography:
#+name: abs_post
#+BEGIN_SRC d
@@ -856,10 +1090,11 @@ auto document_the = [
"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,
];
#+END_SRC
@@ -1160,7 +1395,7 @@ void _code_block_(
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)) {
@@ -1174,7 +1409,7 @@ void _code_block_(
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
}
}
}
@@ -1277,6 +1512,8 @@ void _biblio_block_(
) {
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 {
@@ -1403,7 +1640,7 @@ void _poem_block_(
) {
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",
@@ -1411,7 +1648,7 @@ void _poem_block_(
);
}
if (processing.length > 0) {
- an_object["body_nugget"] = processing["verse"];
+ an_object[an_object_key] = processing["verse"];
}
debug(poem) { // poem (curly) close
writeln(__LINE__);
@@ -1425,16 +1662,16 @@ void _poem_block_(
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"],
@@ -1463,12 +1700,12 @@ void _poem_block_(
}
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");
@@ -1482,11 +1719,11 @@ void _poem_block_(
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"],
@@ -1501,7 +1738,7 @@ void _poem_block_(
}
} 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",
@@ -1509,7 +1746,7 @@ void _poem_block_(
);
}
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
@@ -1519,11 +1756,11 @@ void _poem_block_(
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"],
@@ -1551,12 +1788,12 @@ void _poem_block_(
}
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");
@@ -1571,11 +1808,11 @@ void _poem_block_(
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"],
@@ -1613,7 +1850,7 @@ void _group_block_(
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)) {
@@ -1627,7 +1864,7 @@ void _group_block_(
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)
}
}
}
@@ -1654,7 +1891,7 @@ void _block_block_(
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)) {
@@ -1668,7 +1905,7 @@ void _block_block_(
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)
}
}
}
@@ -1695,7 +1932,7 @@ void _quote_block_(
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)) {
@@ -1709,7 +1946,7 @@ void _quote_block_(
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)
}
}
}
@@ -1736,7 +1973,7 @@ void _table_block_(
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)) {
@@ -1750,7 +1987,7 @@ void _table_block_(
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)
}
}
}
@@ -1800,11 +2037,11 @@ void _block_flag_line_empty_(
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"],
@@ -1861,11 +2098,11 @@ void _block_flag_line_empty_(
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"],
@@ -1896,11 +2133,11 @@ void _block_flag_line_empty_(
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"],
@@ -1930,11 +2167,11 @@ void _block_flag_line_empty_(
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"],
@@ -1965,11 +2202,11 @@ void _block_flag_line_empty_(
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"],
@@ -2195,6 +2432,7 @@ auto _heading_matched_(
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,
@@ -2203,17 +2441,21 @@ auto _heading_matched_(
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"] =
@@ -2338,6 +2580,7 @@ auto _heading_matched_(
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,
@@ -2346,7 +2589,7 @@ auto _para_match_(
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",
@@ -2595,11 +2838,12 @@ struct ObjInlineMarkup {
#+BEGIN_SRC d
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"]);