From 3ff7241bb2bfef1d85c3fb0f880cac250c8de1bc Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 29 Jun 2024 14:53:07 -0400 Subject: markup source digests (write to terminal) --- flake.lock | 6 +++--- org/out_src_pod.org | 6 +++--- org/output_show.org | 11 ++++++++++- org/spine.org | 33 +++++++++++++------------------- src/sisudoc/io_out/source_pod.d | 6 +++--- src/sisudoc/meta/metadoc.d | 14 +++++++++----- src/sisudoc/meta/metadoc_show_config.d | 4 ++++ src/sisudoc/meta/metadoc_show_make.d | 2 ++ src/sisudoc/meta/metadoc_show_metadata.d | 2 ++ src/sisudoc/meta/metadoc_show_summary.d | 11 ++++++++++- 10 files changed, 59 insertions(+), 36 deletions(-) diff --git a/flake.lock b/flake.lock index 0ca5494..771a368 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1719468428, - "narHash": "sha256-vN5xJAZ4UGREEglh3lfbbkIj+MPEYMuqewMn4atZFaQ=", + "lastModified": 1719826879, + "narHash": "sha256-xs7PlULe8O1SAcs/9e/HOjeUjBrU5FNtkAF/bSEcFto=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1e3deb3d8a86a870d925760db1a5adecc64d329d", + "rev": "b9014df496d5b68bf7c0145d0e9b0f529ce4f2a8", "type": "github" }, "original": { diff --git a/org/out_src_pod.org b/org/out_src_pod.org index 9accccb..c6143cb 100644 --- a/org/out_src_pod.org +++ b/org/out_src_pod.org @@ -422,10 +422,10 @@ if (exists(fn_pod)) { && doc_matters.opt.action.pod) { auto data = (cast(byte[]) (fn_pod).read); if (doc_matters.opt.action.vox_gt1) { - writeln(" ", doc_matters.src.filename, " > "); + writeln(doc_matters.src.filename, " > ", doc_matters.src.filename_base, ".zip"); } if (doc_matters.opt.action.pod) { - writefln("%s\n. %-(%02x%)::%s . %s.zip", fn_pod, data.sha256Of, data.length, doc_matters.src.filename_base); + writeln(data.sha256Of.toHexString, "::", data.length, " - ", doc_matters.src.filename_base, ".zip"); } } if (doc_matters.opt.action.debug_do_pod) { @@ -433,7 +433,7 @@ if (exists(fn_pod)) { auto zipped = new ZipArchive((fn_pod).read); foreach (filename, member; zipped.directory) { auto data = zipped.expand(member); - writeln(". ", ((data).sha256Of).toHexString, "::", data.length, " . ", filename); + writeln(data.sha256Of.toHexString, "::", data.length, " . ", filename); } } catch (ZipException ex) { // Handle errors diff --git a/org/output_show.org b/org/output_show.org index f5e4c68..9c3f358 100644 --- a/org/output_show.org +++ b/org/output_show.org @@ -80,13 +80,20 @@ foreach (k; doc_matters.has.keys_seq.seg) { #+NAME: meta_metadoc_show_summary_document #+BEGIN_SRC d writefln( - "%s\n\"%s\", %s\n%s [%s]\n%s\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%s", + "%s\n\"%s\", %s\n%s [%s]\n%s \n%s%s\n%s%s\n%s%s\n%s\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%s", markup.repeat_character_by_number_provided("-", char_repeat_number), doc_matters.conf_make_meta.meta.title_full, doc_matters.conf_make_meta.meta.creator_author, doc_matters.src.filename, doc_matters.src.language, markup.repeat_character_by_number_provided("-", char_repeat_number), + 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", + markup.repeat_character_by_number_provided("-", char_repeat_number), "- toc arr length:", to!int(doc_abstraction["toc"].length), "- doc_abstraction arr length:", @@ -538,6 +545,8 @@ writefln( #+BEGIN_SRC d import std.array, + std.digest.crc, + std.digest.sha, std.exception, std.regex, std.stdio, diff --git a/org/spine.org b/org/spine.org index 879424b..e66ad47 100644 --- a/org/spine.org +++ b/org/spine.org @@ -1480,14 +1480,14 @@ template spineAbstraction() { <> <> <> - struct DocumentMatters { + struct ST_DocumentMatters { <> <> <> <> <> } - auto doc_matters = DocumentMatters(); + auto doc_matters = ST_DocumentMatters(); <> auto t = tuple(doc_abstraction, doc_matters); return t; @@ -1533,9 +1533,10 @@ if ((_opt_action.debug_do) } auto _header_body_insertfilelist_imagelist = spineRawMarkupContent!()(_opt_action, _manifest.src.path_and_fn); -writeln("src doc digest: ", _header_body_insertfilelist_imagelist.doc_digest.markup_doc.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.markup_doc.toHexString.length); -writeln("header: ", _header_body_insertfilelist_imagelist.doc_digest.header.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.header.toHexString.length); -writeln("text: ", _header_body_insertfilelist_imagelist.doc_digest.text.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.text.toHexString.length); +// writeln("src doc digest: ", _header_body_insertfilelist_imagelist.doc_digest.markup_doc.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.markup_doc.toHexString.length); +// writeln("header: ", _header_body_insertfilelist_imagelist.doc_digest.header.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.header.toHexString.length); +// writeln("text: ", _header_body_insertfilelist_imagelist.doc_digest.text.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.text.toHexString.length); +auto doc_digests = _header_body_insertfilelist_imagelist.doc_digest; if ((_opt_action.debug_do) || (_opt_action.debug_do_stages) ) { @@ -1640,11 +1641,6 @@ if ((_opt_action.debug_do) **** DocumentMatters struct { -#+NAME: spine_each_file_do_document_matters_0_struct_open -#+BEGIN_SRC d -struct DocumentMatters { -#+END_SRC - **** generator related #+NAME: spine_each_file_do_document_matters_1_detail_program_time @@ -1694,19 +1690,22 @@ auto generated_time() { } #+END_SRC -**** config make & meta +***** config make & meta #+NAME: spine_each_file_do_document_matters_2_meta #+BEGIN_SRC d auto conf_make_meta() { return _make_and_meta_struct; } +auto doc_digest() { + return doc_digests; +} auto has() { return _doc_has_struct; } #+END_SRC -**** env related +***** env related #+NAME: spine_each_file_do_document_matters_3_env #+BEGIN_SRC d @@ -1723,7 +1722,7 @@ auto env() { } #+END_SRC -**** opt +***** opt #+NAME: spine_each_file_do_document_matters_4_opt #+BEGIN_SRC d @@ -1741,7 +1740,7 @@ auto opt() { } #+END_SRC -**** output related +***** output related #+NAME: spine_each_file_do_document_matters_5_doc #+BEGIN_SRC d @@ -1814,12 +1813,6 @@ auto srcs() { **** } close -#+NAME: spine_each_file_do_document_matters_6_struct_close_gather -#+BEGIN_SRC d -} -auto doc_matters = DocumentMatters(); -#+END_SRC - **** step complete message #+NAME: spine_each_file_do_document_matters_msg_step4_end diff --git a/src/sisudoc/io_out/source_pod.d b/src/sisudoc/io_out/source_pod.d index 97e31af..3fd7a9a 100644 --- a/src/sisudoc/io_out/source_pod.d +++ b/src/sisudoc/io_out/source_pod.d @@ -395,10 +395,10 @@ template spinePod() { && doc_matters.opt.action.pod) { auto data = (cast(byte[]) (fn_pod).read); if (doc_matters.opt.action.vox_gt1) { - writeln(" ", doc_matters.src.filename, " > "); + writeln(doc_matters.src.filename, " > ", doc_matters.src.filename_base, ".zip"); } if (doc_matters.opt.action.pod) { - writefln("%s\n. %-(%02x%)::%s . %s.zip", fn_pod, data.sha256Of, data.length, doc_matters.src.filename_base); + writeln(data.sha256Of.toHexString, "::", data.length, " - ", doc_matters.src.filename_base, ".zip"); } } if (doc_matters.opt.action.debug_do_pod) { @@ -406,7 +406,7 @@ template spinePod() { auto zipped = new ZipArchive((fn_pod).read); foreach (filename, member; zipped.directory) { auto data = zipped.expand(member); - writeln(". ", ((data).sha256Of).toHexString, "::", data.length, " . ", filename); + writeln(data.sha256Of.toHexString, "::", data.length, " . ", filename); } } catch (ZipException ex) { // Handle errors diff --git a/src/sisudoc/meta/metadoc.d b/src/sisudoc/meta/metadoc.d index 035f57e..34212a5 100644 --- a/src/sisudoc/meta/metadoc.d +++ b/src/sisudoc/meta/metadoc.d @@ -90,9 +90,10 @@ template spineAbstraction() { } auto _header_body_insertfilelist_imagelist = spineRawMarkupContent!()(_opt_action, _manifest.src.path_and_fn); - writeln("src doc digest: ", _header_body_insertfilelist_imagelist.doc_digest.markup_doc.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.markup_doc.toHexString.length); - writeln("header: ", _header_body_insertfilelist_imagelist.doc_digest.header.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.header.toHexString.length); - writeln("text: ", _header_body_insertfilelist_imagelist.doc_digest.text.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.text.toHexString.length); + // writeln("src doc digest: ", _header_body_insertfilelist_imagelist.doc_digest.markup_doc.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.markup_doc.toHexString.length); + // writeln("header: ", _header_body_insertfilelist_imagelist.doc_digest.header.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.header.toHexString.length); + // writeln("text: ", _header_body_insertfilelist_imagelist.doc_digest.text.toHexString, " ", _header_body_insertfilelist_imagelist.doc_digest.text.toHexString.length); + auto doc_digests = _header_body_insertfilelist_imagelist.doc_digest; if ((_opt_action.debug_do) || (_opt_action.debug_do_stages) ) { @@ -148,7 +149,7 @@ template spineAbstraction() { ) { writeln("step4 commence → (doc_matters) [", _manifest.src.filename, "]"); } - struct DocumentMatters { + struct ST_DocumentMatters { auto generator_program() { struct Prog_ { string project_name() { @@ -195,6 +196,9 @@ template spineAbstraction() { auto conf_make_meta() { return _make_and_meta_struct; } + auto doc_digest() { + return doc_digests; + } auto has() { return _doc_has_struct; } @@ -287,7 +291,7 @@ template spineAbstraction() { return SRC_(); } } - auto doc_matters = DocumentMatters(); + auto doc_matters = ST_DocumentMatters(); if ((_opt_action.debug_do) || (_opt_action.debug_do_stages) ) { diff --git a/src/sisudoc/meta/metadoc_show_config.d b/src/sisudoc/meta/metadoc_show_config.d index 8a6af5d..76a0394 100644 --- a/src/sisudoc/meta/metadoc_show_config.d +++ b/src/sisudoc/meta/metadoc_show_config.d @@ -59,6 +59,8 @@ template spineShowSiteConfig() { sisudoc.meta.rgx; import std.array, + std.digest.crc, + std.digest.sha, std.exception, std.regex, std.stdio, @@ -145,6 +147,8 @@ template spineShowConfig() { sisudoc.meta.rgx; import std.array, + std.digest.crc, + std.digest.sha, std.exception, std.regex, std.stdio, diff --git a/src/sisudoc/meta/metadoc_show_make.d b/src/sisudoc/meta/metadoc_show_make.d index 817f5dc..ddbb687 100644 --- a/src/sisudoc/meta/metadoc_show_make.d +++ b/src/sisudoc/meta/metadoc_show_make.d @@ -58,6 +58,8 @@ template spineShowMake() { sisudoc.meta.rgx; import std.array, + std.digest.crc, + std.digest.sha, std.exception, std.regex, std.stdio, diff --git a/src/sisudoc/meta/metadoc_show_metadata.d b/src/sisudoc/meta/metadoc_show_metadata.d index 320f28b..31ff1ea 100644 --- a/src/sisudoc/meta/metadoc_show_metadata.d +++ b/src/sisudoc/meta/metadoc_show_metadata.d @@ -58,6 +58,8 @@ template spineShowMetaData() { sisudoc.meta.rgx; import std.array, + std.digest.crc, + std.digest.sha, std.exception, std.regex, std.stdio, diff --git a/src/sisudoc/meta/metadoc_show_summary.d b/src/sisudoc/meta/metadoc_show_summary.d index 379a1a7..36ed3c1 100644 --- a/src/sisudoc/meta/metadoc_show_summary.d +++ b/src/sisudoc/meta/metadoc_show_summary.d @@ -59,6 +59,8 @@ template spineMetaDocSummary() { sisudoc.meta.rgx; import std.array, + std.digest.crc, + std.digest.sha, std.exception, std.regex, std.stdio, @@ -102,13 +104,20 @@ template spineMetaDocSummary() { } } writefln( - "%s\n\"%s\", %s\n%s [%s]\n%s\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%s", + "%s\n\"%s\", %s\n%s [%s]\n%s \n%s%s\n%s%s\n%s%s\n%s\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%40-s%10-d\n%s", markup.repeat_character_by_number_provided("-", char_repeat_number), doc_matters.conf_make_meta.meta.title_full, doc_matters.conf_make_meta.meta.creator_author, doc_matters.src.filename, doc_matters.src.language, markup.repeat_character_by_number_provided("-", char_repeat_number), + 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", + markup.repeat_character_by_number_provided("-", char_repeat_number), "- toc arr length:", to!int(doc_abstraction["toc"].length), "- doc_abstraction arr length:", -- cgit v1.2.3