Skip to main content

Module lens

Module lens 

Source
Expand description

The article lenses: formatted view, source view, and export.

Two lenses render the same document value side by side – a formatted view (outline plus a block canvas) and a source view (each block’s raw value). Embedded live blocks render through scene/embed: a runtime value drawn by its own lens inside the article, using a cached output when one is attached.

Constants§

ARTICLE_FORMATTED_LENS
The formatted article lens id.
ARTICLE_SOURCE_LENS
The source article lens id.

Functions§

article_formatted
Render the formatted article: outline plus a block canvas.
article_outline
The outline: a tree of the article’s section headings.
article_source
Render the source article: the title and each block’s raw value as text.
export_intermediate
The stable intermediate document value used for export. Export formats are derived from this single IR; here it is the normalized document value.
export_markdown
A Markdown export stub over the stable intermediate document value.
with_cache
Attach a cached rendered output (a Scene) to an embed block.