Skip to content

Commit

Permalink
Refactor docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 18, 2024
1 parent cd117dc commit f459b64
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 31 deletions.
7 changes: 1 addition & 6 deletions docs/community/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const info = {
author: [
{github: 'wooorm', name: 'Titus Wormer', twitter: 'wooorm'}
],
modified: new Date('2021-11-01'),
modified: new Date('2024-10-18'),
published: new Date('2021-10-06')
}
export const navSortSelf = 4
Expand Down Expand Up @@ -82,11 +82,6 @@ this project!
The following projects, languages, and articles helped shape MDX either in
implementation or inspiration.

<Note type="info">
**Note**: Is your work missing?
Please open a PR if we failed to attribute your work.
</Note>

The [markdown][] and [JSX][] languages inspired MDX.
Markdown was [created by John Gruber][markdown] (**[@gruber][gruber]**).
[CommonMark][], the most popular markdown variant, by John McFarlane
Expand Down
23 changes: 14 additions & 9 deletions docs/docs/extending-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const info = {
author: [
{github: 'wooorm', name: 'Titus Wormer', twitter: 'wooorm'}
],
modified: new Date('2024-07-04'),
modified: new Date('2024-10-18'),
published: new Date('2021-10-06')
}
export const navSortSelf = 4
Expand All @@ -31,8 +31,8 @@ integrations:

* Options passed to the compiler (see [¶ API in `@mdx-js/mdx`][api])
* Plugins that hook into several stages of compilation (see [remark
plugins][remark-plugins], [rehype plugins][rehype-plugins], and the new
recma plugins)
plugins][remark-plugins], [rehype plugins][rehype-plugins], and
[recma plugins][recma-plugins])
* Components passed, defined, or imported at runtime (see [§ Using MDX][use])

Most of the time, these components and plugins are not coupled to MDX.
Expand Down Expand Up @@ -68,8 +68,9 @@ We’re compiling those here on this page.

### List of plugins

See also the [list of remark plugins][remark-plugins] and
[list of rehype plugins][rehype-plugins].
See also the [list of remark plugins][remark-plugins],
[list of rehype plugins][rehype-plugins], and
[list of recma plugins][recma-plugins].

* [`remcohaszing/recma-export-filepath`](https://github.com/remcohaszing/recma-export-filepath)
— export the filepath
Expand Down Expand Up @@ -116,8 +117,10 @@ See also the [list of remark plugins][remark-plugins] and

## Using plugins

Where to pass plugins is encoded in their name: remark plugins go in
`remarkPlugins` and rehype plugins go in `rehypePlugins` of
Where to pass plugins is encoded in their name:
remark plugins go in `remarkPlugins`,
rehype plugins go in `rehypePlugins`,
and recma plugins go in `recmaPlugins` of
[`ProcessorOptions`][processor-options].
Those fields expect lists of plugins and/or of `[plugin, options]`:

Expand Down Expand Up @@ -155,8 +158,8 @@ await compile(file, {

## Creating plugins

Creating a plugin for MDX is mostly the same as creating a plugin for remark
or rehype.
Creating a plugin for MDX is mostly the same as creating a plugin for remark,
rehype, or recma.
There are several guides and recipes on that in [§ Learn on
`unifiedjs.com`][learn].

Expand All @@ -166,6 +169,8 @@ For info on the node types that represent MDX specific features, see
[¶ Syntax tree in `remark-mdx`][syntax-tree] and use our interactive
[§ Playground][playground].

[recma-plugins]: https://github.com/mdx-js/recma/blob/main/doc/plugins.md#list-of-plugins

[remark-plugins]: https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins

[rehype-plugins]: https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins
Expand Down
7 changes: 3 additions & 4 deletions docs/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const info = {
author: [
{github: 'wooorm', name: 'Titus Wormer', twitter: 'wooorm'}
],
modified: new Date('2024-07-04'),
modified: new Date('2024-10-18'),
published: new Date('2021-10-05')
}
export const navSortSelf = 2
Expand Down Expand Up @@ -44,9 +44,8 @@ Note that we do compile JSX to JavaScript for you so you don’t have to set tha
up.

All `@mdx-js/*` packages are written in modern JavaScript.
A [Node.js][node-js] version of 16.0 or later is needed to use them.
Our packages are also [ESM only][github-gist-esm],
so they have to be `import`ed instead of `require`d.
A [Node.js][node-js] version of 16 or later is needed to use them.
Our packages are also [ESM only][github-gist-esm].

<Note type="info">
**Note**: Using Rust instead of Node.js?
Expand Down
11 changes: 2 additions & 9 deletions docs/docs/using-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const info = {
author: [
{github: 'wooorm', name: 'Titus Wormer', twitter: 'wooorm'}
],
modified: new Date('2024-07-04'),
modified: new Date('2024-10-18'),
published: new Date('2021-09-30')
}
export const navSortSelf = 3
Expand Down Expand Up @@ -390,14 +390,7 @@ That’s because `a` is the HTML equivalent for the markdown syntax being used.
The second link (`#bravo`) remains unchanged,
because in JSX syntax `a` is a literal tag name.
The third link (`#charlie`) is dashed and tomato,
as in JSX syntax `Link` is a reference.
<Note type="info">
**Note**:
Users of the MDX VS Code extension can add type
checking of provided and passed components with a JSDoc comment.
See [`mdx-js/mdx-analyzer`][mdx-analyzer] for more info.
</Note>
because in JSX syntax `Link` is a reference.
### Layout
Expand Down
6 changes: 3 additions & 3 deletions docs/table-of-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const info = {
{github: 'johno', name: 'John Otander', twitter: '4lpine'},
{github: 'wooorm', name: 'Titus Wormer', twitter: 'wooorm'}
],
modified: new Date('2021-11-01'),
modified: new Date('2024-10-18'),
published: new Date('2020-03-11')
}
export const navSortSelf = 4
Expand Down Expand Up @@ -105,7 +105,7 @@ More information on how to use markdown can be found in [CommonMark][].
````mdx chrome=no
Some `backticks` for inline.

```tsx
```javascript
backtick.fences('for blocks')
```
````
Expand Down Expand Up @@ -357,7 +357,7 @@ More information on how to use markdown can be found in [CommonMark][].

<td>
````mdx chrome=no
```tsx
```javascript
backtick.fences('for blocks')
```
````
Expand Down

0 comments on commit f459b64

Please sign in to comment.