aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--org/ocda_functions.org38
-rw-r--r--src/sisudoc/ocda/meta/metadoc_from_src_functions.d38
2 files changed, 42 insertions, 34 deletions
diff --git a/org/ocda_functions.org b/org/ocda_functions.org
index 5cc5e1a..fc174fd 100644
--- a/org/ocda_functions.org
+++ b/org/ocda_functions.org
@@ -3499,30 +3499,34 @@ SHA_256_Hashes_ obj_digest(M)(
string image_path = manifested.src.image_dir_path ~ "/";
char[64] image_hash;
int n = 0;
+ /+ ↓ images, scanned for in every object type: the markup does not
+ forbid an image in a heading, and an object type excluded from the
+ scan would carry neither digest nor record, silently
+ +/
+ if ((obj.text).match(rgx.inline_image)) {
+ foreach (m; (obj.text).matchAll(rgx.inline_image)) {
+ image_with_path = image_path ~ m["img"];
+ ST_file_name_hash_size_ _file_info = safeComputeHashAndSize(m["img"], image_path);
+ obj.metainfo.sha256.images ~= [_file_info];
+ }
+ }
+ char[] image_summary;
+ if (obj.metainfo.sha256.images.length > 0) {
+ foreach (i; obj.metainfo.sha256.images) {
+ image_summary ~= (i.fileMissing)
+ ? "\n - " ~ "MISSING OR UNREADABLE" ~ " - " ~ i.fileName
+ : "\n - " ~ i.fileHash_sha256.toHexString ~ "::" ~ i.fileSize.to!string ~ " - " ~ i.fileName;
+ }
+ }
if (obj.metainfo.is_a == "heading") {
obj.metainfo.sha256.summary ~=
"• - " ~ obj.metainfo.sha256.text.toHexString ~ " "
~ obj.metainfo.ocn.to!string ~ " "
~ obj.metainfo.is_a ~ " "
~ obj.metainfo.marked_up_level ~ "~ "
- ~ obj.text;
- // ~ image_summary; // heading assumed not to have image CONSIDER
+ ~ obj.text
+ ~ image_summary;
} else {
- if ((obj.text).match(rgx.inline_image)) {
- foreach (m; (obj.text).matchAll(rgx.inline_image)) {
- image_with_path = image_path ~ m["img"];
- ST_file_name_hash_size_ _file_info = safeComputeHashAndSize(m["img"], image_path);
- obj.metainfo.sha256.images ~= [_file_info];
- }
- }
- char[] image_summary;
- if (obj.metainfo.sha256.images.length > 0) {
- foreach (i; obj.metainfo.sha256.images) {
- image_summary ~= (i.fileMissing)
- ? "\n - " ~ "MISSING OR UNREADABLE" ~ " - " ~ i.fileName
- : "\n - " ~ i.fileHash_sha256.toHexString ~ "::" ~ i.fileSize.to!string ~ " - " ~ i.fileName;
- }
- }
obj.metainfo.sha256.summary ~=
" - " ~ obj.metainfo.sha256.text.toHexString
~ " " ~ obj.metainfo.ocn.to!string ~ " "
diff --git a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
index 1bc1e81..9824d61 100644
--- a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
+++ b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
@@ -3259,30 +3259,34 @@ template docAbstractionFunctions() {
string image_path = manifested.src.image_dir_path ~ "/";
char[64] image_hash;
int n = 0;
+ /+ ↓ images, scanned for in every object type: the markup does not
+ forbid an image in a heading, and an object type excluded from the
+ scan would carry neither digest nor record, silently
+ +/
+ if ((obj.text).match(rgx.inline_image)) {
+ foreach (m; (obj.text).matchAll(rgx.inline_image)) {
+ image_with_path = image_path ~ m["img"];
+ ST_file_name_hash_size_ _file_info = safeComputeHashAndSize(m["img"], image_path);
+ obj.metainfo.sha256.images ~= [_file_info];
+ }
+ }
+ char[] image_summary;
+ if (obj.metainfo.sha256.images.length > 0) {
+ foreach (i; obj.metainfo.sha256.images) {
+ image_summary ~= (i.fileMissing)
+ ? "\n - " ~ "MISSING OR UNREADABLE" ~ " - " ~ i.fileName
+ : "\n - " ~ i.fileHash_sha256.toHexString ~ "::" ~ i.fileSize.to!string ~ " - " ~ i.fileName;
+ }
+ }
if (obj.metainfo.is_a == "heading") {
obj.metainfo.sha256.summary ~=
"• - " ~ obj.metainfo.sha256.text.toHexString ~ " "
~ obj.metainfo.ocn.to!string ~ " "
~ obj.metainfo.is_a ~ " "
~ obj.metainfo.marked_up_level ~ "~ "
- ~ obj.text;
- // ~ image_summary; // heading assumed not to have image CONSIDER
+ ~ obj.text
+ ~ image_summary;
} else {
- if ((obj.text).match(rgx.inline_image)) {
- foreach (m; (obj.text).matchAll(rgx.inline_image)) {
- image_with_path = image_path ~ m["img"];
- ST_file_name_hash_size_ _file_info = safeComputeHashAndSize(m["img"], image_path);
- obj.metainfo.sha256.images ~= [_file_info];
- }
- }
- char[] image_summary;
- if (obj.metainfo.sha256.images.length > 0) {
- foreach (i; obj.metainfo.sha256.images) {
- image_summary ~= (i.fileMissing)
- ? "\n - " ~ "MISSING OR UNREADABLE" ~ " - " ~ i.fileName
- : "\n - " ~ i.fileHash_sha256.toHexString ~ "::" ~ i.fileSize.to!string ~ " - " ~ i.fileName;
- }
- }
obj.metainfo.sha256.summary ~=
" - " ~ obj.metainfo.sha256.text.toHexString
~ " " ~ obj.metainfo.ocn.to!string ~ " "