Render plugins
Render plugins turn HAST nodes into Svelte render descriptions and select the slots used for each node. Slot plugins provide their appearance and interactions.
Declare and use
This example renders paragraphs beginning with “Note:” through the blockquote slot, leaving other paragraphs unchanged:
Import the base, parameter types,
createElementandcreateTypeOfSlotfrom@fluxdown/svelte-plugins/base. Install@fluxdown/svelte-pluginsfirst.
match selects a node, and renderChildren processes its children. current, parents and render preserve the context needed by slots.
createElement(component, props, ...children) creates a render description. It accepts an ordinary Svelte component, a tag name or a slot from createTypeOfSlot. Fluxdown renders these descriptions through Svelte; components receive nested content through a children snippet.
Matching order
Lower priority values match earlier. At equal priority, later render plugins match first, so custom plugins take precedence over the preset. Unmatched nodes continue through the preset.
Use slot plugins when you only need to change a component or its interactions. Use rehype plugins to transform HAST first.