diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2024-07-01 12:01:44 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2024-07-01 12:53:00 -0400 |
commit | 602bc01129a5f0900fd7ceefb2770b297ea299d4 (patch) | |
tree | 3cce57e0e343801a3efc4b6b4a53f33af9d541ca | |
parent | markup source digests (write to terminal) (diff) |
markup source digest to metadata.html
-rw-r--r-- | org/out_metadata.org | 21 | ||||
-rw-r--r-- | src/sisudoc/io_out/metadata.d | 21 |
2 files changed, 36 insertions, 6 deletions
diff --git a/org/out_metadata.org b/org/out_metadata.org index 31cc9a9..289b702 100644 --- a/org/out_metadata.org +++ b/org/out_metadata.org @@ -48,11 +48,13 @@ template outputMetadata() { #+NAME: output_imports #+BEGIN_SRC d import + std.digest.crc, + std.digest.sha, std.file, std.format; import sisudoc.io_out; mixin InternalMarkup; -string[] metadata_; +char[] metadata_; #+END_SRC ** metadata @@ -171,6 +173,19 @@ if ((doc_matters.opt.action.html_link_pdf) || (doc_matters.opt.action.html_link_ ~ " □ pdf (U.S. letter) </a>] "; } metadata_ ~= "</p>"; +metadata_ ~= "<hr /><p class=\"lev0\">Digests:</p>"; +metadata_ ~= "<p class=\"lev1\"><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" + ~ "</p>"; if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) { metadata_ ~= "<hr /><p class=\"lev0\">Topics:</p>"; string[] _top = ["", "", "", "", ""]; @@ -275,7 +290,7 @@ metadata_write_output(doc_matters, metadata_); #+NAME: output_metadata_write #+BEGIN_SRC d -void metadata_write_output(M)(M doc_matters, string[] metadata_) { +void metadata_write_output(M)(M doc_matters, char[] metadata_) { auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); try { if (!exists(pth_html.base)) { @@ -284,7 +299,7 @@ void metadata_write_output(M)(M doc_matters, string[] metadata_) { { auto f = File(pth_html.fn_scroll("metadata." ~ doc_matters.src.filename), "w"); foreach (o; metadata_) { - f.writeln(o); + f.write(o); } } if (!exists(pth_html.base ~ "/index.html")) { diff --git a/src/sisudoc/io_out/metadata.d b/src/sisudoc/io_out/metadata.d index 0210212..59329e7 100644 --- a/src/sisudoc/io_out/metadata.d +++ b/src/sisudoc/io_out/metadata.d @@ -110,11 +110,13 @@ template outputMetadata() { return o; } import + std.digest.crc, + std.digest.sha, std.file, std.format; import sisudoc.io_out; mixin InternalMarkup; - string[] metadata_; + char[] metadata_; string theme_dark_0 = format(q"┃ body { color : #CCCCCC; @@ -364,7 +366,7 @@ string theme_light_1 = format(q"┃ doc_matters.opt.action.css_theme_default ? theme_light_0 : theme_dark_0, doc_matters.opt.action.css_theme_default ? theme_light_1 : theme_dark_1, ) ~ "\n"; - void metadata_write_output(M)(M doc_matters, string[] metadata_) { + void metadata_write_output(M)(M doc_matters, char[] metadata_) { auto pth_html = spinePathsHTML!()(doc_matters.output_path, doc_matters.src.language); try { if (!exists(pth_html.base)) { @@ -373,7 +375,7 @@ string theme_light_1 = format(q"┃ { auto f = File(pth_html.fn_scroll("metadata." ~ doc_matters.src.filename), "w"); foreach (o; metadata_) { - f.writeln(o); + f.write(o); } } if (!exists(pth_html.base ~ "/index.html")) { @@ -507,6 +509,19 @@ string theme_light_1 = format(q"┃ ~ " □ pdf (U.S. letter) </a>] "; } metadata_ ~= "</p>"; + metadata_ ~= "<hr /><p class=\"lev0\">Digests:</p>"; + metadata_ ~= "<p class=\"lev1\"><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" + ~ "</p>"; if (doc_matters.conf_make_meta.meta.classify_topic_register_arr.length > 0) { metadata_ ~= "<hr /><p class=\"lev0\">Topics:</p>"; string[] _top = ["", "", "", "", ""]; |