Documentation
¶
Overview ¶
Package bubbleteandmd renders streaming LLM Markdown in a terminal, for bubbletea programs. Finished blocks are rendered once and cached; only the open tail is rendered again as tokens arrive, and that tail is healed (an open fence, `**`, a half-typed link) so raw syntax does not show mid-stream. It reads llx-markdown's directive syntax (`> [!STEPS]`, `> [!TABS]`, ```tree fences …). See README.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache holds rendered stable blocks, keyed by (Stream key, block source). One Cache can serve many Streams; it is safe for concurrent use.
type Renderer ¶
Renderer renders one whole Markdown document. *glamour.TermRenderer satisfies it. A Renderer is used by one goroutine at a time.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream renders one document that grows at its end. Blocks before the last two are rendered once and cached; the last two (the tail) are rendered on every call. Frame heals the tail; Final does not. The result equals r.Render of the whole (healed, for Frame) text.
A Stream is not safe for concurrent use.
func NewStream ¶
NewStream returns a Stream that renders with r and caches stable blocks in c under key. key must name everything that changes r's output (dun: width and style). c may be shared by Streams; nil means no cache.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
blocks
Package blocks cuts a Markdown document into top-level blocks that can be rendered, and cached, one by one.
|
Package blocks cuts a Markdown document into top-level blocks that can be rendered, and cached, one by one. |
|
corpus
Package corpus holds the streaming test corpora, the seeded reply generator and the chunking helpers ported from llx-markdown, for invariant tests.
|
Package corpus holds the streaming test corpora, the seeded reply generator and the chunking helpers ported from llx-markdown, for invariant tests. |
|
heal
Package heal stabilizes the tail of a markdown text that is still streaming.
|
Package heal stabilizes the tail of a markdown text that is still streaming. |
|
join
Package join puts separately rendered glamour blocks together so that the result equals glamour's render of the whole document.
|
Package join puts separately rendered glamour blocks together so that the result equals glamour's render of the whole document. |
|
lru
Package lru is a small bounded least-recently-used cache.
|
Package lru is a small bounded least-recently-used cache. |