Markdown Component

Markdown components 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
  • raster to process and transform Raster Image
  • image to pass a svg or 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 function Svg({}) { // body }
  • Good
javascript
export default function Svg({}) { // body }