Skip to content
Permalink
main
Switch branches/tags
Go to file
18 contributors

Users who have contributed to this file

@wooorm @tani @luk707 @JamesMessinger @davidtheclark @rsclarke @mrzmmr @michaelnisi @marko-knoebl @marekweb @jaywcjlove @kmck

rehype

Plugins

rehype is an HTML processor powered by plugins part of the unified collective.

Contents

List of plugins

See awesome rehype for the most awesome projects in the ecosystem. More plugins can be found on GitHub tagged with the rehype-plugin topic.

Have a good idea for a new plugin? See Create plugins below.

List of utilities

See hast for a list of utilities for working with the syntax tree. See unist for other utilities which work with hast nodes, too. Finally, see vfile for a list of utilities working with virtual files.

Use plugins

To use a plugin programmatically, invoke the use() function.

To use plugin with rehype-cli, pass a --use flag or specify it in a configuration file.

Create plugins

Have an idea for a plugin? Post it on ideas and make it happen!

To create a plugin, first read up on the concept of plugins. Then, read the guide on “Creating a plugin with unified”. Finally, take one of existing plugins, which looks similar to what you’re about to make, and work from there. If you get stuck, ideas, issues, and discussions are good places to get help.

You should pick a name prefixed by 'rehype-', such as rehype-lint.

Do not use the rehype- prefix if the thing you create doesn’t work with rehype().use(): it isn’t a “plugin” and will confuse users. If it works with hast, use 'hast-util-', if it works with any unist tree, use unist-util-, and if it works with virtual files, use vfile-.