aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/meta/metadoc_from_src.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2018-02-27 18:19:53 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitfb3a5d3e04970c7631253f2530693d0cf21b33db (patch)
tree4001cd446ed137c3c7ac19badbee447000c622ca /src/sdp/meta/metadoc_from_src.d
parent0.25.0 remove sdlang (headers, conf, make doc) (diff)
(header, doc make, config) add checks to toml
Diffstat (limited to 'src/sdp/meta/metadoc_from_src.d')
-rw-r--r--src/sdp/meta/metadoc_from_src.d29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/sdp/meta/metadoc_from_src.d b/src/sdp/meta/metadoc_from_src.d
index 97e5f78..816f479 100644
--- a/src/sdp/meta/metadoc_from_src.d
+++ b/src/sdp/meta/metadoc_from_src.d
@@ -358,6 +358,27 @@ template SiSUdocAbstraction() {
string[] html_segnames=["toc"];
int cnt1 = 1; int cnt2 = 1; int cnt3 = 1;
/+ abstraction init ↑ +/
+ debug (substitutions) {
+ writeln(__LINE__, ":", __FILE__, ": DEBUG substitutions:");
+ if (conf_make_meta.make.substitute) {
+ foreach(substitution_pair; conf_make_meta.make.substitute) {
+ writeln("regex to match: ", substitution_pair[0]);
+ writeln("substitution to make: ", substitution_pair[1]);
+ }
+ }
+ if (!(conf_make_meta.make.bold_rgxmatch == "=NULL" || conf_make_meta.make.bold_rgxmatch.empty)) {
+ writeln("regex to match: ", conf_make_meta.make.bold_rgxmatch);
+ writeln("substitution to make: ", conf_make_meta.make.bold_substitute_html);
+ }
+ if (!(conf_make_meta.make.emphasis_rgxmatch == "=NULL" || conf_make_meta.make.emphasis_rgxmatch.empty)) {
+ writeln("regex to match: ", conf_make_meta.make.emphasis_rgxmatch);
+ writeln("substitution to make: ", conf_make_meta.make.emphasis_substitute_html);
+ }
+ if (!(conf_make_meta.make.italics_rgxmatch == "=NULL" || conf_make_meta.make.italics_rgxmatch.empty)) {
+ writeln("regex to match: ", conf_make_meta.make.italics_rgxmatch);
+ writeln("substitution to make: ", conf_make_meta.make.italics_substitute_html);
+ }
+ }
/+ ↓ loop markup document/text line by line +/
srcDocLoop:
foreach (line; markup_sourcefile_content) {
@@ -1931,6 +1952,14 @@ template SiSUdocAbstraction() {
debug(asserts) {
static assert(is(typeof(line) == char[]));
}
+ if (conf_make_meta.make.substitute) {
+ foreach(substitution_pair; conf_make_meta.make.substitute) {
+ line = line.replaceAll(
+ regex(substitution_pair[0]),
+ substitution_pair[1]
+ );
+ }
+ }
if (!(
conf_make_meta.make.bold_rgxmatch == "=NULL"
|| conf_make_meta.make.bold_rgxmatch.empty