Render plugins
Render plugins convert HAST nodes into Angular rendering descriptions and choose which slot handles each node. Slot plugins provide the styling and interactions.
Declare and use
This example sends paragraphs starting with “Note:” to the blockquote slot, leaving other paragraphs unchanged:
Import the base class,
createTypeOfSlot, and HAST helpers from@fluxdown/angular-plugins/base. Import parameter types from@fluxdown/angular-plugins/typings. Install@fluxdown/angular-pluginsfirst.
match selects nodes and renderChildren handles their children. current, parents, and render preserve the slot's context. A function created by createTypeOfSlot accepts props and returns a slot description; pass child content through children.
Render content
A render plugin can also return strings, arrays, or empty values. These helpers describe other content:
Import all three helpers from
@fluxdown/angular-plugins/base, and theAngularRenderNodereturn type from@fluxdown/angular-plugins/typings.
Components receive projected children through ng-content. Templates retain Angular's let- variables and dependency injection. A stable key lets movable sibling descriptions preserve component or template state.
Matching order
Lower priority values match first. With equal priority, later render plugins match first, so custom plugins override presets. Unmatched nodes continue through the preset.
Use slot plugins when only a component or interaction needs to change. Use rehype plugins to transform HAST first.