sigildocs

(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

Pipeline 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:

  1. Loads body via body-loader
  2. Applies transforms (if configured)
  3. Applies theme to wrap in page structure
  4. Writes to output directory
  5. Returns the output path

Pipeline stage that attaches producers to assets.

For each asset, attaches a producer thunk that copies the asset file when called.

apply-themeprocedure

Apply a theme function to content.

Theme functions have signature: (config state item body) -> sxml

default-themeprocedure

Default minimal theme.

Creates a simple HTML page with the content.

sxml->htmlprocedure

Convert 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)