Skip to main content

Module comment_options

Module comment_options 

Source
Expand description

Comment payload shared by every writer that can anchor a margin note into its output — today DOCX (super::docx_options::DocxExportOptions::comments), and ODT once its own writer reaches this crate. One definition here, reused by both, is the whole point: a DOCX-only struct Comment in document_io and a parallel ODT-only one elsewhere would let the two drift the moment a field’s meaning changed in one but not the other.

§The character range this crate deals in

DocumentComment::start/DocumentComment::end are [start, end) in the document’s own addressable character space — the same space TextDocument::to_addressable_text(), find_all match positions, and a block’s document_position all share (see crate::format_runs::AddressableInlinePiece’s doc comment for the full contract). A writer splitting a run at a comment boundary must resolve that boundary against crate::format_runs_query::addressable_inline_pieces_for_block’s own start/end fields — never against FormatRun’s block-local UTF-8 byte offsets, which agree with this crate’s char offsets only by coincidence on the first line of the first block.

Structs§

CommentReply
One reply in a comment’s thread.
DocumentComment
One comment thread: an opening note anchored to a character range, plus its flat list of replies.
DocumentComments
Every comment thread supplied to one export, keyed by DocumentComment::uid.