aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/output.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/output.org')
-rw-r--r--org/output.org114
1 files changed, 59 insertions, 55 deletions
diff --git a/org/output.org b/org/output.org
index 1dd19a8..1c9902a 100644
--- a/org/output.org
+++ b/org/output.org
@@ -20,22 +20,6 @@
**** html functions
***** html
-#+name: output_html
-#+BEGIN_SRC d
-auto html_toc(O)(
- auto ref const O obj,
-) {
- string o;
- o = format(q"◎<h%s class="toc"><a href="#%s">%s</a></h%s>◎",
- obj.heading_attrib.lev_markup_number,
- obj.obj_cite_number,
- obj.object,
- obj.heading_attrib.lev_markup_number
- );
- return o;
-}
-#+END_SRC
-
***** heading
#+name: output_html
@@ -146,6 +130,7 @@ 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][string] dochead_make,
@@ -157,47 +142,48 @@ void scroll(C)(
string[] toc;
string[] body_;
string[] doc;
- foreach (obj; contents) {
- if (obj.use == "content") {
- switch (obj.is_a) {
- case "heading":
- toc ~= html_toc(obj);
- body_ ~= html_heading(obj);
- break;
- case "para":
- body_ ~= html_para(obj);
- break;
- case "verse":
- body_ ~= html_para(obj);
- // body_ ~= html_verse(obj);
- break;
- case "group":
- body_ ~= html_para(obj);
- // body_ ~= html_group(obj);
- break;
- case "block":
- body_ ~= html_para(obj);
- // body_ ~= html_block(obj);
- break;
- case "quote":
- body_ ~= html_para(obj);
- // body_ ~= html_quote(obj);
- break;
- case "table":
- body_ ~= html_para(obj);
- // body_ ~= html_table(obj);
- break;
- case "code":
- body_ ~= html_para(obj);
- // body_ ~= html_code(obj);
- break;
- default:
- body_ ~= html_para(obj);
- break;
+ foreach (part; document_parts) {
+ foreach (obj; contents[part]) {
+ if (obj.use == "content") {
+ switch (obj.is_a) {
+ case "heading":
+ body_ ~= html_heading(obj);
+ break;
+ case "para":
+ body_ ~= html_para(obj);
+ break;
+ case "verse":
+ body_ ~= html_para(obj);
+ // body_ ~= html_verse(obj);
+ break;
+ case "group":
+ body_ ~= html_para(obj);
+ // body_ ~= html_group(obj);
+ break;
+ case "block":
+ body_ ~= html_para(obj);
+ // body_ ~= html_block(obj);
+ break;
+ case "quote":
+ body_ ~= html_para(obj);
+ // body_ ~= html_quote(obj);
+ break;
+ case "table":
+ body_ ~= html_para(obj);
+ // body_ ~= html_table(obj);
+ break;
+ case "code":
+ body_ ~= html_para(obj);
+ // body_ ~= html_code(obj);
+ break;
+ default:
+ body_ ~= html_para(obj);
+ break;
+ }
}
}
}
- doc = scroll_head ~ toc ~ body_ ~ scroll_tail;
+ doc = scroll_head ~ body_ ~ scroll_tail;
auto m = matchFirst(fn_src, rgx.src_fn);
auto fn = m["fn_base"] ~ ".html";
auto pth_html = "en/html";
@@ -1555,6 +1541,7 @@ template SiSUoutputHub() {
bool[string] opt_action_bool
) {
auto rgx = Rgx();
+ string[] document_parts;
if (opt_action_bool["source"]) {
writeln("sisupod source");
}
@@ -1569,8 +1556,25 @@ 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, bookindex_unordered_hashes, biblio, dochead_make, dochead_meta, fn_src, opt_action_bool);
+ html.scroll(
+ contents,
+ document_parts,
+ bookindex_unordered_hashes,
+ biblio,
+ dochead_make,
+ dochead_meta,
+ fn_src,
+ opt_action_bool
+ );
}
if (opt_action_bool["epub"]) {
writeln("epub processing");