sigildocs

(sigil publish stages)

(sigil publish stages) - Assembly Pipeline Stages

Pipeline stages for filtering, path mapping, navigation building, and cross-reference indexing.

Exports

filter-draftsprocedure

Pipeline stage that removes draft items.

Checks config options: draft-mode: - if true, keeps drafts. Otherwise, removes items where metadata draft: is true.

filter-itemsprocedure

Create a pipeline stage that filters items with a predicate.

(filter-items (lambda (item) (has-tag? item "published")))

Pipeline stage that computes output paths.

This is a no-op if paths are already computed during scanning. Can be used with custom path handlers in the future.

Pipeline stage that builds navigation from item metadata.

Groups items by nav-group: metadata, sorts by nav-order:. Sets state navigation: to a dict with:

  • top-level: list of top-level nav items (no nav-group)
  • sections: list of nav group dicts

Pipeline stage that builds cross-reference index.

Items with ref-id: metadata are added to the index. Key format: namespace:id or just id if no namespace.

Pipeline stage that builds source-path to URL index.

This enables link rewriting by mapping source file paths to their canonical URLs. Cleans up /index.html to / for nice URLs.

resolve-refsprocedure

Transform that resolves ref: links to content references.

Looks up ref:key or ref:namespace:id links in the ref-index and rewrites them to the target URL. Emits warnings to stderr for unresolved references.

If link text is empty, auto-fills from the reference title.

Transform signature: (config state item node) -> node

;; In markdown:
;; [First Post](ref:blog:first-post)   -> link to blog post
;; [](ref:blog:first-post)             -> auto-titled link