yera.runtime.handlers.markdown.base
Abstract base class for streaming markdown event handlers.
Symbols
BaseMarkdownHandler
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.__init__
__init__() → NoneInitialize empty state for a streamed Markdown block.
BaseMarkdownHandler.__enter__
__enter__() → SelfEnter the block context and emit an opening blank line.
Returns
This active markdown handler.
BaseMarkdownHandler.__exit__
__exit__(
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) → NoneFlush remaining content and reset the handler.
Parameters
Type of exception leaving the context, if any.
Exception leaving the context, if any.
Traceback associated with the exception, if any.
BaseMarkdownHandler.push
push(
event: OutputEvent,
) → NoneAppend a markdown chunk and flush any completed blocks.
Parameters
A markdown output event whose data carries the next chunk.