Render plugins
Render plugins turn HAST nodes into slots, choosing which component handles the content. Slot plugins provide the appearance and interactions.
Declare and use a plugin
This example sends paragraphs starting with “Note:” to the blockquote slot, leaving other paragraphs unchanged:
Use it in a single-file component:
Import the base class, parameter types and
createTypeOfSlotfrom@fluxdown/vue-plugins/base. Install@fluxdown/vue-pluginsfirst.
match selects nodes, and renderChildren renders their children. current, parents and render preserve the slot's context. This example uses Vue's h; a project configured for Vue JSX can return JSX instead.
Matching order
A lower priority matches earlier. At the same priority, later render plugins match first, so custom plugins take precedence over presets. Other nodes continue through the preset renderers.
Use Slot plugins when you only need to change a component or interaction. Use Rehype plugins to transform HAST first.