Rocket Logo Rocket Docs Themes Tools Blog

Markdown

Markdown automatically gets converted to JavaScript files which means you can use JavaScript template literals within markdown.

```js server
const age = 42;
```

I am ${age} years old

will result in

I am 42 years old

Adding Remark/Unified Plugins

If you want to add a plugin to the Markdown processing you can use setupUnifiedPlugins.

```js server
import { addPlugin } from 'plugins-manager';
import markdown from 'remark-parse';
import emoji from 'remark-emoji';

export const setupUnifiedPlugins = [addPlugin(emoji, {}, { location: markdown })];
```

See a :dog:

will result in

<p>See a 🐶</p>

For plugins that should handle the Markdown AST you should use addPlugin(emoji, {}, { location: markdown }).
While for the rehype AST you should use addPlugin(emoji, {}, { location: remark2rehype }.