Skip to content

Get started with Markdoc

Follow the instructions below to install Markdoc in your app. Or check out our integration guide to help you build a documentation site.

Install Markdoc

Install the Markdoc library:

npm install @markdoc/markdoc 

or

yarn add @markdoc/markdoc 

Import Markdoc

Import the Markdoc library in your app:

const Markdoc = require('@markdoc/markdoc'); 

If you're using ESM:

import Markdoc from '@markdoc/markdoc'; 

Use Markdoc

Call the parse, transform and render Markdoc functions to render your content.

const source = '# Markdoc'; const ast = Markdoc.parse(source); const content = Markdoc.transform(ast, /* [config](/docs/config) */); const html = Markdoc.renderers.html(content); 

Next steps