mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-28 08:27:03 +02:00
docs: visit is a named export of unist-util-visit (#10039)
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
ba6c59bbcb
commit
721f14537d
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ The writeup below is **not** meant to be a comprehensive guide to creating a plu
|
|||
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate npm package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` that operates on the AST.
|
||||
|
||||
```js "src/remark/section-prefix.js"
|
||||
import visit from 'unist-util-visit';
|
||||
import {visit} from 'unist-util-visit';
|
||||
|
||||
const plugin = (options) => {
|
||||
const transformer = async (ast) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue