Liking cljdoc? Tell your friends :D

com.vadelabs.toon.encode.writer

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)
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)
raw docstring

createclj/s

(create)
(create indent-size)

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.

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.
sourceraw docstring

empty-writer?clj/s

(empty-writer? writer)
source

line-countclj/s

(line-count writer)
source

pushclj/s

(push writer depth content)

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
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
sourceraw docstring

to-stringclj/s

(to-string writer)

Converts the LineWriter to a string.

Parameters:

  • writer: LineWriter instance

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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close