Line writer for managing indented TOON output.
The LineWriter handles:
Line writer for managing indented TOON output. The LineWriter handles: - Indentation management (configurable spaces per level) - Line accumulation - Whitespace invariants (no trailing spaces or newlines)
(create)(create indent-size)Creates a new LineWriter with the specified indentation size.
Parameters:
Returns: A new LineWriter instance.
Creates a new LineWriter with the specified indentation size. Parameters: - indent-size: Number of spaces per indentation level (default: 2) Returns: A new LineWriter instance.
(push writer depth content)Adds a line to the writer at the specified depth.
Parameters:
Returns: Updated LineWriter with the new line added.
Notes:
Adds a line to the writer at the specified depth. Parameters: - writer: LineWriter instance - depth: Indentation level (0 = no indent, 1 = one indent, etc.) - content: String content for the line (must not contain newlines) Returns: Updated LineWriter with the new line added. Notes: - Trailing spaces are automatically removed from content - Empty content is allowed
(to-string writer)Converts the LineWriter to a string.
Parameters:
Returns: String representation with lines joined by newlines. No trailing newline at the end.
Converts the LineWriter to a string. Parameters: - writer: LineWriter instance Returns: String representation with lines joined by newlines. No trailing newline at the end.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |