aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/io_out/metadata.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2024-07-04 11:37:18 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2024-07-04 11:37:24 -0400
commitd7e7c79253697a7b34df04f547c70669acb67ea1 (patch)
tree55c1fd75ff17de8776599fc633ef71c3648353a1 /src/sisudoc/io_out/metadata.d
parentmarkup source digest to metadata.html (diff)
[fn].digest.txt, sha256 of pod source files & pod
Diffstat (limited to 'src/sisudoc/io_out/metadata.d')
-rw-r--r--src/sisudoc/io_out/metadata.d47
1 files changed, 27 insertions, 20 deletions
diff --git a/src/sisudoc/io_out/metadata.d b/src/sisudoc/io_out/metadata.d
index 59329e7..95fc465 100644
--- a/src/sisudoc/io_out/metadata.d
+++ b/src/sisudoc/io_out/metadata.d
@@ -48,9 +48,9 @@
+/
module sisudoc.io_out.metadata;
-@safe:
+// @safe:
template outputMetadata() {
- void outputMetadata(T)( T doc_matters) {
+ void outputMetadata(T)(T doc_matters) {
string inline_search_form(M)(
M doc_matters,
) {
@@ -475,13 +475,6 @@ string theme_light_1 = format(q"┃
} 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\">●&nbsp;&nbsp;markup source:&nbsp;&nbsp;the&nbsppod&nbsp[<a href=\"../../" ~ pth_pod.internal_base ~ "/" ~ doc_matters.src.filename_base ~ ".zip\" class=\"lnkicon\">"
- ~ "&nbsp;🫛&nbsp;zipped&nbsp;</a>|&nbsp;"
- ~ "<a href=\"../../" ~ pth_pod.internal_base ~ "/" ~ doc_matters.src.filename_base ~ "/\" class=\"lnkicon\">"
- ~ "&nbsp;🫛&nbsp;tree&nbsp;</a>]&nbsp;";
- }
metadata_ ~= "<p class=\"lev1\">●&nbsp;&nbsp;outputs:&nbsp;&nbsp;[&nbsp;html:&nbsp;<a href=\"" ~ doc_matters.src.filename_base ~ ".html\" class=\"lnkicon\">"
~ "&nbsp;▤&nbsp;scroll&nbsp;</a>&nbsp;"
~ "|<a href=\"" ~ doc_matters.src.filename_base ~ "/toc.html\" class=\"lnkicon\">"
@@ -509,18 +502,32 @@ string theme_light_1 = format(q"┃
~ "&nbsp;□&nbsp;pdf&nbsp;(U.S.&nbsp;letter)&nbsp;</a>]&nbsp";
}
metadata_ ~= "</p>";
- metadata_ ~= "<hr /><p class=\"lev0\">Digests:</p>";
- metadata_ ~= "<p class=\"lev1\"><tt>"
+ if (doc_matters.opt.action.html_link_markup_source) {
+ metadata_ ~= "<hr /><p class=\"lev1\">source: " ~ doc_matters.src.filename_base ~ "</p>";
+ 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\" class=\"lnkicon\">"
+ ~ "&nbsp;🫛&nbsp;zipped&nbsp;</a>|&nbsp;"
+ ~ "<a href=\"../../" ~ pth_pod.internal_base ~ "/" ~ doc_matters.src.filename_base ~ "/\" class=\"lnkicon\">"
+ ~ "&nbsp;🫛&nbsp;tree&nbsp;</a>]&nbsp;";
+ metadata_ ~= "<p class=\"lev1\">●&nbsp;&nbsp;source digests:"
+ ~ "&nbsp;[&nbsp;<a href=\"../../" ~ pth_pod.internal_base ~ "/" ~ doc_matters.src.filename_base ~ ".digests.txt\" class=\"lnkizipcon\">"
+ ~ "&nbsp;#&nbsp;digests&nbsp;</a>]</p>";
+ auto pths_pod = spinePathsPods!()(doc_matters);
+ auto fn_pod = pths_pod.pod_filename(doc_matters.src.filename).zpod;
+ if (doc_matters.opt.action.pod) {
+ try { // get sha digest for pod
+ metadata_ ~= "<p class=\"lev2\">";
+ auto data = (cast(byte[]) (fn_pod).read); // prevents code from being safe
+ metadata_ ~= "<tt>" ~ data.sha256Of.toHexString ~ "::" ~ data.length.to!string ~ "</tt> - " ~ doc_matters.src.filename_base ~ ".zip";
+ metadata_ ~= "</p>";
+ } catch (Exception ex) {
+ writeln("WARNING, source doc_matters.src.filename_base not found: ", doc_matters.src.filename_base, ".zip\n ", fn_pod);
+ }
+ }
+ }
+ metadata_ ~= "<p class=\"lev2\"><tt>"
~ doc_matters.doc_digest.markup_doc.toHexString
- ~ "</tt> - src doc digest"
- ~ "</p>"
- ~ "<p class=\"lev1\"><tt>"
- ~ doc_matters.doc_digest.header.toHexString
- ~ "</tt> - doc header"
- ~ "</p>"
- ~ "<p class=\"lev1\"><tt>"
- ~ doc_matters.doc_digest.text.toHexString
- ~ "</tt> - doc text"
+ ~ "</tt> - "
+ ~ doc_matters.src.filename
~ "</p>";
if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) {
metadata_ ~= "<hr /><p class=\"lev0\">Topics:</p>";