diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2024-06-29 13:54:28 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2024-06-29 15:39:08 -0400 |
commit | 860b894a10f3526e6bd73d53850764c0ad95ab99 (patch) | |
tree | e4a997fcacd3b2dcbff876479ebd1ee718230f1e /org/ocda_functions.org | |
parent | nix minor (diff) |
document digests and reduction in use of tuples
Diffstat (limited to 'org/ocda_functions.org')
-rw-r--r-- | org/ocda_functions.org | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/org/ocda_functions.org b/org/ocda_functions.org index 6c300f1..ecc8b2f 100644 --- a/org/ocda_functions.org +++ b/org/ocda_functions.org @@ -47,18 +47,6 @@ template docSectKeysSeq() { #+HEADER: :noweb yes #+BEGIN_SRC d // ↓ abstraction imports -import - std.algorithm, - std.container, - std.file, - std.json, - std.path; -import - sisudoc.meta, - sisudoc.meta.defaults, - sisudoc.meta.rgx, - sisudoc.meta.metadoc_object_setter, - sisudoc.meta.rgx; // ↓ abstraction mixins mixin ObjectSetter; mixin InternalMarkup; @@ -126,6 +114,7 @@ auto node_construct = NodeStructureMetadata(); <<ocdaFunc_obj_inline_markup>> <<ocdaFunc_obj_attributes>> <<ocdaFunc_obj_set_markup_level_tags>> +<<ocdaFunc_obj_digest>> <<ocdaFunc_section_toc>> <<ocdaFunc_section_endnotes>> <<ocdaFunc_section_book_index>> @@ -3203,6 +3192,26 @@ pure ObjGenericComposite obj_dom_set_collapsed_tags()( // ↑ - object tags #+END_SRC +***** ϝ object digest + +#+NAME: ocdaFunc_obj_digest +#+HEADER: :noweb yes +#+BEGIN_SRC d +// ↓ - object digest +pure ubyte[32] obj_digest()( + ObjGenericComposite obj, +) { + obj.metainfo.sha256 = obj.text.sha256Of; + // if (obj.metainfo.is_a == "heading") { + // writeln(obj.metainfo.sha256.toHexString, " ", obj.metainfo.ocn, " ", obj.metainfo.is_a, " ", obj.metainfo.heading_lev_markup); + // } else { + // writeln(obj.metainfo.sha256.toHexString, " ", obj.metainfo.ocn, " ", obj.metainfo.is_a); + // } + return obj.metainfo.sha256; +} +// ↑ - object digest +#+END_SRC + **** ϝ section ***** ϝ section toc - table of contents |