Skip to main content

Crate chordsketch_render_text

Crate chordsketch_render_text 

Source
Expand description

Plain text renderer for ChordPro documents.

This crate converts a parsed ChordPro AST (from chordsketch-chordpro) into formatted plain text with chords aligned above their corresponding lyrics.

Constants§

MAX_WARNINGS
Maximum number of warnings the renderer will accumulate for a single render pass. Re-exported from the canonical location in chordsketch-chordpro::render_result so existing downstream callers can keep importing chordsketch_render_text::MAX_WARNINGS unchanged (issue #1874). Maximum number of warnings any renderer accumulates for a single render pass (issue #1833). Without a cap, a pathological input such as one million malformed {transpose} lines would push the warnings vector to tens of megabytes. push_warning refuses to exceed this limit and appends a single truncation marker the first time the cap is hit.

Functions§

render
Parse a ChordPro source string and render it to plain text.
render_song
Render a Song AST to plain text.
render_song_with_transpose
Render a Song AST to plain text with an additional CLI transposition offset.
render_song_with_warnings
Render a Song AST to plain text, returning warnings programmatically.
render_songs
Render multiple Songs to plain text, separated by a blank line.
render_songs_with_transpose
Render multiple Songs to plain text with transposition.
render_songs_with_warnings
Render multiple Songs to plain text, returning warnings programmatically.
try_render
Parse a ChordPro source string and render it to plain text.