remark-simple-slug
v1.0.1
Published
Simple remark plugin for generating slugified ids for headings in Markdown.
Maintainers
Readme
remark-simple-slug
This is a simple remark plugin that automatically creates slug ids for headings inside Markdown AST.
- It's a direct fork of @astrojs/markdown-remark/remark-slug.
Why?
- I needed heading slugified ids in the Markdown AST for my Table of Contents plugin to work.
- You might oppose, I could have simply created the slugs inside the mentioned plugin but since the plugin was primarily intended for use with Astro (even though it it's not required for it to work) I needed their precise recipe for the slugs (and I liked them). Therefore, I had to redistribute that code as this package.
Intended use
- You can just use this plugin on its own and it will add slugified ids to all your headings in the Markdown AST.
- Or you can explore the inteded use:
- This plugin is run, it generates slugified ids. Then the ToC plugin is run and takes theses ids, creates a ToC and links to all headings through these ids.
License
All credit goes to Astro maintainers.
