yera.runtime.blocks.markdown
Emit Markdown as a one-shot block or an ordered stream of chunks.
A one-shot call emits its content and immediately closes the block. A
MarkdownStream retains one block identity across appended chunks, establishes
a parent scope for nested output, and closes when its context exits.
Symbols
MarkdownStream
_StreamHandleEmit ordered Markdown chunks under one block identity.
Each append is pushed immediately for incremental rendering. Entering the context establishes this block as the parent of nested output; leaving it emits the terminal event.
Methods
MarkdownStream.__init__
__init__(
block_id: str,
)Initialize a markdown stream handle.
Parameters
Identity shared by all emitted chunks.
MarkdownStream.__enter__
__enter__()Open the markdown block scope.
Returns
This stream handle.
MarkdownStream.__exit__
__exit__(
exc_type: type[BaseException],
exc_value: BaseException | None,
traceback: TracebackType,
)Close the markdown block scope.
Parameters
Type of exception leaving the context, if any.
Exception leaving the context, if any.
Traceback associated with the exception, if any.
Returns
False so exceptions propagate from the managed block.
MarkdownStream.append
append(
content: str,
) → NoneAppend a new chunk to this markdown block.
Parameters
Markdown content to emit.
MarkdownStream.new_line
new_line(
content: str,
) → NoneAppend a paragraph break and content to this markdown block.
Parameters
Markdown content to emit after the break.