diff options
Diffstat (limited to 'org/output.org')
-rw-r--r-- | org/output.org | 216 |
1 files changed, 108 insertions, 108 deletions
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, "<br>\n") - .replaceAll(rgx.two_spaces, " " ~ " " ~ " " ~ " ") - .replaceAll(rgx.nbsp_and_space, " " ~ " "); string o; if (obj.obj_cite_number.empty) { - o = format(q"¶ <div class="substance"> - <p class="%s"> -%s - </p> - </div>¶", + o = format(q"¶ <div class="substance"> + <p class="%s"> + %s + </p> +</div>¶", obj.is_a, - _txt + obj.text ); } else { o = format(q"¶ <div class="substance"> - <label class="ocn"><a href="#%s" class="lnkocn">%s</a></label> - <p class="%s" id="%s"> -%s - </p> - </div>¶", + <label class="ocn"><a href="#%s" class="lnkocn">%s</a></label> + <p class="%s" id="%s"> + %s + </p> +</div>¶", 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, "<br>\n") + .replaceAll(rgx.two_spaces, " " ~ " " ~ " " ~ " ") + .replaceAll(rgx.nbsp_and_space, " " ~ " "); string o; if (obj.obj_cite_number.empty) { - o = format(q"¶ <div class="substance"> - <p class="%s"> - %s - </p> -</div>¶", + o = format(q"¶ <div class="substance"> + <p class="%s"> +%s + </p> + </div>¶", obj.is_a, - obj.text + _txt ); } else { o = format(q"¶ <div class="substance"> - <label class="ocn"><a href="#%s" class="lnkocn">%s</a></label> - <p class="%s" id="%s"> - %s - </p> -</div>¶", + <label class="ocn"><a href="#%s" class="lnkocn">%s</a></label> + <p class="%s" id="%s"> +%s + </p> + </div>¶", 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"¶ <p class="%s" indent="h%si%s"> - %s -</p>¶", - 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, "<br>\n") + .replaceAll(rgx.nbsp_char, " "); + string o; + if (obj.obj_cite_number.empty) { + o = format(q"¶ <div class="substance"> + <p class="%s"> +%s + </p> + </div>¶", + obj.is_a, + _txt + ); + } else { + o = format(q"¶ <div class="substance"> + <label class="ocn"><a href="#%s" class="lnkocn">%s</a></label> + <p class="%s" id="%s"> +%s + </p> + </div>¶", + 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, "<br>\n") - .replaceAll(rgx.nbsp_char, " "); - string o; - if (obj.obj_cite_number.empty) { - o = format(q"¶ <div class="substance"> - <p class="%s"> -%s - </p> - </div>¶", - obj.is_a, - _txt - ); - } else { - o = format(q"¶ <div class="substance"> - <label class="ocn"><a href="#%s" class="lnkocn">%s</a></label> - <p class="%s" id="%s"> -%s - </p> - </div>¶", - 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"¶ <p class="%s" indent="h%si%s"> + %s +</p>¶", + 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); |