Add MarkDoc Support to your StudioCMS project with ease!
npm install @studiocms/markdoc
Add MarkDoc support to StudioCMS
Add this plugin in your StudioCMS config. (studiocms.config.mjs)
``ts
import { defineStudioCMSConfig } from 'studiocms/config';
import markdocPlugin from '@studiocms/markdoc';
export default defineStudioCMSConfig({
// other options here
plugins: [markdocPlugin()]
});
`
| 'react-static' | MarkDocRenderer
Default: 'html'Set the type of MarkDoc rendering that you would like to do.
$3
Type: ParserArgs | undefinedOptional Parser args for MarkDoc
$3
Type: ConfigType | undefinedOptional Transform config for MarkDoc
#### MarkDocRenderer
Type:
{ name: string; render: (content: import('@markdoc/markdoc').RenderableTreeNode) => PromiseExample Renderer
`ts
import type { RenderableTreeNode } from '@markdoc/markdoc';
import type { MarkDocRenderer } from '@studiocms/markdoc/types';export const renderHTML: MarkDocRenderer = {
name: 'html',
render: async (content: RenderableTreeNode) => {
return Markdoc.renderers.html(content);
},
};
``