parcel-transformer-markdoc
v1.0.0
Published
Parcel transformer to load Markdown files when using Markdoc
Downloads
4
Maintainers
Readme
A Parcel 2 transformer for Markdoc.
Installation
Start by installing the package:
npm install parcel-transformer-markdoc --save-dev
Then, in the .parcelrc
file, add the transformer like this:
{
"extends": ["@parcel/config-default"],
"transformers": {
"*.md": ["parcel-transformer-markdoc"]
}
}
Example use
When using React.js with Parcel:
import text from "./hello.md";
import Markdoc from "@markdoc/markdoc";
import React from "react";
export function App() {
const content = Markdoc.renderers.react(text, React);
return <main>{content}</main>;
}
License
MIT License