Skip to content
Svartz v2.6.0

@svartz/plugins

79 exported symbols.

Interfaces

i CitationOptions
i CompiledNoteVersionWhat `compileNoteVersion` answers.
i OxHugoOptions
i PresentationOptions
i PreviewNoteA published note a preview's links can name.
i PreviewOptions
i RoamOptions

Types

t ContentSlotWhich content slot (callout, code block, image, link, embed) renders each element of a note's HTML tree, the props that slot's component receives, and the attributes that survive sanitizing. The build compiles notes with it (`compileContent`), and `@svartz/ui` renders a preview in the browser with it, so both treat a tree the same way.
t CorePluginId
t SlideAction

Functions

f activeContentSlotThe slot that renders `element` inside a tree, where `insideCode` says an ancestor is a code block's figure: the figure's own `<pre>` belongs to it, not to a slot of its own.
f allocateRoutesPluginAssign final page slugs after publication, before links consume them.
f alternateNames
f alternateRoutesThe routes a note's alternate names ask to redirect from, below the vault's mount: `aliases: [Old Name]` asks for `old-name`. `allocateRedirects` grants those still free.
f analyticsContribute one browser tracker only when a vault selects an analytics provider.
f citationsResolve bibliography paths from the vault, independent of the host process cwd.
f compileNoteVersionCompiles `markdown`, a version of the published note `note` that sat at `path` in the vault, as the build compiles the note: run `ctx.plugins`' `parseFrontmatter` stage on it alone, then their link, OFM and embed stages on it among the notes and attachments the build publishes, embedding them from the build's own sources, then compile it with the build's compiler steps and any its own content alone needs. The version takes the note's place and route, and links resolve as they do from the note now.
f compileProtectedNoteSourceCompile a protected note in memory for the separate encrypted bundle.
f containsCodeWhether `element`'s descendants are inside a code block, given whether `element` is.
f contentPropsThe props `slot`'s component gets for `element`, besides its children.
f contentSlotThe slot that renders `element`, or `undefined` for plain markup.
f createCorePluginsCreate the canonical ordered set of core plugins. Returned array matches the pipeline execution order.
f discoverFilescore:discover-files — traverse vault directory, read file contents, assign slugs.
f emitArtifacts
f emitDiscovery
f emitImages
f extractFrontmatterMarkdown parsing utilities — ported from @svartz/vault parse.ts. Kept Effect-free for plugin authors.
f filterUnpublished
f groupAtBreaksSplit nodes into slides at each break. The breaks go, and so do slides with only blank nodes.
f hardLineBreaksTurn prose newlines into `<br>` only when this plugin is configured.
f indexContentcore:index — single canonical index artifact producer.
f isNote
f isUnsafeElementWhether `element` is dropped, children and all.
f keepsAttachmentWhether the build may publish the attachment at `path` inside the vault: discovery reads its folder and the exclude patterns let it through. The build publishes it only once a published note references it.
f mountListen for the start key on every page; a navigation closes any open presentation.
f mountBrowser resource entry point. No tracker loads without resolved consumer config.
f mount
f oxHugoFlavoredMarkdownNormalize ox-hugo syntax before the required frontmatter and link parser.
f parseFrontmattercore:parse-frontmatter — extract frontmatter and raw links from each file.
f pathRouteThe route a note's filename asks for: `people/Ada Lovelace.md` → `people/ada-lovelace`, `Guides/Guides.md` → `guides`.
f presentationLet readers present any note: `plugins: [presentation()]` in `svartz.config.ts`. The browser script and stylesheet work with every theme.
f publishedAttachmentsThe vault attachments the site publishes, each at `<mount>/<path>`: the files public notes reference, as `core:filter-unpublished` settles them. Attachments only protected notes reference stay in their encrypted payload.
f publishesNoteWhether the build publishes a note at `path` inside the vault with `frontmatter`: discovery reads its folder, and the vault's include and exclude patterns let it through and it isn't a draft, unless a publication date publishes it anyway, and it isn't private. A published note may still be password-protected. Page history judges a note's earlier versions with it, at the paths they had then.
f renderPreviewThe note's HTML, rendered from `markdown` (frontmatter and all) as the site would render its body. A URL naming one of `options.attachments`, by the build's rules, links to where the build publishes it: `<base><mount>/<vault path>`. Any other relative URL resolves from the note's page, as on the site.
f requestedSlugThe route a note asks for before `allocateRoutes` settles clashes: its frontmatter `slug`, else its filename's.
f resolveLinks
f roamFlavoredMarkdownAdd Roam prose syntax after the normal GFM parser.
f routeHref
f runsCodeWhether a browser would run `url` as a script or open it as an HTML document. Before it reads a URL's scheme, a browser drops the tabs and newlines anywhere in it and the spaces and control characters in front of it.
f safeAttributes`element`'s HTML attributes without event handlers, `srcdoc`, or script and HTML-document URLs.
f sharedAttachmentNamesFile names of published attachments that another attachment in the vault shares. The build resolves those by path only, so a resolver that sees only `publishedAttachments` needs them to resolve the same; their names are already public, and the other files' paths stay in the build.
f slideActionWhat a key does. Keys with Ctrl, Cmd, or Alt stay with the browser.
f transformDescription
f transformEmbeds
f transformGfmRegister GFM parsing only while this plugin is active.
f transformLatexRender public math with KaTeX and declare its stylesheet.
f transformOfm
f transformSyntaxAdd syntax highlighting for public notes with code.
f transformToccore:transform-toc — Table of Contents extraction.
f wikilinkResolverThe note a wikilink target names from anywhere in the vault, as `core:resolve-links` resolves it, or null. A target that `closest` would settle by the linking note's folder names no note here.

Variables

v ALLOCATE_ROUTES_ID
v ANALYTICS_ID
v CORE_PLUGIN_IDS@svartz/plugins — core pipeline plugins for the Svartz build system.
v DISCOVER_FILES_ID
v EMIT_ARTIFACTS_ID
v EMIT_DISCOVERY_ID
v EMIT_IMAGES_ID
v FILTER_UNPUBLISHED_ID
v INDEX_CONTENT_ID
v PARSE_FRONTMATTER_ID
v RESOLVE_LINKS_ID
v TRANSFORM_DESCRIPTION_ID
v TRANSFORM_EMBEDS_ID
v TRANSFORM_GFM_ID
v TRANSFORM_LATEX_ID
v TRANSFORM_OFM_ID
v TRANSFORM_SYNTAX_ID
v TRANSFORM_TOC_ID
v VOID_TAGS