yera.runtime.handlers.markdown.base
Abstract base class for streaming markdown event handlers.
Symbols
BaseMarkdownHandler
Inherits:
BaseHandlerAbstract base for streaming markdown block handlers.
Manages buffer state and commit logic for streaming markdown content, delegating environment-specific rendering to subclasses via abstract primitive methods. Handles code blocks and display math detection in addition to plain markdown.
Subclasses must implement _render_markdown,
_render_code,
_render_latex,
_push_buffer_to_live,
_clear_live,
and _print_blank_line.
Methods
BaseMarkdownHandler.__enter__
__enter__() → SelfEnter the block context and emit an opening blank line.
BaseMarkdownHandler.__exit__
__exit__(
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) → NoneFlush remaining buffer, emit a closing blank line, and reset state.
BaseMarkdownHandler.push
push(
event: OutputEvent,
) → NoneAppend a markdown chunk and flush any completed blocks.
Parameters
event
type: OutputEvent
A markdown output event whose data carries the next chunk.