esbuild plugin for markdown files using Markdoc.
The goal of this plugin is to convert .md files into the content object expected by Markdoc render functions.
- Add to your esbuild plugins array.
import markdocPlugin from "esbuild-markdoc-plugin";
config = {
...,
plugins: [
markdocPlugin(),
],
...,
}
- All files with
.md
extention will be parsed with Markdoc, and transformed into the content json object for Markdoc renderers.
import Markdoc from '@markdoc/markdoc';
import content from './my-markdown.md';
const html = Markdoc.renderers.html(content);
You can pass a custom config object to markdocPlugin(config)
.
I wanted this for my own project so I built this plugin. I figured other people might want to use it as well so here it is.
Please file issues or open PRs and I will try to address them quickly.