Documentation
¶
Overview ¶
Command read shows an answer as it is written.
It is the deepest of these and the one the library is for. Markdown arrives a few words at a time — from a model, over a network, from anything that produces text before it has finished thinking — and two things have to be true at once: what is certainly finished should stop being redrawn, and what is still being written should look like what it says so far.
So a stream splits it. Every block it hands back is printed into the terminal's own scrollback, where it stays after this program exits, and is never parsed or drawn again however long the answer becomes. What is left is short by construction and is re-rendered on every chunk.
Nothing about that is markdown's alone. The same shape — publish what is finished, redraw only what is not — is what any streaming interface built on this does.