Skip to content

toddw/esbuild-markdoc-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esbuild-markdoc-plugin

esbuild plugin for markdown files using Markdoc.

How to use the plugin

The goal of this plugin is to convert .md files into the content object expected by Markdoc render functions.

  1. Add to your esbuild plugins array.
import markdocPlugin from "esbuild-markdoc-plugin";

config = {
  ...,
  plugins: [
    markdocPlugin(),
  ],
  ...,
}
  1. 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);

Custom Config

You can pass a custom config object to markdocPlugin(config).

Contributing

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.

About

esbuild plugin for markdown files using markdoc

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published