Skip to main content

Module meta_edit

Module meta_edit 

Source
Expand description

._meta保注释写回与新建模板渲染。

写回直接基于 toml_edit::DocumentMut,因此已有的 # 注释与键的书写顺序都会被保留 (规范硬性约束 6、DoD 16)。

Functions§

author_to_table
[[authors]] 元素 → TOML 表(按规范键序)。
entry_to_table
[[entries]] 元素 → TOML 表(按规范键序)。
meta_from_text
从 TOML 文本构建 Meta(模板渲染后使用)。
ref_to_table
[[refs]] 元素 → TOML 表(按规范键序)。
render_branch_meta
渲染 node / branch ._meta 模板。
render_root_meta
渲染 root ._meta 模板。
strip_line_comments
去掉整行 # 注释(不处理字符串内的 #);str fmt --strip-comments 的唯一入口。
toml_str
TOML 基本字符串转义。