aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output_html.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2017-04-28 12:00:37 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:14 -0400
commitf5320e4c3a9b21209ad7fd7c089bf144cfb60971 (patch)
tree236ee8570415e312d1686b80665cb8bb0770d91b /src/sdp/output_html.d
parentxml family css (diff)
xml family, special characters, deal with once
Diffstat (limited to 'src/sdp/output_html.d')
-rw-r--r--src/sdp/output_html.d68
1 files changed, 35 insertions, 33 deletions
diff --git a/src/sdp/output_html.d b/src/sdp/output_html.d
index 155ad48..509ae43 100644
--- a/src/sdp/output_html.d
+++ b/src/sdp/output_html.d
@@ -42,16 +42,17 @@ template outputHTML() {
string suffix = ".html";
foreach (part; doc_matters.keys_seq.scroll) {
foreach (obj; doc_abstraction[part]) {
+ string _txt = xhtml_format.special_characters(obj, obj.text);
switch (obj.use) {
case "frontmatter":
switch (obj.is_of) {
case "para":
switch (obj.is_a) {
case "heading":
- doc_html ~= xhtml_format.heading_scroll(obj, suffix);
+ doc_html ~= xhtml_format.heading_scroll(obj, _txt, suffix);
break;
case "toc":
- doc_html ~= xhtml_format.para_scroll(obj, suffix);
+ doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
if ((doc_matters.opt_action_bool["debug"])) {
@@ -72,10 +73,10 @@ template outputHTML() {
case "para":
switch (obj.is_a) {
case "heading":
- doc_html ~= xhtml_format.heading_scroll(obj, suffix);
+ doc_html ~= xhtml_format.heading_scroll(obj, _txt, suffix);
break;
case "para":
- doc_html ~= xhtml_format.para_scroll(obj, suffix);
+ doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
if ((doc_matters.opt_action_bool["debug"])) {
@@ -87,24 +88,24 @@ template outputHTML() {
case "block":
switch (obj.is_a) {
case "quote":
- doc_html ~= xhtml_format.quote_scroll(obj);
+ doc_html ~= xhtml_format.quote_scroll(obj, _txt);
break;
case "group":
- doc_html ~= xhtml_format.group_scroll(obj);
+ doc_html ~= xhtml_format.group_scroll(obj, _txt);
break;
case "block":
- doc_html ~= xhtml_format.block_scroll(obj);
+ doc_html ~= xhtml_format.block_scroll(obj, _txt);
break;
case "poem":
break;
case "verse":
- doc_html ~= xhtml_format.verse_scroll(obj, suffix);
+ doc_html ~= xhtml_format.verse_scroll(obj, _txt, suffix);
break;
case "code":
- doc_html ~= xhtml_format.code(obj);
+ doc_html ~= xhtml_format.code(obj, _txt);
break;
case "table":
- doc_html ~= xhtml_format.table(obj);
+ doc_html ~= xhtml_format.table(obj, _txt);
break;
default:
if ((doc_matters.opt_action_bool["debug"])) {
@@ -125,22 +126,22 @@ template outputHTML() {
case "para":
switch (obj.is_a) {
case "heading":
- doc_html ~= xhtml_format.heading_scroll(obj, suffix);
+ doc_html ~= xhtml_format.heading_scroll(obj, _txt, suffix);
break;
case "endnote":
- doc_html ~= xhtml_format.para_scroll(obj, suffix);
+ doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
case "glossary":
- doc_html ~= xhtml_format.para_scroll(obj, suffix);
+ doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
case "bibliography":
- doc_html ~= xhtml_format.para_scroll(obj, suffix);
+ doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
case "bookindex":
- doc_html ~= xhtml_format.para_scroll(obj, suffix);
+ doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
case "blurb":
- doc_html ~= xhtml_format.para_scroll(obj, suffix);
+ doc_html ~= xhtml_format.para_scroll(obj, _txt, suffix);
break;
default:
if ((doc_matters.opt_action_bool["debug"])) {
@@ -211,6 +212,7 @@ template outputHTML() {
string suffix = ".html";
foreach (part; doc_matters.keys_seq.seg) {
foreach (obj; doc_abstraction[part]) {
+ string _txt = xhtml_format.special_characters(obj, obj.text);
if (obj.is_a == "heading") { // all headings: frontmatter, body & backmatter
switch (obj.heading_lev_markup) {
case 0: .. case 3:
@@ -235,8 +237,8 @@ template outputHTML() {
top_level_headings[3] = "";
goto default;
default:
- auto t = xhtml_format.heading_seg(obj, suffix);
- top_level_headings[obj.heading_lev_markup] = t[0];
+ auto t = xhtml_format.heading_seg(obj, _txt, suffix);
+ top_level_headings[obj.heading_lev_markup] = t[0]; // should probably have different css tagging (fontsize etc)
break;
}
break;
@@ -247,12 +249,12 @@ template outputHTML() {
// writeln(top_level_heading);
doc_html[segment_filename] ~= top_level_heading;
}
- auto t = xhtml_format.heading_seg(obj, suffix);
+ auto t = xhtml_format.heading_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= to!string(t[0]);
doc_html_endnotes[segment_filename] ~= t[1];
break;
case 5: .. case 7:
- auto t = xhtml_format.heading_seg(obj, suffix);
+ auto t = xhtml_format.heading_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= to!string(t[0]);
doc_html_endnotes[segment_filename] ~= t[1];
break;
@@ -275,7 +277,7 @@ template outputHTML() {
case "para":
switch (obj.is_a) {
case "toc":
- auto t = xhtml_format.para_seg(obj, suffix);
+ auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= to!string(t[0]);
break;
default:
@@ -297,7 +299,7 @@ template outputHTML() {
case "para":
switch (obj.is_a) {
case "para":
- auto t = xhtml_format.para_seg(obj, suffix);
+ auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= to!string(t[0]);
doc_html_endnotes[segment_filename] ~= t[1];
break;
@@ -311,32 +313,32 @@ template outputHTML() {
case "block":
switch (obj.is_a) {
case "quote":
- auto t = xhtml_format.quote_seg(obj, suffix);
+ auto t = xhtml_format.quote_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= to!string(t[0]);
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "group":
- auto t = xhtml_format.group_seg(obj, suffix);
+ auto t = xhtml_format.group_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= to!string(t[0]);
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "block":
- auto t = xhtml_format.block_seg(obj, suffix);
+ auto t = xhtml_format.block_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= to!string(t[0]);
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "poem":
break;
case "verse":
- auto t = xhtml_format.verse_seg(obj, suffix);
+ auto t = xhtml_format.verse_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= to!string(t[0]);
doc_html_endnotes[segment_filename] ~= t[1]; // work on
break;
case "code":
- doc_html[segment_filename] ~= xhtml_format.code(obj);
+ doc_html[segment_filename] ~= xhtml_format.code(obj, _txt);
break;
case "table":
- doc_html[segment_filename] ~= xhtml_format.table(obj);
+ doc_html[segment_filename] ~= xhtml_format.table(obj, _txt);
doc_html_endnotes[segment_filename] ~= "";
break;
default:
@@ -358,26 +360,26 @@ template outputHTML() {
case "para":
switch (obj.is_a) {
case "endnote":
- auto t = xhtml_format.para_seg(obj, suffix);
+ auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= t[0];
break;
case "glossary":
- auto t = xhtml_format.para_seg(obj, suffix);
+ auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "bibliography":
- auto t = xhtml_format.para_seg(obj, suffix);
+ auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "bookindex":
- auto t = xhtml_format.para_seg(obj, suffix);
+ auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;
case "blurb":
- auto t = xhtml_format.para_seg(obj, suffix);
+ auto t = xhtml_format.para_seg(obj, _txt, suffix);
doc_html[segment_filename] ~= t[0];
doc_html_endnotes[segment_filename] ~= t[1];
break;