Wit

Faceted content

One source, many gated views — a draft with editorial notes and a clean final, a public edition and an internal one, a build per target. Wit does this with data flags, conditionals, and multiple build roots. This page covers the verified path and, honestly, the two things people reach for that do not exist.

The verified path

Model each facet as data and gate content on it with a conditional:

source
#doc: { audience - public, status - draft }

(if @doc.status is draft)
  @aside Editorial: tighten this section. aside@
(end)

(if @doc.audience is internal)
  @section Internal appendix: raw figures. section@
(end)
result

Flip the flag in #doc and the gated blocks appear or vanish. You can also iterate over annotated sections and gate each, and use ~line comments for scratch notes that never render at all.

Membership without contains

There is no contains operator. To model membership — "is this in the internal set?" — compare a single flag with is or equals, or keep one flag per facet:

#doc: { public - true, internal - false }

(if @doc.public) … visible in the public build … (end)

For anything richer, filter in a <% %> script.

Build roots, not conditional references

To ship genuinely different subsets of files, use multiple build roots — a small master per edition, each referencing the files that edition includes. What you cannot do is wrap a reference in an (if): conditional references are not supported (see Multi-file references). Choose the build root instead.

Common mistakes

  • Reaching for contains — model membership as a flag compared with is / equals.
  • Wrapping a reference in an (if) — pick a build root per edition.

See also

Conditionals

· Multi-file references · Derived content · Self-organising documents