aboutsummaryrefslogtreecommitdiffhomepage
path: root/org
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 /org
parentreplace some instances of dir listing, index.html (diff)
html links and metadata, fixes & cosmetic work
Diffstat (limited to 'org')
-rw-r--r--org/out_curate_metadata.org14
-rw-r--r--org/out_metadata.org52
-rw-r--r--org/out_xmls.org138
3 files changed, 130 insertions, 74 deletions
diff --git a/org/out_curate_metadata.org b/org/out_curate_metadata.org
index e06ea5c..0dd74cd 100644
--- a/org/out_curate_metadata.org
+++ b/org/out_curate_metadata.org
@@ -218,7 +218,7 @@ foreach(k, doc_curate; hvst.curates) {
<html>
<head>
<meta charset="utf-8">
-<title>⌘ Curated metadata - Topics</title>
+<title>⌘ Curated metadata - ⌘ Topics</title>
#+END_SRC
*** curated topics html head
@@ -230,11 +230,11 @@ foreach(k, doc_curate; hvst.curates) {
<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
@@ -513,7 +513,7 @@ template spineMetaDocCuratesAuthors() {
<html>
<head>
<meta charset="utf-8">
-<title>⌘ Curated metadata - Authors</title>
+<title>⌘ Curated metadata - &#x1F58B; Authors</title>
#+END_SRC
*** curated authors html head
@@ -525,11 +525,11 @@ template spineMetaDocCuratesAuthors() {
<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/org/out_metadata.org b/org/out_metadata.org
index 84c374c..5990f16 100644
--- a/org/out_metadata.org
+++ b/org/out_metadata.org
@@ -59,13 +59,15 @@ string[] metadata_;
#+NAME: output_metadata
#+BEGIN_SRC d
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);
@@ -120,44 +122,52 @@ if (!(doc_matters.conf_make_meta.meta.creator_author.empty)) {
}
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) {
@@ -277,8 +287,14 @@ metadata_write_output(doc_matters, metadata_);
}
}
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
diff --git a/org/out_xmls.org b/org/out_xmls.org
index 33f2213..943d588 100644
--- a/org/out_xmls.org
+++ b/org/out_xmls.org
@@ -66,6 +66,22 @@ 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;
+ }
}
#+END_SRC
@@ -485,7 +501,7 @@ import
) {
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
@@ -1810,21 +1826,31 @@ module doc_reform.io_out.html;
template outputHTML() {
<<output_imports_xml>>
mixin outputXHTMLs;
- <<output_html_scroll_0>>
+ @safe void scroll(D,M)(
+ const D doc_abstraction,
+ M doc_matters,
+ ) {
+ <<output_html_scroll_0>>
<<output_html_scroll_loop_parts>>
<<output_html_scroll_is_frontmatter>>
<<output_html_scroll_is_body>>
<<output_html_scroll_is_backmatter>>
- <<output_html_scroll_close_is_case>>
+ <<output_html_scroll_close_is_case>>
+ }
<<output_html_scroll_scroll_write_output>>
- <<output_html_seg_0>>
+ @safe void seg(D,M)(
+ const D doc_abstraction,
+ M doc_matters,
+ ) {
+ <<output_html_seg_0>>
<<output_html_seg_loop_parts>>
<<output_html_seg_is_heading>>
<<output_html_seg_is_not_heading_switch>>
<<output_html_seg_is_frontmatter>>
<<output_html_seg_is_body>>
<<output_html_seg_is_backmatter>>
- <<output_html_seg_close_is_case>>
+ <<output_html_seg_close_is_case>>
+ }
<<output_html_seg_write_output>>
<<output_html_css>>
<<copy_html_images>>
@@ -1836,20 +1862,16 @@ template outputHTML() {
#+NAME: output_html_scroll_0
#+BEGIN_SRC d
-@safe void scroll(D,M)(
- const D doc_abstraction,
- M doc_matters,
-) {
- mixin spineRgxOut;
- mixin spineRgxXHTML;
- auto xhtml_format = outputXHTMLs();
- static auto rgx = RgxO();
- static auto rgx_xhtml = RgxXHTML();
- string[] doc_html;
- string[] doc;
- string suffix = ".html";
- string previous_section = "";
- string delimit = "";
+mixin spineRgxOut;
+mixin spineRgxXHTML;
+auto xhtml_format = outputXHTMLs();
+static auto rgx = RgxO();
+static auto rgx_xhtml = RgxXHTML();
+string[] doc_html;
+string[] doc;
+string suffix = ".html";
+string previous_section = "";
+string delimit = "";
#+END_SRC
**** ↻ the loops & outer switch (sections & objects) format output
@@ -2027,15 +2049,14 @@ default:
#+NAME: output_html_scroll_close_is_case
#+BEGIN_SRC d
- }
}
}
- doc = xhtml_format.html_head(doc_matters, "scroll")
- ~ doc_html
- ~ xhtml_format.dom_close
- ~ xhtml_format.tail(doc_matters);
- scroll_write_output(doc, doc_matters);
}
+doc = xhtml_format.html_head(doc_matters, "scroll")
+~ doc_html
+~ xhtml_format.dom_close
+~ xhtml_format.tail(doc_matters);
+scroll_write_output(doc, doc_matters);
#+END_SRC
*** write output file
@@ -2061,8 +2082,14 @@ default:
}
}
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
@@ -2078,24 +2105,20 @@ default:
#+NAME: output_html_seg_0
#+BEGIN_SRC d
-@safe void seg(D,M)(
- const D doc_abstraction,
- M doc_matters,
-) {
- mixin spineRgxOut;
- mixin spineRgxXHTML;
- static auto rgx = RgxO();
- static auto rgx_xhtml = RgxXHTML();
- auto xhtml_format = outputXHTMLs();
- string[][string] doc_html;
- string[][string] doc_html_endnotes;
- string[] doc;
- string segment_filename;
- string[] top_level_headings = ["","","",""];
- string previous_seg_filename = "";
- string suffix = ".html";
- string previous_section = "";
- string delimit = "";
+mixin spineRgxOut;
+mixin spineRgxXHTML;
+static auto rgx = RgxO();
+static auto rgx_xhtml = RgxXHTML();
+auto xhtml_format = outputXHTMLs();
+string[][string] doc_html;
+string[][string] doc_html_endnotes;
+string[] doc;
+string segment_filename;
+string[] top_level_headings = ["","","",""];
+string previous_seg_filename = "";
+string suffix = ".html";
+string previous_section = "";
+string delimit = "";
#+END_SRC
**** ↻ the loop (sections & objects) format output
@@ -2365,11 +2388,10 @@ default:
#+NAME: output_html_seg_close_is_case
#+BEGIN_SRC d
- }
}
}
- seg_write_output(doc_html, doc_html_endnotes, doc_matters);
}
+seg_write_output(doc_html, doc_html_endnotes, doc_matters);
#+END_SRC
*** write output files
@@ -2433,8 +2455,14 @@ default:
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
@@ -2469,8 +2497,14 @@ default:
}
}
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",
+ ));
}
}
}
@@ -3204,8 +3238,14 @@ zip -0 file.epub mimetype && zip -r -9 file.epub META-INF OEBPS
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) {