blark.html.HtmlWriter

class blark.html.HtmlWriter(user: 'Any', source_filename: 'Optional[pathlib.Path]', block: 'OutputBlock')[source]

Bases: object

Methods

__init__(user, source_filename, block)

save(user, source_filename, parts)

Convert the source code block to HTML and return it.

to_html()

HTML tag-annotated source code.

Attributes

source_code

The source code associated with the block.

user

source_filename

block

user: Any
source_filename: Path | None
block: OutputBlock
property source_code: str

The source code associated with the block.

to_html() str[source]

HTML tag-annotated source code.

static save(user: Any, source_filename: Path | None, parts: List[OutputBlock]) str[source]

Convert the source code block to HTML and return it.

__init__(user: Any, source_filename: Path | None, block: OutputBlock) None