From 50ea3e06e59a8d076918e32880954ed8e0d9c26e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 20 Jan 2017 11:11:13 -0500 Subject: output template --- org/output.org | 142 ++++++++++++++++++++++++----------------------- org/sdp.org | 8 +-- src/sdp.d | 8 +-- src/sdp/output_hub.d | 141 +++++++++++++++++++++++----------------------- src/sdp/source_sisupod.d | 1 + 5 files changed, 152 insertions(+), 148 deletions(-) diff --git a/org/output.org b/org/output.org index 45cb791..fe1a869 100644 --- a/org/output.org +++ b/org/output.org @@ -21,74 +21,79 @@ output hub
check & generate output types requested +/ -template SiSUoutputHub() { - struct SDPoutput { - void hub(S,T)( - auto ref const S contents, - auto ref T doc_matters, - ) { - auto rgx = Rgx(); - if (doc_matters.opt_action_bool["source"]) { - writeln("source"); - } - if (doc_matters.opt_action_bool["sisupod"]) { - mixin SiSUpod; - auto sisupod=SDPsisupod(); - sisupod.sisupod_assemble(doc_matters.source_filename); - writeln("sisupod source"); - } - if (doc_matters.opt_action_bool["text"]) { - writeln("text processing"); - } - if (doc_matters.opt_action_bool["html"]) { - mixin SiSUoutputHTML; - auto html=SDPoutputHTML(); - html.css_write; - html.scroll( - contents, - doc_matters, - ); - html.seg( - contents, - doc_matters, - ); - } else if(doc_matters.opt_action_bool["html_seg"]) { - mixin SiSUoutputHTML; - auto html=SDPoutputHTML(); - html.css_write; - html.seg( - contents, - doc_matters, - ); - } else if(doc_matters.opt_action_bool["html_scroll"]) { - mixin SiSUoutputHTML; - auto html=SDPoutputHTML(); - html.css_write; - html.scroll( - contents, - doc_matters, - ); - } - if (doc_matters.opt_action_bool["epub"]) { - mixin SiSUoutputEPub; - auto epub=SDPoutputEPub(); - epub.doc_content( // consolidate - contents, - doc_matters, - ); - } - if (doc_matters.opt_action_bool["pdf"]) { - writeln("pdf processing"); - } - if (doc_matters.opt_action_bool["odt"]) { - writeln("odt processing"); - } - if (doc_matters.opt_action_bool["sqlite"]) { - writeln("sqlite processing"); - } - if (doc_matters.opt_action_bool["postgresql"]) { - writeln("pgsql processing"); - } +template outputHub() { + void outputHub(C,D)(C contents, D doc_matters) { + auto rgx = Rgx(); + if (doc_matters.opt_action_bool["source"]) { + /+ mixin SiSUoutputSource; +/ + writeln("source"); + } + if (doc_matters.opt_action_bool["sisupod"]) { + mixin SiSUpod; + auto sisupod=SDPsisupod(); + sisupod.sisupod_assemble(doc_matters.source_filename); + writeln("sisupod source"); + } + if (doc_matters.opt_action_bool["text"]) { + /+ mixin SiSUoutputText; +/ + writeln("text processing"); + // auto text=SDPoutput_text(); + // text.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); + } + if (doc_matters.opt_action_bool["html"]) { + mixin SiSUoutputHTML; + auto html=SDPoutputHTML(); + html.css_write; + html.scroll( + contents, + doc_matters, + ); + html.seg( + contents, + doc_matters, + ); + } else if(doc_matters.opt_action_bool["html_seg"]) { + mixin SiSUoutputHTML; + auto html=SDPoutputHTML(); + html.css_write; + html.seg( + contents, + doc_matters, + ); + } else if(doc_matters.opt_action_bool["html_scroll"]) { + mixin SiSUoutputHTML; + auto html=SDPoutputHTML(); + html.css_write; + html.scroll( + contents, + doc_matters, + ); + } + if (doc_matters.opt_action_bool["epub"]) { + mixin SiSUoutputEPub; + auto epub=SDPoutputEPub(); + epub.doc_content( // consolidate + contents, + doc_matters, + ); + // epub.css_write; + // writeln("epub processing"); + } + if (doc_matters.opt_action_bool["pdf"]) { + /+ mixin SiSUoutputPDF; +/ + writeln("pdf processing"); + } + if (doc_matters.opt_action_bool["odt"]) { + /+ mixin SiSUoutputODT; +/ + writeln("odt processing"); + } + if (doc_matters.opt_action_bool["sqlite"]) { + /+ mixin SiSUoutputSQLite; +/ + writeln("sqlite processing"); + } + if (doc_matters.opt_action_bool["postgresql"]) { + /+ mixin SiSUoutputPostgreSQL; +/ + writeln("pgsql processing"); } } } @@ -163,6 +168,7 @@ void sisupod_assemble( auto pth_sisupod = SiSUpodPaths(); mixin SiSUlanguageCodes; auto lang = Lang(); + auto rgx = Rgx(); /+ dir structure /tmp/_sisu_processing_/ralph/en/sisupod diff --git a/org/sdp.org b/org/sdp.org index 493540a..00363ca 100644 --- a/org/sdp.org +++ b/org/sdp.org @@ -198,7 +198,7 @@ mixin SiSUconfigSDLangHub; mixin SiSUmarkupRaw; mixin SiSUdocAbstraction; mixin SiSUoutputDebugs; -mixin SiSUoutputHub; +mixin outputHub; #+END_SRC **** init :init: @@ -209,7 +209,6 @@ auto raw = MarkupRaw(); auto head = HeaderDocMetadataAndMake(); auto abs = SiSUdocAbstraction(); auto dbg = SDPoutputDebugs(); -auto output = SDPoutput(); /+ struct DocumentParts { string[string][] contents; @@ -495,10 +494,7 @@ debug(checkdoc) { #+BEGIN_SRC d /+ ↓ output hub +/ if (!(_opt_action_bool["skip_output"])) { - output.hub( - doc_abstraction, - doc_matters, - ); + outputHub(doc_abstraction, doc_matters); } #+END_SRC diff --git a/src/sdp.d b/src/sdp.d index 743db94..58954c6 100755 --- a/src/sdp.d +++ b/src/sdp.d @@ -56,12 +56,11 @@ void main(string[] args) { mixin SiSUmarkupRaw; mixin SiSUdocAbstraction; mixin SiSUoutputDebugs; - mixin SiSUoutputHub; + mixin outputHub; auto raw = MarkupRaw(); auto head = HeaderDocMetadataAndMake(); auto abs = SiSUdocAbstraction(); auto dbg = SDPoutputDebugs(); - auto output = SDPoutput(); /+ struct DocumentParts { string[string][] contents; @@ -275,10 +274,7 @@ void main(string[] args) { } /+ ↓ output hub +/ if (!(_opt_action_bool["skip_output"])) { - output.hub( - doc_abstraction, - doc_matters, - ); + outputHub(doc_abstraction, doc_matters); } scope(exit) { debug(checkdoc) { diff --git a/src/sdp/output_hub.d b/src/sdp/output_hub.d index bcf0154..db6bee2 100644 --- a/src/sdp/output_hub.d +++ b/src/sdp/output_hub.d @@ -2,74 +2,79 @@ output hub
check & generate output types requested +/ -template SiSUoutputHub() { - struct SDPoutput { - void hub(S,T)( - auto ref const S contents, - auto ref T doc_matters, - ) { - auto rgx = Rgx(); - if (doc_matters.opt_action_bool["source"]) { - writeln("source"); - } - if (doc_matters.opt_action_bool["sisupod"]) { - mixin SiSUpod; - auto sisupod=SDPsisupod(); - sisupod.sisupod_assemble(doc_matters.source_filename); - writeln("sisupod source"); - } - if (doc_matters.opt_action_bool["text"]) { - writeln("text processing"); - } - if (doc_matters.opt_action_bool["html"]) { - mixin SiSUoutputHTML; - auto html=SDPoutputHTML(); - html.css_write; - html.scroll( - contents, - doc_matters, - ); - html.seg( - contents, - doc_matters, - ); - } else if(doc_matters.opt_action_bool["html_seg"]) { - mixin SiSUoutputHTML; - auto html=SDPoutputHTML(); - html.css_write; - html.seg( - contents, - doc_matters, - ); - } else if(doc_matters.opt_action_bool["html_scroll"]) { - mixin SiSUoutputHTML; - auto html=SDPoutputHTML(); - html.css_write; - html.scroll( - contents, - doc_matters, - ); - } - if (doc_matters.opt_action_bool["epub"]) { - mixin SiSUoutputEPub; - auto epub=SDPoutputEPub(); - epub.doc_content( // consolidate - contents, - doc_matters, - ); - } - if (doc_matters.opt_action_bool["pdf"]) { - writeln("pdf processing"); - } - if (doc_matters.opt_action_bool["odt"]) { - writeln("odt processing"); - } - if (doc_matters.opt_action_bool["sqlite"]) { - writeln("sqlite processing"); - } - if (doc_matters.opt_action_bool["postgresql"]) { - writeln("pgsql processing"); - } +template outputHub() { + void outputHub(C,D)(C contents, D doc_matters) { + auto rgx = Rgx(); + if (doc_matters.opt_action_bool["source"]) { + /+ mixin SiSUoutputSource; +/ + writeln("source"); + } + if (doc_matters.opt_action_bool["sisupod"]) { + mixin SiSUpod; + auto sisupod=SDPsisupod(); + sisupod.sisupod_assemble(doc_matters.source_filename); + writeln("sisupod source"); + } + if (doc_matters.opt_action_bool["text"]) { + /+ mixin SiSUoutputText; +/ + writeln("text processing"); + // auto text=SDPoutput_text(); + // text.scroll(contents, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool); + } + if (doc_matters.opt_action_bool["html"]) { + mixin SiSUoutputHTML; + auto html=SDPoutputHTML(); + html.css_write; + html.scroll( + contents, + doc_matters, + ); + html.seg( + contents, + doc_matters, + ); + } else if(doc_matters.opt_action_bool["html_seg"]) { + mixin SiSUoutputHTML; + auto html=SDPoutputHTML(); + html.css_write; + html.seg( + contents, + doc_matters, + ); + } else if(doc_matters.opt_action_bool["html_scroll"]) { + mixin SiSUoutputHTML; + auto html=SDPoutputHTML(); + html.css_write; + html.scroll( + contents, + doc_matters, + ); + } + if (doc_matters.opt_action_bool["epub"]) { + mixin SiSUoutputEPub; + auto epub=SDPoutputEPub(); + epub.doc_content( // consolidate + contents, + doc_matters, + ); + // epub.css_write; + // writeln("epub processing"); + } + if (doc_matters.opt_action_bool["pdf"]) { + /+ mixin SiSUoutputPDF; +/ + writeln("pdf processing"); + } + if (doc_matters.opt_action_bool["odt"]) { + /+ mixin SiSUoutputODT; +/ + writeln("odt processing"); + } + if (doc_matters.opt_action_bool["sqlite"]) { + /+ mixin SiSUoutputSQLite; +/ + writeln("sqlite processing"); + } + if (doc_matters.opt_action_bool["postgresql"]) { + /+ mixin SiSUoutputPostgreSQL; +/ + writeln("pgsql processing"); } } } diff --git a/src/sdp/source_sisupod.d b/src/sdp/source_sisupod.d index dc54b21..3cd5b94 100644 --- a/src/sdp/source_sisupod.d +++ b/src/sdp/source_sisupod.d @@ -8,6 +8,7 @@ template SiSUpod() { auto pth_sisupod = SiSUpodPaths(); mixin SiSUlanguageCodes; auto lang = Lang(); + auto rgx = Rgx(); /+ dir structure /tmp/_sisu_processing_/ralph/en/sisupod -- cgit v1.2.3