aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2023-06-26 16:30:25 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2023-06-27 17:12:48 -0400
commit61180130e90b43f057369878d2d53605f41f8374 (patch)
tree96a5d8a33b69818b43c7d47d191cf17a4d797be5 /src
parentreplace some instances of dir listing, index.html (diff)
html links and metadata, fixes & cosmetic work
Diffstat (limited to 'src')
-rw-r--r--src/doc_reform/io_out/epub3.d8
-rw-r--r--src/doc_reform/io_out/html.d30
-rw-r--r--src/doc_reform/io_out/html_snippet.d16
-rw-r--r--src/doc_reform/io_out/metadata.d52
-rw-r--r--src/doc_reform/io_out/xmls.d2
-rw-r--r--src/doc_reform/meta/metadoc_curate_authors.d6
-rw-r--r--src/doc_reform/meta/metadoc_curate_topics.d8
7 files changed, 89 insertions, 33 deletions
diff --git a/src/doc_reform/io_out/epub3.d b/src/doc_reform/io_out/epub3.d
index c94863b..c0916f9 100644
--- a/src/doc_reform/io_out/epub3.d
+++ b/src/doc_reform/io_out/epub3.d
@@ -639,8 +639,14 @@ template outputEPub3() {
pth_epub3.base.mkdirRecurse;
}
if (!exists(pth_epub3.base ~ "/index.html")) {
+ import doc_reform.io_out.html_snippet;
+ mixin htmlSnippet;
auto f = File(pth_epub3.base ~"/index.html", "w");
- f.writeln("");
+ f.writeln(format_html_blank_page_guide_home(
+ "../../css/html_scroll.css",
+ "https://sisudoc.org",
+ "../../index.html",
+ ));
}
{ /+ debug +/
if (doc_matters.opt.action.debug_do_epub) {
diff --git a/src/doc_reform/io_out/html.d b/src/doc_reform/io_out/html.d
index 9e108c6..5f1f11c 100644
--- a/src/doc_reform/io_out/html.d
+++ b/src/doc_reform/io_out/html.d
@@ -228,9 +228,9 @@ template outputHTML() {
}
}
doc = xhtml_format.html_head(doc_matters, "scroll")
- ~ doc_html
- ~ xhtml_format.dom_close
- ~ xhtml_format.tail(doc_matters);
+ ~ doc_html
+ ~ xhtml_format.dom_close
+ ~ xhtml_format.tail(doc_matters);
scroll_write_output(doc, doc_matters);
}
@trusted void scroll_write_output(D,M)(
@@ -252,8 +252,14 @@ template outputHTML() {
}
}
if (!exists(pth_html.base ~ "/index.html")) {
+ import doc_reform.io_out.html_snippet;
+ mixin htmlSnippet;
auto f = File(pth_html.base ~"/index.html", "w");
- f.writeln("");
+ f.writeln(format_html_blank_page_guide_home(
+ "../../css/html_scroll.css",
+ "https://sisudoc.org",
+ "../../index.html",
+ ));
}
} catch (ErrnoException ex) {
// Handle error
@@ -563,8 +569,14 @@ template outputHTML() {
f.writeln(css.html_scroll);
}
if (!exists(pth_html.css ~ "/index.html")) {
+ import doc_reform.io_out.html_snippet;
+ mixin htmlSnippet;
auto f = File(pth_html.css ~"/index.html", "w");
- f.writeln("");
+ f.writeln(format_html_blank_page_guide_home(
+ "./css/html_scroll.css",
+ "https://sisudoc.org",
+ "../index.html",
+ ));
}
} catch (ErrnoException ex) {
// Handle error
@@ -593,8 +605,14 @@ template outputHTML() {
}
}
if (!exists(pth_html.image ~ "/index.html")) {
+ import doc_reform.io_out.html_snippet;
+ mixin htmlSnippet;
auto f = File(pth_html.image ~"/index.html", "w");
- f.writeln("");
+ f.writeln(format_html_blank_page_guide_home(
+ "../css/html_scroll.css",
+ "https://sisudoc.org",
+ "../index.html",
+ ));
}
}
}
diff --git a/src/doc_reform/io_out/html_snippet.d b/src/doc_reform/io_out/html_snippet.d
index fea78a8..8dbb949 100644
--- a/src/doc_reform/io_out/html_snippet.d
+++ b/src/doc_reform/io_out/html_snippet.d
@@ -83,4 +83,20 @@ template htmlSnippet() {
);
return html_blank_default;
}
+ @safe string special_characters_text(string _txt) {
+ mixin spineRgxOut;
+ mixin spineRgxXHTML;
+ static auto rgx = RgxO();
+ static auto rgx_xhtml = RgxXHTML();
+ _txt = _txt
+ .replaceAll(rgx_xhtml.ampersand, "&amp;") // "&#38;"
+ .replaceAll(rgx_xhtml.quotation, "&quot;") // "&#34;"
+ .replaceAll(rgx_xhtml.less_than, "&lt;") // "&#60;"
+ .replaceAll(rgx_xhtml.greater_than, "&gt;") // "&#62;"
+ .replaceAll(rgx.br_line, "<br />")
+ .replaceAll(rgx.br_line_inline, "<br />")
+ .replaceAll(rgx.br_line_spaced, "<br />\n<br />")
+ .replaceAll(rgx.nbsp_char, " ");
+ return _txt;
+ }
}
diff --git a/src/doc_reform/io_out/metadata.d b/src/doc_reform/io_out/metadata.d
index 2686d15..e5e1c02 100644
--- a/src/doc_reform/io_out/metadata.d
+++ b/src/doc_reform/io_out/metadata.d
@@ -338,8 +338,14 @@ string theme_light_1 = format(q"┃
}
}
if (!exists(pth_html.base ~ "/index.html")) {
+ import doc_reform.io_out.html_snippet;
+ mixin htmlSnippet;
auto f = File(pth_html.base ~"/index.html", "w");
- f.writeln("");
+ f.writeln(format_html_blank_page_guide_home(
+ "../../css/html_scroll.css",
+ "https://sisudoc.org",
+ "../../index.html",
+ ));
}
} catch (ErrnoException ex) {
// Handle error
@@ -349,13 +355,15 @@ string theme_light_1 = format(q"┃
}
}
static auto mkup = InlineMarkup();
+ import doc_reform.io_out.html_snippet;
+ mixin htmlSnippet;
if (doc_matters.opt.action.debug_do) {
writeln(doc_matters.src.filename_base);
writeln("Title: ", doc_matters.conf_make_meta.meta.title_full);
writeln(" Author: ", doc_matters.conf_make_meta.meta.creator_author);
writeln(" Published: ", doc_matters.conf_make_meta.meta.date_published);
writeln(" Copyright: ", doc_matters.conf_make_meta.meta.rights_copyright);
- writeln(" License: ", doc_matters.conf_make_meta.meta.rights_license);
+ writeln(" License: ", special_characters_text(doc_matters.conf_make_meta.meta.rights_license));
if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) {
foreach (topic; doc_matters.conf_make_meta.meta.classify_topic_register_arr.sort!("toUpper(a) < toUpper(b)", SwapStrategy.unstable)) {
string[] subject_tree = topic.split(mkup.sep);
@@ -410,44 +418,52 @@ string theme_light_1 = format(q"┃
}
metadata_ ~= "<p class=\"lev1\">Published: " ~ doc_matters.conf_make_meta.meta.date_published ~ "</p>";
if (!(doc_matters.conf_make_meta.meta.rights_copyright.empty)) {
- metadata_ ~= "<p class=\"lev1\">Copyright: " ~ doc_matters.conf_make_meta.meta.rights_copyright ~ "</p>";
+ metadata_ ~= "<p class=\"lev1\">Copyright: " ~ special_characters_text(doc_matters.conf_make_meta.meta.rights_copyright) ~ "</p>";
} else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt2) {
writeln("WARNING no Copyright information provided in document header ", doc_matters.src.filename_base);
}
if (!(doc_matters.conf_make_meta.meta.rights_license.empty)) {
- metadata_ ~= "<p class=\"lev1\">License: " ~ doc_matters.conf_make_meta.meta.rights_license ~ "</p>";
+ metadata_ ~= "<p class=\"lev1\">License: " ~ special_characters_text(doc_matters.conf_make_meta.meta.rights_license) ~ "</p>";
} else if (doc_matters.opt.action.debug_do || doc_matters.opt.action.vox_gt2) {
writeln("WARNING no License information provided in document header ", doc_matters.src.filename_base);
}
if (!(doc_matters.conf_make_meta.meta.notes_summary.empty)) {
- metadata_ ~= "<hr /><p class=\"lev0\">Summary:</p><p class=\"lev1\">" ~ doc_matters.conf_make_meta.meta.notes_summary ~ "</p>";
+ metadata_ ~= "<hr /><p class=\"lev0\">Summary:</p><p class=\"lev1\">" ~ special_characters_text(doc_matters.conf_make_meta.meta.notes_summary) ~ "</p>";
} else if (doc_matters.opt.action.debug_do) {
writeln("WARNING no summary of text provided in document header ", doc_matters.src.filename_base);
}
metadata_ ~= "<hr /><p class=\"lev1\">source: " ~ doc_matters.src.filename_base ~ "</p>";
if (doc_matters.opt.action.html_link_markup_source) {
- metadata_ ~= "<p class=\"lev1\">● markup source: [<a href=\"../../" ~ pth_pod.internal_base ~ "/" ~ doc_matters.src.filename_base ~ ".zip\">"
- ~ "&nbsp;zipped&nbsp;pod&nbsp;</a>] "
- ~ "[<a href=\"../../" ~ pth_pod.internal_base ~ "/" ~ doc_matters.src.filename_base ~ "/\">"
- ~ "&nbsp;pod&nbsp;tree&nbsp;</a>]";
+ metadata_ ~= "<p class=\"lev1\">●&nbsp;&nbsp;markup source:&nbsp;&nbsp;the&nbsppod&nbsp[<a href=\"../../" ~ pth_pod.internal_base ~ "/" ~ doc_matters.src.filename_base ~ ".zip\">"
+ ~ "&nbsp;🫛&nbsp;zipped&nbsp;</a>|&nbsp;"
+ ~ "<a href=\"../../" ~ pth_pod.internal_base ~ "/" ~ doc_matters.src.filename_base ~ "/\">"
+ ~ "&nbsp;🫛&nbsp;tree&nbsp;</a>]&nbsp;";
}
- metadata_ ~= "<p class=\"lev1\">● outputs: [<a href=\"" ~ doc_matters.src.filename_base ~ ".html\">"
- ~ "&nbsp;▤&nbsp;html&nbsp;scroll&nbsp;</a>] "
- ~ "[<a href=\"" ~ doc_matters.src.filename_base ~ "/toc.html\">"
- ~ "&nbsp;※&nbsp;html&nbsp;seg&nbsp;</a>]"
+ metadata_ ~= "<p class=\"lev1\">●&nbsp;&nbsp;outputs:&nbsp;&nbsp;[&nbsp;html:&nbsp;<a href=\"" ~ doc_matters.src.filename_base ~ ".html\">"
+ ~ "&nbsp;▤&nbsp;scroll&nbsp;</a>&nbsp;"
+ ~ "|<a href=\"" ~ doc_matters.src.filename_base ~ "/toc.html\">"
+ ~ "&nbsp;※&nbsp;seg&nbsp;</a>]&nbsp;&nbsp;&nbsp;"
~ "[<a href=\"../../" ~ pth_epub.internal_base ~ "/" ~ doc_matters.src.filename_base ~ "." ~ doc_matters.src.language ~ ".epub\">"
- ~ "&nbsp;◆&nbsp;epub&nbsp;</a>]";
+ ~ "&nbsp;◆&nbsp;epub&nbsp;</a>]&nbsp;&nbsp;&nbsp;";
if ((doc_matters.opt.action.html_link_pdf) || (doc_matters.opt.action.html_link_pdf_a4)) {
+ metadata_ ~= "[&nbsp;pdf:&nbsp;<a href=\"../../pdf/"
+ ~ doc_matters.src.filename_base
+ ~ "." ~ doc_matters.src.language ~ ".a4.portrait.pdf\">"
+ ~ "&nbsp;□&nbsp;a4&nbsp;</a>&nbsp"
+ ~ "|<a href=\"../../pdf/"
+ ~ doc_matters.src.filename_base
+ ~ "." ~ doc_matters.src.language ~ ".letter.portrait.pdf\">"
+ ~ "&nbsp;□&nbsp;U.S.&nbsp;letter&nbsp;</a>]&nbsp";
+ } else if (doc_matters.opt.action.html_link_pdf_a4) {
metadata_ ~= "[<a href=\"../../pdf/"
~ doc_matters.src.filename_base
~ "." ~ doc_matters.src.language ~ ".a4.portrait.pdf\">"
- ~ "&nbsp;□&nbsp;pdf&nbsp;(a4)&nbsp;</a>]";
- }
- if ((doc_matters.opt.action.html_link_pdf) || (doc_matters.opt.action.html_link_pdf_letter)) {
+ ~ "&nbsp;□&nbsp;pdf&nbsp;(a4)&nbsp;</a>]&nbsp";
+ } else if (doc_matters.opt.action.html_link_pdf_letter) {
metadata_ ~= "[<a href=\"../../pdf/"
~ doc_matters.src.filename_base
~ "." ~ doc_matters.src.language ~ ".letter.portrait.pdf\">"
- ~ "&nbsp;□&nbsp;pdf&nbsp;(U.S.&nbsp;letter)&nbsp;</a>]";
+ ~ "&nbsp;□&nbsp;pdf&nbsp;(U.S.&nbsp;letter)&nbsp;</a>]&nbsp";
}
metadata_ ~= "</p>";
if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) {
diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d
index c38844c..4fd4e1b 100644
--- a/src/doc_reform/io_out/xmls.d
+++ b/src/doc_reform/io_out/xmls.d
@@ -320,7 +320,7 @@ template outputXHTMLs() {
) {
string o;
string metadata_links = ((doc_matters.opt.action.html_link_curate)
- ? format(q"┃<p class="small"><a href="%s">⟰&nbsp;</a>&nbsp;[<a href="%s">&nbsp;%s&nbsp;</a><a href="%sepub/%s.%s.epub">&nbsp;◆&nbsp;</a>%s%s<a href="%smetadata.%s.html">&nbsp;⌘•&nbsp;</a>]&nbsp;&nbsp;<a href="%s../../index.html">&nbsp;≅&nbsp;</a>|<a href="%s../../authors.html">&nbsp;&#x1F58B;&nbsp;</a>|<a href="%s../../topics.html">&nbsp;⌘&nbsp;</a>|</p>┃",
+ ? format(q"┃<p class="small"><a href="%s">⟰&nbsp;</a>&nbsp;[<a href="%s">&nbsp;%s&nbsp;</a><a href="%sepub/%s.%s.epub">&nbsp;◆&nbsp;</a>%s%s<a href="%smetadata.%s.html">&nbsp;ℹ&nbsp;</a>]&nbsp;&nbsp;<a href="%s../../index.html">&nbsp;≅&nbsp;</a>|<a href="%s../../authors.html">&nbsp;&#x1F58B;&nbsp;</a>|<a href="%s../../topics.html">&nbsp;⌘&nbsp;</a>|</p>┃",
(doc_matters.opt.action.webserver_url_doc_root.length > 0)
? doc_matters.opt.action.webserver_url_doc_root
: doc_matters.conf_make_meta.conf.w_srv_data_root_url
diff --git a/src/doc_reform/meta/metadoc_curate_authors.d b/src/doc_reform/meta/metadoc_curate_authors.d
index 574b6d1..e11c9aa 100644
--- a/src/doc_reform/meta/metadoc_curate_authors.d
+++ b/src/doc_reform/meta/metadoc_curate_authors.d
@@ -259,7 +259,7 @@ string theme_light_1 = format(q"┃
<html>
<head>
<meta charset="utf-8">
-<title>⌘ Curated metadata - Authors</title>
+<title>⌘ Curated metadata - &#x1F58B; Authors</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="dc.title" content= "metadata curate, Authors & Topics - information Structuring Universe, Structured information Serialised Units" />
<meta name="dc.subject" content= "document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" />
@@ -391,11 +391,11 @@ string theme_light_1 = format(q"┃
<a name="top" id="top"></a>
<a name="up" id="up"></a>
<a name="start" id="start"></a>
-<h1>⌘ Curated metadata - Authors (output organised by language &amp; filetype)</h1>
+<h1>⌘ Curated metadata - &#x1F58B; Authors (output organised by language &amp; filetype)</h1>
<div class="flex-menu-bar">
<div class="flex-menu-option">
<p>[<a href="../../index.html">&nbsp;⟰&nbsp;HOME&nbsp;</a>&nbsp;|&nbsp;<a href="../index.html">&nbsp;≅&nbsp;Collection&nbsp;</a>]
- [<a href="topics.html">&nbsp;⌘&nbsp;Curated&nbsp;metadata&nbsp;-&nbsp;Topics&nbsp;</a>] </p>
+ [<a href="topics.html">&nbsp;⌘&nbsp;Curated&nbsp;metadata&nbsp;-&nbsp;⌘&nbsp;Topics&nbsp;</a>] </p>
</div>
%s
</div>
diff --git a/src/doc_reform/meta/metadoc_curate_topics.d b/src/doc_reform/meta/metadoc_curate_topics.d
index 304bd00..c0a3036 100644
--- a/src/doc_reform/meta/metadoc_curate_topics.d
+++ b/src/doc_reform/meta/metadoc_curate_topics.d
@@ -300,7 +300,7 @@ string theme_light_1 = format(q"┃
<html>
<head>
<meta charset="utf-8">
-<title>⌘ Curated metadata - Topics</title>
+<title>⌘ Curated metadata - ⌘ Topics</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="dc.title" content= "metadata curate, Authors & Topics - information Structuring Universe, Structured information Serialised Units" />
<meta name="dc.subject" content= "document structuring, ebook, publishing, PDF, LaTeX, XML, ODF, SQL, postgresql, sqlite, electronic book, electronic publishing, electronic document, electronic citation, data structure, citation systems, granular search, digital library" />
@@ -432,11 +432,11 @@ string theme_light_1 = format(q"┃
<a name="top" id="top"></a>
<a name="up" id="up"></a>
<a name="start" id="start"></a>
-<h1>⌘ Curated metadata - Topics (output organised by language &amp; filetype)</h1>
+<h1>⌘ Curated metadata - ⌘ Topics (output organised by language &amp; filetype)</h1>
<div class="flex-menu-bar">
<div class="flex-menu-option">
-<p>[<a href="../../index.html">&nbsp;≅&nbsp;HOME&nbsp;</a>]
- [<a href="authors.html">&nbsp;⌘&nbsp;Curated&nbsp;metadata&nbsp;-&nbsp;Authors&nbsp;</a>]
+<p>[<a href="../../index.html">&nbsp;⟰&nbsp;HOME&nbsp;</a>&nbsp;|&nbsp;<a href="../index.html">&nbsp;≅&nbsp;Collection&nbsp;</a>]
+ [<a href="authors.html">&nbsp;⌘&nbsp;Curated&nbsp;metadata&nbsp;-&nbsp;&#x1F58B;&nbsp;Authors&nbsp;</a>]
</p>
</div>
%s