aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/meta/metadoc_from_src.d
diff options
context:
space:
mode:
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