description: A note-to-self or @-addressed HTML-comment thread attached to a piece of text, indexed as a queryable object. tags: glossary maturity/experimental references:
Comments let you — and, when you want, your collaborators — leave notes inside a page without touching the rendered content. They are plain Markdown HTML comments under the hood, so the convention works everywhere and are technically valid markdown.
Any HTML comment is considered a note unless it’s a [Baked Sections](Baked Sections) marker. The simplest example is just bare text (Alt-click to see the underlying code):
Sign a note to record when, and optionally who wrote it with the — author, date suffix. The separator may be -, --, – or — when hand-typed:
An optional first line re: "quoted anchor" anchors the note to a snippet of the surrounding text (straight or curly quotes both work). It shows up as the quoted context in the card:
Addressing a note to someone turns it into a routing mechanism (that can be used for querying):
@who: addresses a message to who.A full back-and-forth looks like:
A conforming comment block renders as a card: the quoted (re:) text (if any) with an @addressee when the message is addressed, or just its text when it is not. A Reply button appears when comments are addressed with @addressee, the button appends a new line addressed to whoever should answer next (inferred from the last message). The Resolve button simply removes the comment entirely.
Comment: Add (Ctrl-Alt-c/Cmd-Alt-c) inserts a new comment block after the current paragraph. With an active selection, the selected text becomes the re: "..." quote./comment inserts a comment.comments.author: your signature identity. Set it so messages you write get signed automatically. Also editable from the Configuration Manager's Comments category.config.set("comments.author", "pete")
Leaving comments.author unset is fine — comments you add just carry a date-only signature instead of a named one.
Every conforming comment is indexed as an object tagged comment, queryable like any other Object via [Space Lua/Integrated Query](Space Lua/Integrated Query). index.comments() is the idiomatic named collection:
page: the page the comment lives onrange: [from, to] character offsets of the comment blockquote?: the anchored text, if the block had a re: "..." linethread: the list of messages, each { addressee?, text, author?, date? }addressees: the distinct set of everyone addressed in the thread (empty for a purely unaddressed note)waitingOn?: the addressee of the last message, if it's addressed — whose turn it is to respond. Absent for a note with no addressee.lastDate?: the date of the last signed message, if anyExample: ${query[ from c = index.comments() select table.select(c, "ref", "thread") ]( from c = index.comments() select table.select(c, "ref", "thread") )}