diff options
author | Ralph Amissah <ralph@amissah.com> | 2018-02-26 15:42:10 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 194c896c4a3780e9fece376507dcac3657237cd4 (patch) | |
tree | 171b7b0de4e743502dc5830af40251dcd7461b0f /org/meta_abstraction.org | |
parent | maker.org updates, including reggae builds (diff) |
playing with header/make substitutionsdoc-reform_v0.0.24
Diffstat (limited to 'org/meta_abstraction.org')
-rw-r--r-- | org/meta_abstraction.org | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index aa79d9a..a1e5a95 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -88,6 +88,7 @@ template SiSUdocAbstraction() { <<abs_functions_object_reset>> <<abs_functions_header_set_common>> <<abs_functions_ocn_status>> + <<abs_functions_substitutions>> <<abs_functions_block>> <<abs_functions_block_quote>> <<abs_functions_block_group>> @@ -825,6 +826,7 @@ if there is a blurb section you need to: #+BEGIN_SRC d } else if (obj_type_status["quote"] == TriState.on) { /+ within block object: quote +/ + line = _doc_header_and_make_substitutions_(line, conf_make_meta); _quote_block_(line, an_object, obj_type_status); continue; #+END_SRC @@ -836,6 +838,7 @@ if there is a blurb section you need to: /+ within block object: group +/ } else if (obj_type_status["group"] == TriState.on) { /+ within block object: group +/ + line = _doc_header_and_make_substitutions_(line, conf_make_meta); line = (line) .replaceAll(rgx.para_delimiter, mkup.br_paragraph ~ "$1"); _group_block_(line, an_object, obj_type_status); @@ -848,6 +851,7 @@ if there is a blurb section you need to: #+BEGIN_SRC d } else if (obj_type_status["block"] == TriState.on) { /+ within block object: block +/ + line = _doc_header_and_make_substitutions_(line, conf_make_meta); if (auto m = line.match(rgx.spaces_line_start)) { line = (line) .replaceAll(rgx.spaces_line_start, (m.captures[1]).translate([ ' ' : mkup.nbsp ])); @@ -903,6 +907,7 @@ if (line.matchFirst(rgx.block_poem_open)) { processing.remove("verse"); obj_cite_number_poem["start"] = obj_cite_digits.on.to!string; } +line = _doc_header_and_make_substitutions_(line, conf_make_meta); _start_block_(line, obj_type_status, obj_cite_number_poem); continue; #+END_SRC @@ -1012,6 +1017,7 @@ if (line.matchFirst(rgx.book_index) } else if (line_occur["para"] == State.off) { /+ para match +/ an_object_key="body_nugget"; + line = _doc_header_and_make_substitutions_(line, conf_make_meta); _para_match_(line, an_object, an_object_key, indent, bullet, obj_type_status, line_occur); } #+END_SRC @@ -1038,6 +1044,7 @@ if (line.matchFirst(rgx.book_index) debug(para) { writeln(an_object_key, "-> ", line); } + line = _doc_header_and_make_substitutions_(line, conf_make_meta); an_object[an_object_key] ~= " " ~ line; ++line_occur["para"]; } @@ -2524,6 +2531,46 @@ static auto _check_ocn_status_(L,T)( } #+END_SRC +#+name: abs_functions_substitutions +#+BEGIN_SRC d +auto _doc_header_and_make_substitutions_(L,CMM)( + L line, + CMM conf_make_meta, +) { + debug(asserts) { + static assert(is(typeof(line) == char[])); + } + if (!( + conf_make_meta.make.bold_rgxmatch == "=NULL" + || conf_make_meta.make.bold_rgxmatch.empty + )) { + line = line.replaceAll( + regex(conf_make_meta.make.bold_rgxmatch), + conf_make_meta.make.bold_substitute_sisu_markup + ); + } + if (!( + conf_make_meta.make.emphasis_rgxmatch == "=NULL" + || conf_make_meta.make.emphasis_rgxmatch.empty + )) { + line = line.replaceAll( + regex(conf_make_meta.make.emphasis_rgxmatch), + conf_make_meta.make.emphasis_substitute_sisu_markup + ); + } + if (!( + conf_make_meta.make.italics_rgxmatch == "=NULL" + || conf_make_meta.make.italics_rgxmatch.empty + )) { + line = line.replaceAll( + regex(conf_make_meta.make.italics_rgxmatch), + conf_make_meta.make.italics_substitute_sisu_markup + ); + } + return line; +} +#+END_SRC + *** block :block: **** block start (open) block :start: ***** { block starts function |