Skip to content

Commit

Permalink
Refactor some more
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 18, 2023
1 parent d83aa3e commit 8ada93c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ This example uses the utility [`vfile-matter`][vfile-matter], which is specific
to YAML.
To support other data languages, look at this utility for inspiration.
`my-unified-plugin-handling-yaml-matter.js`:
```js
/**
* @typedef {import('unist').Node} Node
Expand Down Expand Up @@ -372,11 +374,11 @@ key: value
…and using the plugin with an `example.js` containing:

```js
import {read} from 'to-vfile'
import {unified} from 'unified'
import remarkParse from 'remark-parse'
import remarkFrontmatter from 'remark-frontmatter'
import remarkStringify from 'remark-stringify'
import {read} from 'to-vfile'
import {unified} from 'unified'
import myUnifiedPluginHandlingYamlMatter from './my-unified-plugin-handling-yaml-matter.js'

const file = await unified()
Expand Down Expand Up @@ -471,10 +473,11 @@ To add other node types, register them by adding them to
`FrontmatterContentMap`:

```ts
import type {Literal} from 'mdast'
import type {Data, Literal} from 'mdast'

interface Toml extends Literal {
type: 'toml'
data?: TomlData
}

declare module 'mdast' {
Expand Down

0 comments on commit 8ada93c

Please # to comment.