(sigil publish render)
(sigil publish render) - Rendering Pipeline Stages
Pipeline stages for attaching content and asset producers to items. Producers are thunks that render/copy content when called during graph execution.
Exports
attach-content-producersprocedurePipeline stage that attaches producers to content items.
For each item, attaches:
- producer: A thunk that renders the item when called
- dependencies: List of files this item depends on
The producer thunk:
- Loads body via body-loader
- Applies transforms (if configured)
- Applies theme to wrap in page structure
- Writes to output directory
- Returns the output path
attach-asset-producersprocedurePipeline stage that attaches producers to assets.
For each asset, attaches a producer thunk that copies the asset file when called.
apply-themeprocedureApply a theme function to content.
Theme functions have signature: (config state item body) -> sxml
default-themeprocedureDefault minimal theme.
Creates a simple HTML page with the content.
sxml->htmlprocedureConvert an SXML tree to an HTML string.
Handles nested elements, attributes, text content, and void elements. Void elements like <br> and <img> are output without a closing slash. Content inside <style> and <script> tags is not escaped. A document wrapper element (from markdown->sxml) is stripped.
(sxml->html '(p "Hello"))
; => "<p>Hello</p>"
(sxml->html '(div (@ (class "main")) (p "text")))
; => "<div class=\"main\"><p>text</p></div>"
(sxml->html '(img (@ (src "foo.png"))))
; => "<img src=\"foo.png\">"
(sxml->html '(document (p "From markdown")))
; => "<p>From markdown</p>"Re-exported from (sigil sxml)