Documentation
¶
Overview ¶
Package termtext prepares author text (a release guide's overview and key help, the Drafter's narration) for a terminal: cleaned of what a terminal would act on or hide, and set in a gutter so it cannot pass for the CLI's own lines.
Index ¶
Constants ¶
const Gutter = " | "
Gutter starts every line of quoted author text. The CLI's own lines start at column 0 or with two spaces (a contract line, a list item), so a line behind the gutter cannot read as one of them.
Variables ¶
This section is empty.
Functions ¶
func Quote ¶
Quote is s cleaned by Safe and set behind the Gutter, one line of s per line, with its surrounding blank lines trimmed. A blank line inside s keeps the gutter, so the quoted block reads as one.
func Safe ¶
Safe is s as a terminal may show it: every control character but a newline or a tab, every C1 control, every format character (a bidi override, a zero-width space) and the Unicode line and paragraph separators becomes "?", so the text cannot send escape sequences (colours, cursor moves, a window title, a hyperlink) to the terminal it is printed on, or show other than what it says. The core refuses all of these in a guide already; this is the second defence, and the only one for text the core never validates.
Types ¶
This section is empty.