aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/output/xmls.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2019-01-13 14:00:06 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2019-05-17 16:59:38 -0400
commit495dcb42fbd8429d1d7261b3efb418fd8978bf2e (patch)
tree1d0c9c146ade47b9c0e7cddb69c69cf75bf04c72 /src/doc_reform/output/xmls.d
parentcleaning (diff)
0.4.2 xmls output, internaldoc-reform_v0.4.2
Diffstat (limited to 'src/doc_reform/output/xmls.d')
-rw-r--r--src/doc_reform/output/xmls.d152
1 files changed, 67 insertions, 85 deletions
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, "&#38;")
.replaceAll(rgx.xhtml_quotation, "&#34;")
.replaceAll(rgx.xhtml_less_than, "&#60;")
.replaceAll(rgx.xhtml_greater_than, "&#62;")
.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, "<br />");
}
return _txt;
}
- string special_characters_text(string _txt){
- _txt = _txt
- .replaceAll(rgx.xhtml_ampersand, "&#38;")
- .replaceAll(rgx.xhtml_quotation, "&#34;")
- .replaceAll(rgx.xhtml_less_than, "&#60;")
- .replaceAll(rgx.xhtml_greater_than, "&#62;")
- .replaceAll(rgx.nbsp_char, " ");
- return _txt;
- }
string font_face(string _txt){
_txt = _txt
.replaceAll(rgx.inline_emphasis, ("<em>$1</em>"))
@@ -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"¶<!-- DocReform header metadata -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
@@ -128,19 +110,19 @@ template outputXHTMLs() {
<meta name="generator" content="%s" />
<link rel="generator" href="%s" />
<!-- DocReform header metadata -->¶",
- _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"¶<div class="flex-menu-option">
%s
</div>¶",
- _locations,
+ _locations,
);
return o;
}
@@ -289,18 +271,18 @@ template outputXHTMLs() {
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="dc.title" content="%s" />
<meta name="dc.author" content="%s" />
- <meta name="dc.publisher" content="DocReform http://www.jus.uio.no/sisu (this copy)" />
- <meta name="dc.date" content="year" />
- <meta name="dc.date.created" content="year" />
- <meta name="dc.date.issued" content="year" />
- <meta name="dc.date.available" content="year" />
- <meta name="dc.date.valid" content="year" />
- <meta name="dc.date.modified" content="year" />
- <meta name="dc.language" content="US" />
- <meta name="dc.rights" content="Copyright: Copyright (C) year holder" />
- <meta name="generator" content="doc_reform [DocReform 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)" />
- <link rel="generator" href="http://www.sisudoc.org/" />
- <link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
+ <meta name="dc.publisher" content="FIX" />
+ <meta name="dc.date" content="%s" />
+ <meta name="dc.date.created" content="%s" />
+ <meta name="dc.date.issued" content="%s" />
+ <meta name="dc.date.available" content="%s" />
+ <meta name="dc.date.valid" content="%s" />
+ <meta name="dc.date.modified" content="%s" />
+ <meta name="dc.language" content="%s" />
+ <meta name="dc.rights" content="%s" />
+ <meta name="generator" content="%s" />
+ <link rel="generator" href="%s" />
+ <link rel="shortcut icon" href="../_sisu/image/d.ico" />
<link rel="stylesheet" href="css/epub.css" type="text/css" id="main-css" />
</head>
<body lang="%s">
@@ -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,
) {