From d7e7c79253697a7b34df04f547c70669acb67ea1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 4 Jul 2024 11:37:18 -0400 Subject: [fn].digest.txt, sha256 of pod source files & pod --- org/out_metadata.org | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'org/out_metadata.org') diff --git a/org/out_metadata.org b/org/out_metadata.org index 289b702..d43adf2 100644 --- a/org/out_metadata.org +++ b/org/out_metadata.org @@ -26,9 +26,9 @@ #+BEGIN_SRC d <> module sisudoc.io_out.metadata; -@safe: +// @safe: template outputMetadata() { - void outputMetadata(T)( T doc_matters) { + void outputMetadata(T)(T doc_matters) { <> <> <> @@ -139,13 +139,6 @@ if (!(doc_matters.conf_make_meta.meta.notes_summary.empty)) { } else if (doc_matters.opt.action.debug_do) { writeln("WARNING no summary of text provided in document header ", doc_matters.src.filename_base); } -metadata_ ~= "

source: " ~ doc_matters.src.filename_base ~ "

"; -if (doc_matters.opt.action.html_link_markup_source) { - metadata_ ~= "

●  markup source:  the pod [" - ~ " 🫛 zipped | " - ~ "" - ~ " 🫛 tree ] "; -} metadata_ ~= "

●  outputs:  [ html: " ~ " ▤ scroll  " ~ "|" @@ -173,18 +166,32 @@ if ((doc_matters.opt.action.html_link_pdf) || (doc_matters.opt.action.html_link_ ~ " □ pdf (U.S. letter) ] "; } metadata_ ~= "

"; -metadata_ ~= "

Digests:

"; -metadata_ ~= "

" +if (doc_matters.opt.action.html_link_markup_source) { + metadata_ ~= "


source: " ~ doc_matters.src.filename_base ~ "

"; + metadata_ ~= "

●  markup source:  the pod [" + ~ " 🫛 zipped | " + ~ "" + ~ " 🫛 tree ] "; + metadata_ ~= "

●  source digests:" + ~ " [ " + ~ " # digests ]

"; + 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_ ~= "

"; + auto data = (cast(byte[]) (fn_pod).read); // prevents code from being safe + metadata_ ~= "" ~ data.sha256Of.toHexString ~ "::" ~ data.length.to!string ~ " - " ~ doc_matters.src.filename_base ~ ".zip"; + metadata_ ~= "

"; + } catch (Exception ex) { + writeln("WARNING, source doc_matters.src.filename_base not found: ", doc_matters.src.filename_base, ".zip\n ", fn_pod); + } + } +} +metadata_ ~= "

" ~ doc_matters.doc_digest.markup_doc.toHexString - ~ " - src doc digest" - ~ "

" - ~ "

" - ~ doc_matters.doc_digest.header.toHexString - ~ " - doc header" - ~ "

" - ~ "

" - ~ doc_matters.doc_digest.text.toHexString - ~ " - doc text" + ~ " - " + ~ doc_matters.src.filename ~ "

"; if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) { metadata_ ~= "

Topics:

"; -- cgit v1.2.3