From 25ac32b30c6ba98b32006677e2633befaa69483a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 27 Mar 2017 18:13:27 -0400 Subject: output, move stuff about --- org/output.org | 216 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 108 insertions(+), 108 deletions(-) (limited to 'org/output.org') diff --git a/org/output.org b/org/output.org index 1b2ee5f..c59b037 100644 --- a/org/output.org +++ b/org/output.org @@ -776,99 +776,118 @@ auto para_seg(O)( } #+END_SRC -**** poem verse +**** nugget #+name: xhtml_format_objects #+BEGIN_SRC d -auto verse(O)( // using code from code block, review +auto nugget(O)( auto return ref const O obj, ) { - string _txt = obj.text; - _txt = (_txt) - .replaceAll(rgx.newline, "
\n") - .replaceAll(rgx.two_spaces, " " ~ " " ~ " " ~ " ") - .replaceAll(rgx.nbsp_and_space, " " ~ " "); string o; if (obj.obj_cite_number.empty) { - o = format(q"¶
-

-%s -

-
¶", + o = format(q"¶
+

+ %s +

+
¶", obj.is_a, - _txt + obj.text ); } else { o = format(q"¶
- -

-%s -

-
¶", + +

+ %s +

+¶", obj.obj_cite_number, obj.obj_cite_number, obj.is_a, obj.obj_cite_number, - _txt + obj.text ); } return o; } #+END_SRC -**** nugget +**** poem verse #+name: xhtml_format_objects #+BEGIN_SRC d -auto nugget(O)( +auto verse(O)( // using code from code block, review auto return ref const O obj, ) { + string _txt = obj.text; + _txt = (_txt) + .replaceAll(rgx.newline, "
\n") + .replaceAll(rgx.two_spaces, " " ~ " " ~ " " ~ " ") + .replaceAll(rgx.nbsp_and_space, " " ~ " "); string o; if (obj.obj_cite_number.empty) { - o = format(q"¶
-

- %s -

-
¶", + o = format(q"¶
+

+%s +

+
¶", obj.is_a, - obj.text + _txt ); } else { o = format(q"¶
- -

- %s -

-
¶", + +

+%s +

+ ¶", obj.obj_cite_number, obj.obj_cite_number, obj.is_a, obj.obj_cite_number, - obj.text + _txt ); } return o; } #+END_SRC -**** endnote +**** code -#+name: xhtml_format_objects +#+name: xhtml_format_objects_code #+BEGIN_SRC d -auto endnote(O)( - auto return ref const O obj, -) { - string o; - o = format(q"¶

- %s -

¶", - obj.is_a, - obj.indent_hang, - obj.indent_base, - obj.text - ); - return o; -} + auto code(O)( + auto return ref const O obj, + ) { + string _txt = obj.text; + _txt = (_txt) + .replaceAll(rgx.newline, "
\n") + .replaceAll(rgx.nbsp_char, " "); + string o; + if (obj.obj_cite_number.empty) { + o = format(q"¶
+

+%s +

+
¶", + obj.is_a, + _txt + ); + } else { + o = format(q"¶
+ +

+%s +

+
¶", + obj.obj_cite_number, + obj.obj_cite_number, + obj.is_a, + obj.obj_cite_number, + _txt + ); + } + return o; + } #+END_SRC **** table @@ -955,43 +974,24 @@ auto table(O)( } #+END_SRC -**** code +**** endnote -#+name: xhtml_format_objects_code +#+name: xhtml_format_objects #+BEGIN_SRC d - auto code(O)( - auto return ref const O obj, - ) { - string _txt = obj.text; - _txt = (_txt) - .replaceAll(rgx.newline, "
\n") - .replaceAll(rgx.nbsp_char, " "); - string o; - if (obj.obj_cite_number.empty) { - o = format(q"¶
-

-%s -

-
¶", - obj.is_a, - _txt - ); - } else { - o = format(q"¶
- -

-%s -

-
¶", - obj.obj_cite_number, - obj.obj_cite_number, - obj.is_a, - obj.obj_cite_number, - _txt - ); - } - return o; - } +auto endnote(O)( + auto return ref const O obj, +) { + string o; + o = format(q"¶

+ %s +

¶", + obj.is_a, + obj.indent_hang, + obj.indent_base, + obj.text + ); + return o; +} #+END_SRC *** _html_ [#A] :html: @@ -1069,10 +1069,8 @@ void scroll(D,I)( break; case "block": switch (obj.is_a) { - case "poem": - break; - case "verse": - doc_html ~= xhtml_format.verse(obj); + case "quote": + doc_html ~= xhtml_format.nugget(obj); break; case "group": doc_html ~= xhtml_format.nugget(obj); @@ -1080,15 +1078,17 @@ void scroll(D,I)( case "block": doc_html ~= xhtml_format.nugget(obj); break; - case "quote": - doc_html ~= xhtml_format.nugget(obj); + case "poem": break; - case "table": - doc_html ~= xhtml_format.table(obj); + case "verse": + doc_html ~= xhtml_format.verse(obj); break; case "code": doc_html ~= xhtml_format.code(obj); break; + case "table": + doc_html ~= xhtml_format.table(obj); + break; default: if ((doc_matters.opt_action_bool["debug"])) { writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); @@ -1303,10 +1303,8 @@ void seg(D,I)( break; case "block": switch (obj.is_a) { - case "poem": - break; - case "verse": - doc_html[segment_filename] ~= xhtml_format.verse(obj); + case "quote": + doc_html[segment_filename] ~= xhtml_format.nugget(obj); break; case "group": doc_html[segment_filename] ~= xhtml_format.nugget(obj); @@ -1314,16 +1312,18 @@ void seg(D,I)( case "block": doc_html[segment_filename] ~= xhtml_format.nugget(obj); break; - case "quote": - doc_html[segment_filename] ~= xhtml_format.nugget(obj); + case "poem": break; - case "table": - doc_html[segment_filename] ~= xhtml_format.table(obj); - doc_html_endnotes[segment_filename] ~= ""; + case "verse": + doc_html[segment_filename] ~= xhtml_format.verse(obj); break; case "code": doc_html[segment_filename] ~= xhtml_format.code(obj); break; + case "table": + doc_html[segment_filename] ~= xhtml_format.table(obj); + doc_html_endnotes[segment_filename] ~= ""; + break; default: if ((doc_matters.opt_action_bool["debug"])) { writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); @@ -2587,9 +2587,7 @@ void outputEPub(D,I)( break; case "block": switch (obj.is_a) { - case "poem": // double check why both poem & verse - break; - case "verse": + case "quote": doc_epub[segment_filename] ~= xhtml_format.nugget(obj); break; case "group": @@ -2598,17 +2596,19 @@ void outputEPub(D,I)( case "block": doc_epub[segment_filename] ~= xhtml_format.nugget(obj); break; - case "quote": + case "poem": + break; + case "verse": doc_epub[segment_filename] ~= xhtml_format.nugget(obj); break; + case "code": + doc_epub[segment_filename] ~= xhtml_format.code(obj); + break; case "table": auto t = xhtml_format.para_seg(obj, suffix); doc_epub[segment_filename] ~= t[0]; doc_epub_endnotes[segment_filename] ~= t[1]; break; - case "code": - doc_epub[segment_filename] ~= xhtml_format.code(obj); - break; default: if ((doc_matters.opt_action_bool["debug"])) { writeln(__FILE__, ":", __LINE__, ": ", obj.is_a); -- cgit v1.2.3