Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including parcel-plugin-mdx-with-toc with all npm packages installed. Try it out:

var parcelPluginMdxWithToc = require("parcel-plugin-mdx-with-toc")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

parcel-plugin-mdx-with-toc v1.0.1

An experimental Parcel v1 plugin for MDX that also exports Table of Contents

parcel-plugin-mdx-with-toc

An experimental Parcel v1 plugin for MDX that also exports Table of Contents using markdown-toc and github-slugger to generate anchor names for headings.

Note: This plugin is based on the official parcel-plugin-mdx and modified to also export the Table of Contents. If you don't need a Table of Contents, you are better off using the official parcel-plugin-mdx.

Installation

npm:

npm i -D parcel-plugin-mdx-with-toc

Or with Yarn:

yarn add -D parcel-plugin-mdx-with-toc

Usage

// index.js
import MDXContent, {Toc} from './content.mdx';
...

render(<><Toc /><MDXContent /></>, root);

License

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free