From 42942142d1379e7e5361a641f837beb54b23a2f1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 28 Nov 2016 20:03:08 -0500 Subject: discrete objects marks, output html work in progress --- src/sdp/output_html.d | 100 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 10 deletions(-) (limited to 'src/sdp/output_html.d') diff --git a/src/sdp/output_html.d b/src/sdp/output_html.d index 5552fe2..c20d6ef 100644 --- a/src/sdp/output_html.d +++ b/src/sdp/output_html.d @@ -7,7 +7,7 @@ template SiSUoutputHTML() { o = format(q"¶


- + %s
@@ -15,6 +15,7 @@ template SiSUoutputHTML() { obj.obj_cite_number, obj.obj_cite_number, obj.heading_attrib.lev_markup_number, + obj.is_a, obj.obj_cite_number, obj.obj_cite_number, obj.object, @@ -24,19 +25,93 @@ template SiSUoutputHTML() { } auto html_para(O)( auto ref const O obj, + ) { + string o; + if (obj.obj_cite_number.empty) { + o = format(q"¶
+ +

+ %s +

+
+ ¶", + obj.obj_cite_number, + obj.obj_cite_number, + obj.is_a, + obj.para_attrib.indent_start, + obj.para_attrib.indent_rest, + obj.object + ); + } else { + o = format(q"¶
+ +

+ %s +

+
+ ¶", + obj.obj_cite_number, + obj.obj_cite_number, + obj.is_a, + obj.para_attrib.indent_start, + obj.para_attrib.indent_rest, + obj.obj_cite_number, + obj.object + ); + } + return o; + } + auto html_endnote(O)( + auto ref const O obj, + ) { + string o; + o = format(q"¶
+ +

+ %s +

+
+ ¶", + obj.anchor_tags[0], + obj.anchor_tags[0], + obj.is_a, + obj.para_attrib.indent_start, + obj.para_attrib.indent_rest, + obj.object + ); + return o; + } + auto html_toc(O)( + auto ref const O obj, + ) { + string o; + o = format(q"¶
+

+ %s +

+
+ ¶", + obj.is_a, + obj.para_attrib.indent_start, + obj.para_attrib.indent_rest, + obj.object + ); + return o; + } + auto html_nugget(O)( + auto ref const O obj, ) { string o; o = format(q"¶
-

+

%s

¶", obj.obj_cite_number, obj.obj_cite_number, - obj.para_attrib.indent_start, - obj.para_attrib.indent_rest, + obj.is_a, obj.obj_cite_number, obj.object ); @@ -104,29 +179,34 @@ template SiSUoutputHTML() { case "heading": body_html ~= html_heading(obj); break; + case "toc": + body_html ~= html_toc(obj); + break; case "para": body_html ~= html_para(obj); break; case "verse": - body_html ~= html_para(obj); + body_html ~= html_nugget(obj); break; case "group": - body_html ~= html_para(obj); + body_html ~= html_nugget(obj); break; case "block": - body_html ~= html_para(obj); + body_html ~= html_nugget(obj); break; case "quote": - body_html ~= html_para(obj); + body_html ~= html_nugget(obj); break; case "table": body_html ~= html_para(obj); break; case "code": - body_html ~= html_para(obj); + body_html ~= html_nugget(obj); + break; + case "endnote": + body_html ~= html_endnote(obj); break; default: - body_html ~= html_para(obj); break; } } -- cgit v1.2.3