Skip to content

Commit 7ccdae7

Browse files
committed
Refactor some docs
1 parent 130778d commit 7ccdae7

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

readme.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Backers][backers-badge]][collective]
99
[![Chat][chat-badge]][chat]
1010

11-
Extensions to parse and serialize JSX between mdast and markdown.
11+
[mdast][] extensions to parse and serialize [MDX][] JSX.
1212

1313
## Contents
1414

@@ -31,8 +31,8 @@ Extensions to parse and serialize JSX between mdast and markdown.
3131

3232
## What is this?
3333

34-
This package contains extensions that add support for the JSX syntax enabled by
35-
MDX to [`mdast-util-from-markdown`][mdast-util-from-markdown] and
34+
This package contains extensions that add support for the JSX syntax enabled
35+
by MDX to [`mdast-util-from-markdown`][mdast-util-from-markdown] and
3636
[`mdast-util-to-markdown`][mdast-util-to-markdown].
3737

3838
[JSX][] is an XML-like syntax extension to ECMAScript (JavaScript), which MDX
@@ -62,14 +62,14 @@ npm install mdast-util-mdx-jsx
6262
In Deno with [`esm.sh`][esmsh]:
6363

6464
```js
65-
import {mdxJsxFromMarkdown, mdxJsxToMarkdown} from 'https://esm.sh/mdast-util-mdx-jsx@1'
65+
import {mdxJsxFromMarkdown, mdxJsxToMarkdown} from 'https://esm.sh/mdast-util-mdx-jsx@2'
6666
```
6767

6868
In browsers with [`esm.sh`][esmsh]:
6969

7070
```html
7171
<script type="module">
72-
import {mdxJsxFromMarkdown, mdxJsxToMarkdown} from 'https://esm.sh/mdast-util-mdx-jsx@1?bundle'
72+
import {mdxJsxFromMarkdown, mdxJsxToMarkdown} from 'https://esm.sh/mdast-util-mdx-jsx@2?bundle'
7373
</script>
7474
```
7575

@@ -205,7 +205,7 @@ console.log(out)
205205

206206
## API
207207

208-
This package exports the following identifiers: `mdxJsxFromMarkdown`,
208+
This package exports the identifiers `mdxJsxFromMarkdown` and
209209
`mdxJsxToMarkdown`.
210210
There is no default export.
211211

@@ -214,9 +214,8 @@ There is no default export.
214214
Function that can be called to get an extension for
215215
[`mdast-util-from-markdown`][mdast-util-from-markdown].
216216

217-
When using [`micromark-extension-mdx-jsx`][micromark-extension-mdx-jsx]
218-
with `options.addResult`, nodes will have a `data.estree` field set to an
219-
[ESTree][].
217+
When using the [syntax extension with `addResult`][micromark-extension-mdx-jsx],
218+
nodes will have a `data.estree` field set to an [ESTree][].
220219

221220
### `mdxJsxToMarkdown(options?)`
222221

@@ -247,7 +246,7 @@ of `<img />` (`boolean`, default: `false`).
247246

248247
###### `options.printWidth`
249248

250-
Try and wrap syntax as this width (`number`, default: `Infinity`).
249+
Try and wrap syntax at this width (`number`, default: `Infinity`).
251250
When set to a finite number (say, `80`), the formatter will print attributes on
252251
separate lines when a tag doesn’t fit on one line.
253252
The normal behavior is to print attributes with spaces between them instead of
@@ -386,18 +385,18 @@ type MdxJsxPhrasingContent = MdxJsxTextElement | PhrasingContent
386385
## Types
387386

388387
This package is fully typed with [TypeScript][].
389-
It exports the `MdxJsxAttributeValueExpression`, `MdxJsxAttribute`,
390-
`MdxJsxExpressionAttribute`, `MdxJsxFlowElement`, and `MdxJsxTextElement` types
391-
that represents the supported nodes.
392-
It also exports `ToMarkdownOptions`, which represents the structure of the
393-
respective options.
388+
It exports the additional types `MdxJsxAttributeValueExpression`,
389+
`MdxJsxAttribute`, `MdxJsxExpressionAttribute`, `MdxJsxFlowElement`,
390+
`MdxJsxTextElement`, and `ToMarkdownOptions`.
394391

395392
It also registers the node types with `@types/mdast`.
396393
If you’re working with the syntax tree, make sure to import this plugin
397394
somewhere in your types, as that registers the new node types in the tree.
398395

399396
```js
400-
/** @typedef {import('mdast-util-mdx-jsx')} */
397+
/**
398+
* @typedef {import('mdast-util-mdx-jsx')}
399+
*/
401400

402401
import {visit} from 'unist-util-visit'
403402

@@ -430,8 +429,8 @@ This plugin works with `mdast-util-from-markdown` version 1+ and
430429

431430
## Contribute
432431

433-
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
434-
started.
432+
See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
433+
ways to get started.
435434
See [`support.md`][support] for ways to get help.
436435

437436
This project has a [code of conduct][coc].
@@ -476,11 +475,13 @@ abide by its terms.
476475

477476
[author]: https://wooorm.com
478477

479-
[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md
478+
[health]: https://github.com/syntax-tree/.github
480479

481-
[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md
480+
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md
482481

483-
[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md
482+
[support]: https://github.com/syntax-tree/.github/blob/main/support.md
483+
484+
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
484485

485486
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
486487

@@ -504,8 +505,6 @@ abide by its terms.
504505

505506
[dfn-mixin-mdx-jsx-element]: #mdxjsxelement
506507

507-
[remark-mdx]: https://github.com/mdx-js/mdx/tree/main/packages/remark-mdx
508-
509508
[jsx]: https://facebook.github.io/jsx/
510509

511510
[what-is-mdx]: https://mdxjs.com/docs/what-is-mdx/
@@ -515,3 +514,7 @@ abide by its terms.
515514
[mdast-util-to-markdown-fences]: https://github.com/syntax-tree/mdast-util-to-markdown#optionsfences
516515

517516
[mdast-util-to-markdown-resourcelink]: https://github.com/syntax-tree/mdast-util-to-markdown#optionsresourcelink
517+
518+
[remark-mdx]: https://mdxjs.com/packages/remark-mdx/
519+
520+
[mdx]: https://mdxjs.com

0 commit comments

Comments
 (0)