Markdown Component

Markdown component are components that can be used:

How to

Create your own Markdown component

See How to add a Markdown component

Override the default with your own component

You can override the default html to bring your own by defining them in the components section of the configuration file.

Example on how to change the pre component (for code block syntax highlighting)

json
{ "components": { "pre": { "importPath": "src/component/MyCodeComponent.js", "type": "markdown" } } }

Syntax

All default syntax with gfm is supported

You can also use:

  • svg to embed and optimize SVG files
  • icon to embed and optimize SVG files as icon
  • image to process and transform Raster Image

Support

Expected component xxx to be defined

If you get this error:

txt
Error: Expected component `xxx` to be defined: you likely forgot to import, pass, or provide it.

The possible causes are:

  • the component is not registered
  • the component is not exported as default:

Example:

  • Bad
javascript
export async function Svg({}) { // body }
  • Good
javascript
export default async function Svg({}) { // body }