aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output_html.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp/output_html.d')
-rw-r--r--src/sdp/output_html.d90
1 files changed, 40 insertions, 50 deletions
diff --git a/src/sdp/output_html.d b/src/sdp/output_html.d
index 38eadf0..dc19e6c 100644
--- a/src/sdp/output_html.d
+++ b/src/sdp/output_html.d
@@ -1,17 +1,5 @@
template SiSUoutputHTML() {
struct SDPoutputHTML {
- 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;
- }
auto html_heading(O)(
auto ref const O obj,
) {
@@ -100,6 +88,7 @@ template SiSUoutputHTML() {
}
void scroll(C)(
auto ref const C contents,
+ string[] document_parts,
string[][string][string] bookindex_unordered_hashes,
JSONValue[] biblio,
string[string][string] dochead_make,
@@ -111,47 +100,48 @@ template SiSUoutputHTML() {
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";