aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output_html.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-01-26 15:17:59 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commit2598e9f10a362f15fef081504d69757001b39cfb (patch)
tree76966a2d60a8ebb3ee67f3cef9a03926b7399d7b /src/sdp/output_html.d
parentoutput, template & struct names (diff)
output, message passing, minor
Diffstat (limited to 'src/sdp/output_html.d')
-rw-r--r--src/sdp/output_html.d29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/sdp/output_html.d b/src/sdp/output_html.d
index ec8b74e..0406b3c 100644
--- a/src/sdp/output_html.d
+++ b/src/sdp/output_html.d
@@ -2,9 +2,9 @@ template outputHTML() {
struct outputHTML {
mixin outputXHTMLs;
- void scroll_write_output_file(Fn,D)(
+ void scroll_write_output_file(Fn,C)(
Fn fn_src,
- D doc,
+ C doc,
) {
debug(asserts){
static assert(is(typeof(fn_src) == string));
@@ -135,25 +135,22 @@ template outputHTML() {
doc = xhtml_format.scroll_head(doc_matters.dochead_meta) ~ doc_html ~ xhtml_format.tail;
scroll_write_output_file(doc_matters.source_filename, doc);
}
- void seg_write_output_files(Fn,FnS,D)(
- Fn fn_src,
- FnS seg_filenames,
- D doc_html,
+ void seg_write_output_files(M,C)(
+ M doc_matters,
+ C doc_html,
) {
debug(asserts){
- static assert(is(typeof(fn_src) == string));
- static assert(is(typeof(seg_filenames) == string[]));
static assert(is(typeof(doc_html) == string[][string]));
}
mixin SiSUpaths;
auto pth_html = HtmlPaths();
auto xhtml_format = outputXHTMLs();
- auto m = matchFirst(fn_src, rgx.src_fn);
+ auto m = matchFirst(doc_matters.source_filename, rgx.src_fn);
try {
- mkdirRecurse(pth_html.seg(fn_src));
- foreach (seg_filename; seg_filenames) {
+ mkdirRecurse(pth_html.seg(doc_matters.source_filename));
+ foreach (seg_filename; doc_matters.segnames) {
// writeln(__LINE__, ": ", fn);
- auto f = File(pth_html.fn_seg(fn_src, seg_filename), "w");
+ auto f = File(pth_html.fn_seg(doc_matters.source_filename, seg_filename), "w");
/+ // f.writeln(seg_head); // not needed built and inserted earlier +/
foreach (docseg; doc_html[seg_filename]) {
f.writeln(docseg);
@@ -165,16 +162,15 @@ template outputHTML() {
// Handle error
}
}
- void seg(C,T)(
+ void seg(C,M)(
auto ref const C contents,
- auto ref T doc_matters,
+ auto ref M doc_matters,
) {
auto xhtml_format = outputXHTMLs();
auto rgx = Rgx();
string[][string] doc_html;
string[] doc;
string segment_filename;
- string[] seg_filenames;
string[] top_level_headings = ["","","",""];
foreach (part; doc_matters.keys_seq_seg) {
foreach (obj; contents[part]) {
@@ -207,7 +203,6 @@ template outputHTML() {
}
break;
case 4:
- seg_filenames ~= obj.segment_anchor_tag;
segment_filename = obj.segment_anchor_tag;
doc_html[segment_filename] ~= xhtml_format.seg_head(doc_matters.dochead_meta); // consider placing seg_head here as can more easily populate it with lev4 info
foreach (top_level_heading; top_level_headings) {
@@ -314,7 +309,7 @@ template outputHTML() {
}
}
writeln(doc_matters.keys_seq_seg);
- seg_write_output_files(doc_matters.source_filename, seg_filenames, doc_html);
+ seg_write_output_files(doc_matters, doc_html);
}
auto html_css() {
string css;