From 334bb9c301bb72d5331a2e9e067211c18e5f7c69 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 23 Jan 2017 17:17:47 -0500 Subject: templates --- src/sdp/output_html.d | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/sdp/output_html.d') diff --git a/src/sdp/output_html.d b/src/sdp/output_html.d index 1975958..bf1d59c 100644 --- a/src/sdp/output_html.d +++ b/src/sdp/output_html.d @@ -2,10 +2,14 @@ template SiSUoutputHTML() { struct SDPoutputHTML { mixin SiSUoutputXHTMLs; - void scroll_write_output_file( - string fn_src, - string[] doc, + void scroll_write_output_file(Fn,D)( + Fn fn_src, + D doc, ) { + debug(asserts){ + static assert(is(typeof(fn_src) == string)); + static assert(is(typeof(doc) == string[])); + } mixin SiSUpaths; auto pth_html = HtmlPaths(); try { @@ -131,11 +135,16 @@ template SiSUoutputHTML() { 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( - string fn_src, - string[] seg_filenames, - string[][string] doc_html, + void seg_write_output_files(Fn,FnS,D)( + Fn fn_src, + FnS seg_filenames, + D 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 = SDPoutputXHTMLs(); -- cgit v1.2.3