topmark.toml.render¶
Render and normalize TopMark TOML documents.
This module contains small TOML-format helpers for:
- rendering a TomlTable to TOML text
- normalizing TOML text by round-tripping through tomlkit
TOML has no null value, so None entries must be omitted during rendering.
See topmark.toml.utils for small TOML-table building
and normalization helpers used during rendering.
render_toml_table ¶
Render a TOML table to TOML text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
toml_dict
|
TomlTable
|
TOML table to render. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The rendered TOML document as a string. |
clean_toml_text ¶
Normalize TOML text by round-tripping through tomlkit.
This helper parses the input, unwraps it to plain Python data, and renders it again. Comments and formatting noise are dropped during the round-trip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Raw TOML content. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A normalized TOML string produced by round-tripping. |