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.org316
1 files changed, 172 insertions, 144 deletions
diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org
index 690c029..c5535fd 100644
--- a/org/ao_abstract_doc_source.org
+++ b/org/ao_abstract_doc_source.org
@@ -266,17 +266,20 @@ continue;
#+name: abs_in_loop_body_non_code_obj
#+BEGIN_SRC d
if ((matchFirst(line, rgx.heading_biblio)
-|| (type["biblio_section"] == State.on))
+|| (type["biblio_section"] == State.on
+&& (!matchFirst(line, rgx.heading_blurb_glossary))))
&& (!matchFirst(line, rgx.heading))
&& (!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);
+ if (opt_action_bool["backmatter"] && opt_action_bool["section_biblio"]) {
+ _biblio_block_(line, type, bib_entry, biblio_entry_str_json, biblio_arr_json); //
+ debug(bibliobuild) {
+ writeln("- ", biblio_entry_str_json);
+ writeln("-> ", biblio_arr_json.length);
+ }
}
continue;
#+END_SRC
@@ -293,7 +296,8 @@ if there is a glossary section you need to:
#+name: abs_in_loop_body_non_code_obj
#+BEGIN_SRC d
} else if ((matchFirst(line, rgx.heading_glossary)
-|| (type["glossary_section"] == State.on))
+|| (type["glossary_section"] == State.on
+&& (!matchFirst(line, rgx.heading_biblio_blurb))))
&& (!matchFirst(line, rgx.heading))
&& (!matchFirst(line, rgx.comment))) {
/+ within section (block object): glossary +/
@@ -305,50 +309,52 @@ if there is a glossary section you need to:
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
- );
+ if (opt_action_bool["backmatter"] && opt_action_bool["section_glossary"]) {
+ 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;
}
- type["obj_cite_number_status"] = TriState.off;
continue;
#+END_SRC
@@ -364,7 +370,8 @@ if there is a blurb section you need to:
#+name: abs_in_loop_body_non_code_obj
#+BEGIN_SRC d
} else if ((matchFirst(line, rgx.heading_blurb)
-|| (type["blurb_section"] == State.on))
+|| (type["blurb_section"] == State.on
+&& (!matchFirst(line, rgx.heading_biblio_glossary))))
&& (!matchFirst(line, rgx.heading))
&& (!matchFirst(line, rgx.comment))) {
/+ within section (block object): blurb +/
@@ -376,60 +383,63 @@ if there is a blurb section you need to:
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
- );
+ if (opt_action_bool["backmatter"] && opt_action_bool["section_blurb"]) {
+ 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))
+ && (opt_action_bool["backmatter"] && opt_action_bool["section_blurb"])) {
+ _heading_matched_(line, line_occur, an_object, an_object_key, lv, collapsed_lev, type, dochead_meta_aa); // levels?
+ 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;
}
- type["obj_cite_number_status"] = TriState.off;
continue;
#+END_SRC
@@ -549,7 +559,7 @@ if ((matchFirst(line, rgx.book_index))
|| (matchFirst(line, rgx.book_index_open))
|| (type["book_index"] == State.on )) {
/+ book_index +/
- _book_index_(line, book_idx_tmp, an_object, type);
+ _book_index_(line, book_idx_tmp, an_object, type, opt_action_bool);
#+END_SRC
******* not book index [+1]
@@ -846,10 +856,11 @@ debug(objectrelated2) { // check
}
/+
Backmatter:
- * endnotes
- * glossary
- * references / bibliography
- * book index
+ - endnotes
+ - glossary
+ - bibliography / references
+ - book index
+ - blurb
+/
// TODO FIGURE OUT, you need this possibility
// obj_im.obj_inline_markup_and_anchor_tags("doc_end_reset", an_object_key, "", dochead_make_aa);
@@ -861,7 +872,7 @@ debug(objectrelated2) { // check
#+name: abs_post
#+BEGIN_SRC d
auto en_tuple =
- note_section.endnote_objects(obj_cite_number);
+ note_section.endnote_objects(obj_cite_number, opt_action_bool);
static assert(!isTypeTuple!(en_tuple));
auto the_endnotes_section = en_tuple[0];
obj_cite_number = en_tuple[1];
@@ -1033,7 +1044,8 @@ auto bi_tuple =
bi.bookindex_build_section(
bookindex_unordered_hashes,
obj_cite_number,
- segment_object_belongs_to
+ segment_object_belongs_to,
+ opt_action_bool,
);
static assert(!isTypeTuple!(bi_tuple));
auto the_bookindex_section = bi_tuple[0];
@@ -2407,10 +2419,11 @@ void _block_flag_line_empty_(
#+name: abs_functions_book_index
#+BEGIN_SRC d
auto _book_index_(
- char[] line,
- ref string book_idx_tmp,
+ char[] line,
+ ref string book_idx_tmp,
ref string[string] an_object,
- ref int[string] type
+ ref int[string] type,
+ bool[string] opt_action_bool,
) {
if (auto m = match(line, rgx.book_index)) {
/+ match book_index +/
@@ -2424,27 +2437,33 @@ auto _book_index_(
} else if (auto m = match(line, rgx.book_index_open)) {
/+ match open book_index +/
type["book_index"] = State.on;
- book_idx_tmp = to!string(m.captures[1]);
- debug(bookindexmatch) { // book index
- writefln(
- "* [bookindex] %s\n",
- book_idx_tmp,
- );
+ if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) {
+ book_idx_tmp = to!string(m.captures[1]);
+ debug(bookindexmatch) { // book index
+ writefln(
+ "* [bookindex] %s\n",
+ book_idx_tmp,
+ );
+ }
}
} else if (type["book_index"] == State.on ) {
/+ book_index flag set +/
if (auto m = match(line, rgx.book_index_close)) {
type["book_index"] = State.off;
- an_object["bookindex_nugget"] = book_idx_tmp ~ to!string(m.captures[1]);
- debug(bookindexmatch) { // book index
- writefln(
- "* [bookindex] %s\n",
- book_idx_tmp,
- );
+ if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) {
+ an_object["bookindex_nugget"] = book_idx_tmp ~ to!string(m.captures[1]);
+ debug(bookindexmatch) { // book index
+ writefln(
+ "* [bookindex] %s\n",
+ book_idx_tmp,
+ );
+ }
}
book_idx_tmp = "";
} else {
- book_idx_tmp ~= line;
+ if (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"]) {
+ book_idx_tmp ~= line;
+ }
}
}
}
@@ -3974,8 +3993,9 @@ struct BookIndexReportSection {
#+BEGIN_SRC d
auto bookindex_build_section(
string[][string][string] bookindex_unordered_hashes,
- int obj_cite_number,
- string segment_object_belongs_to,
+ int obj_cite_number,
+ string segment_object_belongs_to,
+ bool[string] opt_action_bool,
) {
string type;
string lev;
@@ -3986,7 +4006,8 @@ struct BookIndexReportSection {
auto mainkeys =
bookindex_unordered_hashes.byKey.array.sort().release;
ObjComposite[][string] bookindex_section;
- if (mainkeys.length > 0) {
+ if ((mainkeys.length > 0)
+ && (opt_action_bool["backmatter"] && opt_action_bool["section_bookindex"])) {
string bi_tmp_seg, bi_tmp_scroll;
attrib="";
lev="B";
@@ -4150,8 +4171,8 @@ struct NotesSection {
#+BEGIN_SRC d
private auto gather_notes_for_endnote_section(
ObjComposite[] contents_am,
- string segment_object_belongs_to,
- ulong counter
+ string segment_object_belongs_to,
+ ulong counter,
)
in {
// endnotes/ footnotes for
@@ -4228,7 +4249,10 @@ struct NotesSection {
#+name: ao_emitters_endnotes
#+BEGIN_SRC d
- private auto endnote_objects(int obj_cite_number)
+ private auto endnote_objects(
+ int obj_cite_number,
+ bool[string] opt_action_bool,
+ )
in {
}
body {
@@ -4239,7 +4263,8 @@ struct NotesSection {
string lev, lev_markup_number, lev_collapsed_number;
string attrib;
int[string] indent;
- if (endnotes_["seg"].length > 0) {
+ if ((endnotes_["seg"].length > 0)
+ && (opt_action_bool["backmatter"] && opt_action_bool["section_endnotes"])) {
attrib="";
lev="B";
lev_markup_number="1";
@@ -4314,15 +4339,17 @@ struct NotesSection {
1
);
}
- foreach (i, endnote; endnotes_["seg"]) {
- attrib="";
- the_endnotes_section["seg"] ~=
- set_abstract_object.contents_endnote(endnote, endnotes_["anchor"][i]);
- }
- foreach (i, endnote; endnotes_["scroll"]) {
- attrib="";
- the_endnotes_section["scroll"] ~=
- set_abstract_object.contents_endnote(endnote, endnotes_["anchor"][i]);
+ if (opt_action_bool["backmatter"] && opt_action_bool["section_endnotes"]) {
+ foreach (i, endnote; endnotes_["seg"]) {
+ attrib="";
+ the_endnotes_section["seg"] ~=
+ set_abstract_object.contents_endnote(endnote, endnotes_["anchor"][i]);
+ }
+ foreach (i, endnote; endnotes_["scroll"]) {
+ attrib="";
+ the_endnotes_section["scroll"] ~=
+ set_abstract_object.contents_endnote(endnote, endnotes_["anchor"][i]);
+ }
}
auto t = tuple(the_endnotes_section, obj_cite_number);
return t;
@@ -5198,9 +5225,10 @@ template SiSUdocAbstraction() {
<<abs_init_struct>>
/+ ↓ abstract marked up document +/
auto abstract_doc_source(
- char[][] markup_sourcefile_content,
+ char[][] markup_sourcefile_content,
string[string][string] dochead_make_aa,
- string[string][string] dochead_meta_aa
+ string[string][string] dochead_meta_aa,
+ bool[string] opt_action_bool,
) {
/+ ↓ abstraction init +/
<<abs_init_rest>>