From 495dcb42fbd8429d1d7261b3efb418fd8978bf2e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 13 Jan 2019 14:00:06 -0500 Subject: 0.4.2 xmls output, internal --- src/doc_reform/output/xmls.d | 152 +++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 85 deletions(-) (limited to 'src/doc_reform/output/xmls.d') diff --git a/src/doc_reform/output/xmls.d b/src/doc_reform/output/xmls.d index ef35e10..58cfb4e 100644 --- a/src/doc_reform/output/xmls.d +++ b/src/doc_reform/output/xmls.d @@ -44,31 +44,25 @@ template outputXHTMLs() { // you also need to close the last div, introduce a footer? return delimit; } - string special_characters(O)( - const O obj, - string _txt - ){ + string special_characters_text(string _txt){ _txt = _txt .replaceAll(rgx.xhtml_ampersand, "&") .replaceAll(rgx.xhtml_quotation, """) .replaceAll(rgx.xhtml_less_than, "<") .replaceAll(rgx.xhtml_greater_than, ">") .replaceAll(rgx.nbsp_char, " "); + return _txt; + } + string special_characters(O)( + const O obj, + ){ + string _txt = special_characters_text(obj.text); if (!(obj.metainfo.is_a == "code")) { _txt = (_txt) .replaceAll(rgx.xhtml_line_break, "
"); } return _txt; } - string special_characters_text(string _txt){ - _txt = _txt - .replaceAll(rgx.xhtml_ampersand, "&") - .replaceAll(rgx.xhtml_quotation, """) - .replaceAll(rgx.xhtml_less_than, "<") - .replaceAll(rgx.xhtml_greater_than, ">") - .replaceAll(rgx.nbsp_char, " "); - return _txt; - } string font_face(string _txt){ _txt = _txt .replaceAll(rgx.inline_emphasis, ("$1")) @@ -98,19 +92,7 @@ template outputXHTMLs() { auto header_metadata(M)( M doc_matters, ) { - string _title="Title"; - string _author="Author"; - string _publisher="Publisher"; - string _date="Date"; - string _date_created="Date"; - string _date_issued="Date"; - string _date_available="Date"; - string _date_valid="Date"; - string _date_modified="Date"; - string _language="en"; - string _rights="Copyright: Copyright (C) year holder"; - string _generator="doc_reform [DocReform 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)"; - string _generator_home="http://www.sisudoc.org"; + string _publisher="Publisher"; // TODO string o; o = format(q"¶ @@ -128,19 +110,19 @@ template outputXHTMLs() { ¶", - _title, - _author, - _publisher, - _date, - _date_created, - _date_issued, - _date_available, - _date_valid, - _date_modified, - _language, - _rights, - _generator, - _generator_home, + doc_matters.conf_make_meta.meta.title_full, + doc_matters.conf_make_meta.meta.creator_author, + _publisher, + doc_matters.conf_make_meta.meta.date_published, + doc_matters.conf_make_meta.meta.date_created, + doc_matters.conf_make_meta.meta.date_issued, + doc_matters.conf_make_meta.meta.date_available, + doc_matters.conf_make_meta.meta.date_valid, + doc_matters.conf_make_meta.meta.date_modified, + doc_matters.src.language, + doc_matters.conf_make_meta.meta.rights_copyright, + doc_matters.generator_program.name_and_version, + doc_matters.generator_program.url_home, ); return o; } @@ -164,7 +146,7 @@ template outputXHTMLs() { o = format(q"¶
%s
¶", - _locations, + _locations, ); return o; } @@ -289,18 +271,18 @@ template outputXHTMLs() { - - - - - - - - - - - - + + + + + + + + + + + + @@ -312,6 +294,16 @@ template outputXHTMLs() { doc_matters.conf_make_meta.meta.title_full, (doc_matters.conf_make_meta.meta.creator_author.empty) ? "" : ", " ~ doc_matters.conf_make_meta.meta.creator_author, + doc_matters.conf_make_meta.meta.date_published, + doc_matters.conf_make_meta.meta.date_created, + doc_matters.conf_make_meta.meta.date_issued, + doc_matters.conf_make_meta.meta.date_available, + doc_matters.conf_make_meta.meta.date_valid, + doc_matters.conf_make_meta.meta.date_modified, + doc_matters.src.language, + doc_matters.conf_make_meta.meta.rights_copyright, + doc_matters.generator_program.name_and_version, + doc_matters.generator_program.url_home, doc_matters.src.language, ); return o; @@ -624,8 +616,7 @@ template outputXHTMLs() { } return bar(); } - auto heading(M,O)( - M doc_matters, + auto heading(O)( const O obj, string _txt, string _xml_type = "html", @@ -688,7 +679,7 @@ template outputXHTMLs() { ) { auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = heading(doc_matters, obj, _txt); + string o = heading(obj, _txt); return o; } auto heading_seg(M,O)( @@ -701,15 +692,14 @@ template outputXHTMLs() { auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); _txt = t[0]; string[] _endnotes = t[1]; - string o = heading(doc_matters, obj, _txt, _xml_type); + string o = heading(obj, _txt, _xml_type); auto u = tuple( o, _endnotes, ); return u; } - auto para(M,O)( - M doc_matters, + auto para(O)( const O obj, string _txt, ) { @@ -758,7 +748,7 @@ template outputXHTMLs() { ) { auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = para(doc_matters, obj, _txt); + string o = para(obj, _txt); return o; } auto para_seg(M,O)( @@ -771,15 +761,14 @@ template outputXHTMLs() { auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = para(doc_matters, obj, _txt); + string o = para(obj, _txt); auto u = tuple( o, _endnotes, ); return u; } - auto quote(M,O)( - M doc_matters, + auto quote(O)( const O obj, string _txt, ) { @@ -818,7 +807,7 @@ template outputXHTMLs() { ) { auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = quote(doc_matters, obj, _txt); + string o = quote(obj, _txt); return o; } auto quote_seg(M,O)( @@ -831,15 +820,14 @@ template outputXHTMLs() { auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = quote(doc_matters, obj, _txt); + string o = quote(obj, _txt); auto u = tuple( o, _endnotes, ); return u; } - auto group(M,O)( - M doc_matters, + auto group(O)( const O obj, string _txt, ) { @@ -879,7 +867,7 @@ template outputXHTMLs() { ) { auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = group(doc_matters, obj, _txt); + string o = group(obj, _txt); return o; } auto group_seg(M,O)( @@ -892,15 +880,14 @@ template outputXHTMLs() { auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = group(doc_matters, obj, _txt); + string o = group(obj, _txt); auto u = tuple( o, _endnotes, ); return u; } - auto block(M,O)( - M doc_matters, + auto block(O)( const O obj, string _txt, ) { @@ -936,7 +923,7 @@ template outputXHTMLs() { ) { auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = block(doc_matters, obj, _txt); + string o = block(obj, _txt); return o; } auto block_seg(M,O)( @@ -949,15 +936,14 @@ template outputXHTMLs() { auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = block(doc_matters, obj, _txt); + string o = block(obj, _txt); auto u = tuple( o, _endnotes, ); return u; } - auto verse(M,O)( - M doc_matters, + auto verse(O)( const O obj, string _txt, ) { @@ -993,7 +979,7 @@ template outputXHTMLs() { ) { auto tags = _xhtml_anchor_tags(obj); _txt = inline_markup_scroll(doc_matters, obj, _txt, _suffix); - string o = verse(doc_matters, obj, _txt); + string o = verse(obj, _txt); return o; } auto verse_seg(M,O)( @@ -1006,15 +992,14 @@ template outputXHTMLs() { auto t = inline_markup_seg(doc_matters, obj, _txt, _suffix, _xml_type); _txt = t[0].to!string; string[] _endnotes = t[1]; - string o = verse(doc_matters, obj, _txt); + string o = verse(obj, _txt); auto u = tuple( o, _endnotes, ); return u; } - auto tablarize(M,O)( - M doc_matters, + auto tablarize(O)( const O obj, string _txt, ) { @@ -1047,14 +1032,13 @@ template outputXHTMLs() { ); return t; } - auto table(M,O)( - M doc_matters, + auto table(O)( const O obj, string _txt, ) { auto tags = _xhtml_anchor_tags(obj); _txt = font_face(_txt); - auto t = tablarize(doc_matters, obj, _txt); + auto t = tablarize(obj, _txt); _txt = t[0]; string _note = t[1]; string o; @@ -1077,8 +1061,7 @@ template outputXHTMLs() { ); return o; } - auto endnote(M,O)( - M doc_matters, + auto endnote(O)( const O obj, string _txt, ) { @@ -1093,8 +1076,7 @@ template outputXHTMLs() { ); return o; } - auto code(M,O)( - M doc_matters, + auto code(O)( const O obj, string _txt, ) { -- cgit v1.2.3