Skip to main content

render.renderers

Usage

Renderers by format, in a registry like every other component (design §6), and render.

Classes

Name Description
Renderer Writes artefacts in one format.

Renderer

Writes artefacts in one format.

Usage

Source

Renderer()

render returns text, or bytes when binary is true, and raises RenderError for a kind of artefact the format cannot hold.

Functions

Name Description
render() obj in format (a renderer key: docx, html, markdown, png, svg), in the style.
write() Render obj to the file path, the format from its suffix unless format is given.

render()

obj in format (a renderer key: docx, html, markdown, png, svg), in the style.

Usage

Source

render(obj, format, *, style=None, source=None)

style is anything load_style takes. source fills the source note of every table and figure that has none; a Document’s own source does the same.


write()

Render obj to the file path, the format from its suffix unless format is given.

Usage

Source

write(obj, path, *, format=None, style=None, source=None)

Markdown links its figures as <id>.svg; those files are written next to it.