aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/output.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-11-09 17:52:33 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:13 -0400
commit2301a8251d111ca2e020f524ce036c11e4306a14 (patch)
treeaed462b441e64efe989dca5c5d5eee306d9d53be /org/output.org
parenta bit of naming and tidying (diff)
0.9.0 document sections
Diffstat (limited to 'org/output.org')
-rw-r--r--org/output.org49
1 files changed, 17 insertions, 32 deletions
diff --git a/org/output.org b/org/output.org
index a9ad6fd..073e56f 100644
--- a/org/output.org
+++ b/org/output.org
@@ -78,7 +78,7 @@ auto html_para(O)(
#+name: output_html
#+BEGIN_SRC d
-auto scroll_head() {
+auto scroll_head_html() {
string o;
o = format(q"◎
<!DOCTYPE html>
@@ -111,7 +111,7 @@ auto scroll_head() {
◎");
return o;
}
-auto scroll_tail() {
+auto scroll_tail_html() {
string o;
o = format(q"◎
<a name="bottom" id="bottom"></a>
@@ -130,54 +130,51 @@ auto scroll_tail() {
#+BEGIN_SRC d
void scroll(C)(
auto ref const C contents,
- string[] document_parts,
- string[][string][string] bookindex_unordered_hashes,
- JSONValue[] biblio,
+ string[][string] document_section_keys_sequenced,
string[string][string] dochead_make,
string[string][string] dochead_meta,
string fn_src,
bool[string] opt_action_bool
) {
auto rgx = Rgx();
- string[] toc;
- string[] body_;
+ string[] body_html;
string[] doc;
- foreach (part; document_parts) {
+ foreach (part; document_section_keys_sequenced["scroll"]) {
foreach (obj; contents[part]) {
if (obj.use == "content") {
switch (obj.is_a) {
case "heading":
- body_ ~= html_heading(obj);
+ body_html ~= html_heading(obj);
break;
case "para":
- body_ ~= html_para(obj);
+ body_html ~= html_para(obj);
break;
case "verse":
- body_ ~= html_para(obj);
+ body_html ~= html_para(obj);
break;
case "group":
- body_ ~= html_para(obj);
+ body_html ~= html_para(obj);
break;
case "block":
- body_ ~= html_para(obj);
+ body_html ~= html_para(obj);
break;
case "quote":
- body_ ~= html_para(obj);
+ body_html ~= html_para(obj);
break;
case "table":
- body_ ~= html_para(obj);
+ body_html ~= html_para(obj);
break;
case "code":
- body_ ~= html_para(obj);
+ body_html ~= html_para(obj);
break;
default:
- body_ ~= html_para(obj);
+ body_html ~= html_para(obj);
break;
}
}
}
}
- doc = scroll_head ~ body_ ~ scroll_tail;
+ doc = scroll_head_html ~ body_html ~ scroll_tail_html;
auto m = matchFirst(fn_src, rgx.src_fn);
auto fn = m["fn_base"] ~ ".html";
auto pth_html = "en/html";
@@ -1522,15 +1519,13 @@ template SiSUoutputHub() {
struct SDPoutput {
void hub(S)(
auto ref const S contents,
- string[][string][string] bookindex_unordered_hashes,
- JSONValue[] biblio,
+ string[][string] document_section_keys_sequenced,
string[string][string] dochead_make,
string[string][string] dochead_meta,
string fn_src,
bool[string] opt_action_bool
) {
auto rgx = Rgx();
- string[] document_parts;
if (opt_action_bool["source"]) {
writeln("sisupod source");
}
@@ -1543,20 +1538,10 @@ template SiSUoutputHub() {
if (opt_action_bool["html"]) {
mixin SiSUoutputHTML;
auto html=SDPoutputHTML();
- document_parts = [
- "head",
- "toc_scroll",
- "body",
- "endnotes_scroll",
- "bibliography",
- "bookindex_scroll"
- ];
html.css_write;
html.scroll(
contents,
- document_parts,
- bookindex_unordered_hashes,
- biblio,
+ document_section_keys_sequenced,
dochead_make,
dochead_meta,
fn_src,