Repository navigation
Improve public rustdocs - #23
Conversation
Expand Termina's public documentation so docs.rs readers can understand the terminal, parser, event, escape-sequence, and style APIs without first reading the implementation. This is a docs-only change aimed at making the crate easier to evaluate as a possible Ratatui backend. Document recurring terminal-input pitfalls from Ratatui and crossterm maintenance experience, including key press/release behavior, terminal-dependent key encoding, modifier state, mouse coordinates, raw/cooked mode behavior, and platform differences. Add examples and links for the main construction and parsing paths while preserving implementation context for upstream influences and terminal specs.
the-mikedavis
left a comment
There was a problem hiding this comment.
This is awesome, thanks @joshka! I want to merge this basically as-is. I have one nit though: I'd also update the README to note that "CREDIT" comments have moved into implementation notes sections (https://github.com/helix-editor/termina#credit)
|
Looks like the docs CI found a nit on Windows as well |
Update README guidance for implementation note credits and fix the Windows CI failure blocking the documentation PR.
56f2e8f to
b559655
Compare
There was a problem hiding this comment.
This got reformatted by markdown lint. I usually use 100 char lines and align tables. Hope that's ok here. It generally edits easier that way. (Easier diffs in github etc.). Happy to revert that part as I know it's fairly subjective choice.
There was a problem hiding this comment.
Ah yeah I'd prefer to keep the style of the README mostly unchanged. I like to avoid hard wrapping in markdown. Making the table slimmer seems alright though, it's very wide right now. Maybe we can say "terminal dependent" and have a footnote or cross/star symbol that says that it depends on Kitty keyboard support below the table.
|
Both comments addressed. |
Keep the README closer to its existing unwrapped prose style while retaining the slimmer Windows input comparison table requested during review.
|
Thanks again! |
Summary
Improve Termina's public rustdocs so the crate is easier to evaluate and use as a terminal backend.
This is a docs-only change. It expands module, type, variant, and method documentation across the public API so docs.rs readers can understand the terminal, parser, event, escape-sequence, and style surfaces without reading the implementation first.
Motivation
Ratatui has an open request to consider Termina as a backend:
ratatui/ratatui#1784
Before that is practical, Termina needs a stronger user-facing documentation surface. This pass documents the current API rather than changing behavior.
I maintain Ratatui and crossterm, so I tried to bring that support and review experience into this pass. In particular, the docs now call out recurring sources of user confusion around terminal input: key press/release events, terminal-dependent key encoding, modifier handling, mouse coordinates, raw/cooked mode behavior, and platform differences.
What changed
Review Notes
This is intentionally a broad documentation pass. I manually reviewed and steered the public docs for correctness and tone, with extra attention to the event, parser, terminal, and style APIs.
The main remaining review caveat is the CSI/DCS/OSC reference docs. Those sections are repetitive protocol enum documentation, and I have not manually reviewed every variant with the same depth as the rest of the crate. The examples, links, and rustdoc formatting for those sections were validated mechanically.
No runtime behavior is intended to change.
Validation
Ran: