aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output_xhtmls.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp/output_xhtmls.d')
-rw-r--r--src/sdp/output_xhtmls.d120
1 files changed, 62 insertions, 58 deletions
diff --git a/src/sdp/output_xhtmls.d b/src/sdp/output_xhtmls.d
index 2a86d4c..804b82f 100644
--- a/src/sdp/output_xhtmls.d
+++ b/src/sdp/output_xhtmls.d
@@ -3,22 +3,26 @@ template outputXHTMLs() {
std.algorithm,
std.array,
std.container,
+ std.digest.sha,
std.exception,
std.file,
std.getopt,
std.json,
- std.process,
- std.stdio,
+ std.outbuffer,
std.path,
+ std.process,
std.range,
std.regex,
+ std.stdio,
std.string,
std.traits,
std.typecons,
std.uni,
std.utf,
+ std.zip,
std.conv : to;
import
+ create_zip_file,
defaults,
output_rgx,
output_xhtmls;
@@ -30,7 +34,7 @@ template outputXHTMLs() {
.replaceAll(rgx.xhtml_ampersand, "&")
.replaceAll(rgx.xhtml_less_than, "<")
.replaceAll(rgx.xhtml_greater_than, ">")
- .replaceAll(rgx.xhtml_line_break, "<br>");
+ .replaceAll(rgx.xhtml_line_break, "<br />");
return _txt;
}
string font_face(string _txt){
@@ -61,7 +65,7 @@ template outputXHTMLs() {
auto scroll_head(Me)(
Me dochead_meta,
) {
- debug(asserts){
+ debug(asserts) {
static assert(is(typeof(dochead_meta) == string[string][string]));
}
string o;
@@ -69,26 +73,27 @@ template outputXHTMLs() {
<html>
<head>
<meta charset="utf-8">
- <title>
- %s%s
- </title>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <meta name="dc.title" content="Title" />
- <meta name="dc.author" content="Author" />
- <meta name="dc.publisher" content="SiSU 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="sdp [SiSU 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)" />
- <link rel="generator" href="http://www.sisudoc.org/" />
+ <title>
+ %s%s
+ </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ <meta name="dc.title" content="Title" />
+ <meta name="dc.author" content="Author" />
+ <meta name="dc.publisher" content="SiSU 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="sdp [SiSU 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)" />
+ </meta>
+ <link rel="generator" href="http://www.sisudoc.org/" />
<link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
- <link href="../../_sisu/css/html.css" rel="stylesheet">
- <link href="../../../_sisu/css/html.css" rel="stylesheet">
+ <link href="../../_sisu/css/html.css" rel="stylesheet" />
+ <link href="../../../_sisu/css/html.css" rel="stylesheet" />
</head>
<body lang="en">
<a name="top" id="top"></a>¶",
@@ -100,7 +105,7 @@ template outputXHTMLs() {
auto seg_head(Me)(
Me dochead_meta,
) {
- debug(asserts){
+ debug(asserts) {
static assert(is(typeof(dochead_meta) == string[string][string]));
}
string o;
@@ -108,26 +113,27 @@ template outputXHTMLs() {
<html>
<head>
<meta charset="utf-8">
- <title>
- %s%s
- </title>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <meta name="dc.title" content="Title" />
- <meta name="dc.author" content="Author" />
- <meta name="dc.publisher" content="SiSU 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="sdp [SiSU 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)" />
- <link rel="generator" href="http://www.sisudoc.org/" />
+ <title>
+ %s%s
+ </title>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ <meta name="dc.title" content="Title" />
+ <meta name="dc.author" content="Author" />
+ <meta name="dc.publisher" content="SiSU 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="sdp [SiSU 7.1.8 of 2016w08/5 (2016-02-26)] (n*x and D)" />
+ </meta>
+ <link rel="generator" href="http://www.sisudoc.org/" />
<link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
- <link href="../../_sisu/css/html.css" rel="stylesheet">
- <link href="../../../_sisu/css/html.css" rel="stylesheet">
+ <link href="../../_sisu/css/html.css" rel="stylesheet" />
+ <link href="../../../_sisu/css/html.css" rel="stylesheet" />
</head>
<body lang="en">
<a name="top" id="top"></a>¶",
@@ -192,13 +198,13 @@ template outputXHTMLs() {
return _txt;
}
auto inline_notes_scroll(O)(
- auto return ref const O obj,
- string _txt,
+ auto return ref const O obj,
+ string _txt,
) {
if (obj.inline_notes_reg) {
_txt = (_txt).replaceAll(
rgx.inline_notes_delimiter_al_regular_number_note,
- ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&nbsp;<sup>$1</sup>&nbsp;</note></a>")
+ ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup>&#160;</note></a>")
);
}
debug(markup_endnotes) {
@@ -236,7 +242,7 @@ template outputXHTMLs() {
"\">",
"<note id=\"note_",
m.captures[1],
- "\">&nbsp;<sup>",
+ "\">&#160;<sup>",
m.captures[1],
".</sup></note></a>",
m.captures[2],
@@ -245,7 +251,7 @@ template outputXHTMLs() {
}
_txt = (_txt).replaceAll(
rgx.inline_notes_delimiter_al_regular_number_note,
- ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&nbsp;<sup>$1</sup>&nbsp;</note></a>")
+ ("<a href=\"#note_$1\"><note id=\"noteref_$1\">&#160;<sup>$1</sup>&#160;</note></a>")
);
} else if (_txt.match(rgx.inline_notes_delimiter_al_regular_number_note)) {
debug(markup) {
@@ -301,7 +307,7 @@ template outputXHTMLs() {
auto tags = _xhtml_anchor_tags(obj.anchor_tags);
string o;
if (obj.obj_cite_number.empty) {
- o = format(q"¶<br><hr /><br>
+ o = format(q"¶<br /><hr /><br />
<div class="substance">
<h%s class="%s">%s
%s
@@ -314,7 +320,7 @@ template outputXHTMLs() {
obj.heading_lev_markup,
);
} else {
- o = format(q"¶<br><hr /><br>
+ o = format(q"¶<br /><hr /><br />
<div class="substance">
<label class="ocn"><a href="#%s" class="lnkocn">%s</a></label>
<h%s class="%s" id="%s"><a name="%s"></a>%s
@@ -364,7 +370,7 @@ template outputXHTMLs() {
auto tags = _xhtml_anchor_tags(obj.anchor_tags);
_txt = font_face(_txt);
string o;
- _txt = (obj.bullet) ? ("●&nbsp;&nbsp" ~ _txt) : _txt;
+ _txt = (obj.bullet) ? ("●&#160;&#160;" ~ _txt) : _txt;
if (obj.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s" indent="h%si%s">%s
@@ -541,7 +547,6 @@ template outputXHTMLs() {
</div>¶",
obj.is_a,
_txt
- // obj.text
);
} else {
o = format(q"¶ <div class="substance">
@@ -555,7 +560,6 @@ template outputXHTMLs() {
obj.is_a,
obj.obj_cite_number,
_txt
- // obj.text
);
}
return o;
@@ -589,9 +593,9 @@ template outputXHTMLs() {
) {
_txt = font_face(_txt);
_txt = (_txt)
- .replaceAll(rgx.newline, "<br>\n")
- .replaceAll(rgx.two_spaces, "&nbsp;" ~ "&nbsp;" ~ "&nbsp;" ~ "&nbsp;")
- .replaceAll(rgx.nbsp_and_space, "&nbsp;" ~ "&nbsp;")
+ .replaceAll(rgx.newline, "<br />\n")
+ .replaceAll(rgx.two_spaces, "&#160;" ~ "&#160;" ~ "&#160;" ~ "&#160;")
+ .replaceAll(rgx.nbsp_and_space, "&#160;" ~ "&#160;")
.replaceAll(rgx.strip_br, "");
string o;
if (obj.obj_cite_number.empty) {
@@ -723,8 +727,8 @@ template outputXHTMLs() {
) {
string _txt = obj.text;
_txt = (_txt)
- .replaceAll(rgx.newline, "<br>\n")
- .replaceAll(rgx.nbsp_char, "&nbsp;");
+ .replaceAll(rgx.newline, "<br />\n")
+ .replaceAll(rgx.nbsp_char, "&#160;");
string o;
if (obj.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">