Skip to main content

Module comment_writer

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}\n while preserving any non-comment whitespace already in the prefix. Empty comment strips #-prefixed lines from the existing prefix.
decorate_key
Walk to the leaf key for dotted and 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.