reference

Plugin configuration reference

Configure manifest inputs, renderer selection, documentation surfaces, source links, routes, assets, and Taproot Docs output.

Required manifest input

cemPath identifies the Custom Elements Manifest read when the plugin is configured. Use an absolute path or a path relative to the process working directory. A missing or unreadable file produces an empty manifest with a warning; projects that require generated references should make manifest generation and validation explicit earlier build steps.

eleventyConfig.addPlugin(wtfmPlugin, {
  cemPath: "custom-elements.json",
});

Optional data inputs

typeManifestPath adds interfaces, type aliases, functions, and other non-element declarations generated by WTFM's type extractor. assetsDir controls where the inlineSvg shortcode reads SVG source. Neither path is a publishing destination.

The plugin exposes customElements, docSurfaces, and, when configured, typeManifest as global Eleventy data.

Renderer selection

sections sets the default ordered renderer keys. Built-in component sections include examples, slots, attributes, methods, events, CSS parts, and CSS custom properties. The aliases cssparts and cssprops resolve to their canonical keys.

eleventyConfig.addPlugin(wtfmPlugin, {
  cemPath: "custom-elements.json",
  sections: ["examples", "attributes", "events", "css-properties"],
});

A declaration's @docSections tag can replace that order or use all and negative entries such as -methods. customRenderers registers additional renderer objects by key; a custom renderer with a built-in key replaces that renderer. Keep custom output compatible with every rendering mode it is asked to support.

Filtering attributes

excludeAttributes removes inherited or internal attributes globally. attributeExceptions maps an excluded attribute to the tag names where it remains public.

{
  excludeAttributes: ["scheme"],
  attributeExceptions: { scheme: ["example-root"] },
}

An exception key must also be excluded globally; keeping the relationship explicit prevents a configuration typo from changing public reference output.

referenceUrlBuilder and helpUrlBuilder own the canonical routes for each validated documentation surface. Stable slugs and stable route builders are link contracts. When a route changes, add an external redirect rather than changing a resource identity.

githubLinkTemplate customizes the visible link made from a declaration's github metadata. It receives the already-derived URL and returns site HTML; the semantic Taproot Docs path records a plain source location separately.

Taproot Docs options

The optional taprootDocs block enables semantic output. It requires complete GitHub source provenance and an ordered navigation tree. Locale, shared assets, an asset root, and a deterministic source epoch are optional. The stable repository id is never inferred from the owner/name locator.

See Taproot Docs artifact mode for the full example and failure model.

Portable discovery metadata

Set discovery: { origin: "https://docs.example.com", strict: true } to emit a production sitemap and robots file from final rendered HTML. Keep origin set to the production HTTPS origin even during local preview. Optional exclude: ["/examples/", "/internal/"] omits whole route subtrees; paths without a trailing slash match exactly. Noindex pages, redirects, canonical aliases, 404s, and internal artifact output are excluded automatically.

Declare the homepage favicon with <link rel="icon" href="/assets/icon.svg"> and copy the corresponding file through Eleventy. Local icon files and their image signatures/types are checked after the build; broken declarations fail. Missing recommendations warn by default; strict: true makes them fail too. The helper does not fetch external icons, rewrite HTML, or invent modification dates. A root /favicon.ico is optional when a valid favicon is declared.

This option owns the portable output's sitemap.xml and robots.txt. Taproot managed Docs renders its own discovery metadata; exact Docs publishes these files unchanged. Hosting controls staging crawl restrictions independently.