From fb3a5d3e04970c7631253f2530693d0cf21b33db Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 27 Feb 2018 18:19:53 -0500 Subject: (header, doc make, config) add checks to toml --- src/sdp/meta/metadoc_from_src.d | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/sdp/meta/metadoc_from_src.d') 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 -- cgit v1.2.3