aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ao_abstract_doc_source.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-06-25 06:37:22 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-04 14:48:18 -0400
commitf0c845eba3718fd0c732aebf25eb33e689798e03 (patch)
treec2ea36e199950647b1d3cce153691bb8f4fec378 /org/ao_abstract_doc_source.org
parentstep5.1 headers sdlang (like native headers) converted to json for common int... (diff)
step6 headers (&config), native & sdlang to json internally
Diffstat (limited to 'org/ao_abstract_doc_source.org')
-rw-r--r--org/ao_abstract_doc_source.org35
1 files changed, 19 insertions, 16 deletions
diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org
index f124a71..6c150e1 100644
--- a/org/ao_abstract_doc_source.org
+++ b/org/ao_abstract_doc_source.org
@@ -463,24 +463,24 @@ if (matchFirst(line, rgx.block_open)) {
&& ((type["para"] == State.off)
&& (type["heading"] == State.off))) {
/+ heading or para but neither flag nor line exists +/
- // if ((to!string(dochead_make_json["make"]["headings"]).length > 2)
- // && (type["make_headings"] == State.off)) {
- // /+ heading found +/
- // auto dochead_make_headings =
- // to!string(dochead_make_json["make"]["headings"]);
- // heading_found(line, dochead_make_headings, heading_match_str, heading_match_rgx, type);
- // }
+ if ((to!string(dochead_make_json["make"]["headings"]).length > 2)
+ && (type["make_headings"] == State.off)) {
+ /+ heading found +/
+ auto dochead_make_headings =
+ to!string(dochead_make_json["make"]["headings"]);
+ heading_found(line, dochead_make_headings, heading_match_str, heading_match_rgx, type);
+ }
if ((type["make_headings"] == State.on)
&& ((line_occur["para"] == State.off)
&& (line_occur["heading"] == State.off))
&& ((type["para"] == State.off)
&& (type["heading"] == State.off))) {
/+ heading make set +/
- // heading_make_set(line, line_occur, heading_match_rgx, type);
+ heading_make_set(line, line_occur, heading_match_rgx, type);
}
if (matchFirst(line, rgx.heading)) {
/+ heading match +/
- heading_matched(line, line_occur, an_object, lv, collapsed_lev, type);
+ heading_matched(line, line_occur, an_object, lv, collapsed_lev, type, dochead_meta_json);
} else if (line_occur["para"] == State.off) {
/+ para match +/
para_match(line, an_object, indent, bullet, type, line_occur);
@@ -2000,7 +2000,7 @@ auto book_index(
** heading or paragraph :heading:paragraph:
*** heading found :heading:
-##+name: abs_functions
+#+name: abs_functions
#+BEGIN_SRC d
auto heading_found(
char[] line,
@@ -2164,8 +2164,8 @@ auto heading_matched(
ref string[string] an_object,
ref int[string] lv,
ref int[string] collapsed_lev,
- ref int[string] type
- // ref JSONValue[string] dochead_meta_json
+ ref int[string] type,
+ ref JSONValue[string] dochead_meta_json
) {
if (auto m = match(line, rgx.heading)) {
/+ heading match +/
@@ -2179,8 +2179,8 @@ auto heading_matched(
assertions_doc_structure(an_object, lv); // includes most of the logic for collapsed levels
switch (an_object["lev"]) {
case "A":
- // an_object["obj"]=replaceFirst(an_object["obj"], rgx.variable_doc_title, to!string(dochead_meta_json["title"]["main"]));
- // an_object["obj"]=replaceFirst(an_object["obj"], rgx.variable_doc_author, to!string(dochead_meta_json["creator"]["author"]));
+ an_object["obj"]=replaceFirst(an_object["obj"], rgx.variable_doc_title, to!string(dochead_meta_json["title"]["main"]));
+ an_object["obj"]=replaceFirst(an_object["obj"], rgx.variable_doc_author, to!string(dochead_meta_json["creator"]["author"]));
collapsed_lev["h0"] = 1;
an_object["lev_collapsed_number"] =
to!string(collapsed_lev["h0"]);
@@ -4037,8 +4037,11 @@ template SiSUdocAbstraction() {
<<abs_init_struct>>
/+ ↓ abstract marked up document +/
- auto abstract_doc_source(char[][] markup_sourcefile_content) {
-
+ auto abstract_doc_source(
+ char[][] markup_sourcefile_content,
+ JSONValue[string] dochead_make_json,
+ JSONValue[string] dochead_meta_json
+ ) {
/+ ↓ abstraction init +/
<<abs_init_rest>>
/+ abstraction init ↑ +/