Skip to main content

Module comments_meta

Module comments_meta 

Source
Expand description

P6 — the ** Active Comments subtree: human-facing TODO/DONE headings, one per pulled Google comment, keyed by :COMMENT_ID:.

Under * GDOC_METADATA, this section sits after ** Sync State. Each comment is a level-3 heading carrying its id, author, date, and anchored section in a property drawer, plus the quoted document text and any replies in the body.

Three operations back the sync flows:

  • parse (parse_entries) extracts (id, state, section) from existing headings — push reads DONE to resolve in Google; pull reads the known ids to avoid re-inserting.
  • render/merge (render_section) appends new comments as TODO headings. Merge-by-id (A3): existing headings are preserved byte-for-byte and never reordered, so operator notes and clocking survive.
  • clean (clean_section) drops the DONE subtrees and keeps the rest verbatim.

Line scanning is org-block-aware: lines inside a #+begin_…/#+end_… block (e.g. a quoted snippet that happens to start with ***) are never mistaken for headings. Parsing is total (EI-4) — non-conforming headings are skipped, never panicked on.

Structs§

CommentEntry
The machine-relevant fields parsed from one comment heading.
PendingReply
An operator-authored reply (**** REPLY subheading) under a comment that has not yet been posted to Google.

Enums§

CommentState
The TODO/DONE state of a comment heading.

Functions§

clean_section
Render the ** Active Comments subtree with every DONE comment subtree removed; non-DONE blocks and any preamble are kept verbatim.
parse_entries
Parse every comment heading in the ** Active Comments section of region.
pending_replies
Extract every operator-authored **** REPLY subheading from the comments in region, paired with the id of the comment it answers.
render_comment
Render a single new comment as a TODO heading (used by pull-merge).
render_section
Render the full ** Active Comments subtree: the heading, the existing body preserved verbatim (A3), then each new comment whose id is not already present appended as a TODO heading.