/parcel-transformer-markdoc

📦 Parcel transformer for Markdown files using Markdoc

Primary LanguageJavaScriptMIT LicenseMIT

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