Module comment_writer
Expand description
Shared TOML comment-writing helpers used by both the gateway HTTP CRUD
handlers and the CLI zeroclaw config set --comment / zeroclaw config patch
flow. Walks a toml_edit::DocumentMut to a leaf key by dotted path and
decorates its leading whitespace with # {comment}\n. Empty comment string
Functionsยง
- apply_
comments - build_
comment_ prefix - Build the new leading decor for a leaf, applying
# {comment}\nwhile preserving any non-comment whitespace already in the prefix. Emptycommentstrips#-prefixed lines from the existing prefix. - decorate_
key - Walk to the leaf key for
dottedand decorate it with# {comment}\n, preserving any non-comment whitespace already in the prefix. Empty comment strips comment lines from the existing prefix while leaving blank lines.