Requirements and features for the Cool-Digest Script implemented in Templater scripting language for Obsidian (not JS)

  1. Content Blocks Processing:

    • Retrieve the current file in Obsidian
    • The boundaries of a content block are defined by H1-H3 headers or beginning or end of file
    • Process each content block
    • Handle empty content blocks with appropriate error messages
    • Deformat the content block before digesting (remove markdown formatting)
    • Track and report on removed formatting elements
  2. Hash Generation:

    • Generate a 12-character SHA-256 hash of the deformatted content
    • Ensure consistent hash generation for identical content
  3. Digest & Seal Marks:

    • Digest Mark in the format: [✉️](https://WikiWe.org/Notes/ds/block/{digest-hash}?ts={date}&authors={authors}&cc={character-count}&wc={word-count}&lc={line-count})
    • Seal Mark in the format: [🔒](https://WikiWe.org/Notes/ds/seal/{seal-hash}?ts={date}&authors={authors}&cc={character-count}&wc={word-count}&lc={line-count})
    • Use the current date (YYYY-MM-DD format)
  4. Content Modification:

    • Append the Digest Mark to the end of each content block
    • Preserve any existing Seal Mark when modifying content
  5. Multiple Mark Handling:

    • Detect and handle multiple existing Digest Marks
    • Detect and handle multiple existing Seal Marks
    • Use the last Digest Mark if multiple are found (with warning)
    • Preserve the last Seal Mark if multiple are found (with warning)
  6. Verification of Existing Digests:

    • Check for existing Digest Marks in each content block before processing
    • Verify if the content matches an existing digest
    • Allow re-digesting if the content has changed
    • Skip re-digesting if the content is unchanged (idempotency)
  7. Deformatting removes

    1. Digest Marks
    2. Seal Marks
    3. Headers (#, , , , , )
    4. Emphasis markers (* and _)
    5. Bold markers (** and __)
    6. Strikethrough markers (~~)
    7. Blockquote markers (>)
    8. Horizontal rule markers (---, ***, ___)
    9. List markers (-, *, +, and numbers followed by .)
    10. Task list markers (- [ ] and - [*])
    11. Highlight markers (==)
  8. User Feedback and Logging:

    • Provide clear, detailed notices to the user about the digest process
    • Uses Notice() and console.log()
    • Log detailed information about each step of the process
    • Include version number v1.6 in notices and logs
    • Log the deformatted content for debugging purposes
  9. Error Handling:

    • Handle and report errors for invalid content blocks
    • Handle and report errors for file system operations
    • Provide clear error messages for verification failures
  10. Performance and Optimization:

    • Ensure efficient processing of large content blocks
    • Optimize file I/O operations
  11. Content Statistics:

    • Calculate and report word count
    • Calculate and report character count
    • Calculate and report line count
  12. Idempotency:

    • Ensure running the script multiple times on unchanged content produces the same result
  13. Frontmatter Handling:

    • Extract authors information from frontmatter authors if available
  14. Preservation of Original Formatting:

    • Ensure the original formatting of the content is preserved in the document