yera.runtime.handlers.markdown.jupyter

Jupyter markdown handler: native frontend rendering for streaming markdown.

Symbols

class JupyterMarkdownHandler — Streaming markdown handler that renders through the Jupyter frontend.

JupyterMarkdownHandler

Streaming markdown handler that renders through the Jupyter frontend.

Unlike the TTY handler, nothing is rasterised kernel-side: markdown, code highlighting, LaTeX (MathJax) and images are all handed to the notebook frontend. In-progress content streams into a single updating display handle; finished blocks are committed as permanent outputs above it.

Code blocks are accumulated and emitted as one display per fenced block (rather than per line, as the terminal does), so a streamed code block renders as a single highlighted box instead of a stack of separate ones.

Methods

__init__ — Initialize Jupyter Markdown rendering with no live display.
__exit__ — Flush via the base and commit unterminated code.

JupyterMarkdownHandler.__init__

__init__() → None

Initialize Jupyter Markdown rendering with no live display.

JupyterMarkdownHandler.__exit__

__exit__(
    exc_type: type[BaseException] | None,
    exc_val: BaseException | None,
    exc_tb: TracebackType | None,
) → None

Flush via the base and commit unterminated code.

Parameters

exc_type
type: type[BaseException] | None

Type of exception leaving the context, if any.

exc_val
type: BaseException | None

Exception leaving the context, if any.

exc_tb
type: TracebackType | None

Traceback associated with the exception, if any.