Skip to content

Commit bc1d9e5

Browse files
committed
Refactor more docs
1 parent 0d1558a commit bc1d9e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2301
-2246
lines changed

docs/_asset/editor.jsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ const grammars = [
9393
/** @type {Awaited<ReturnType<typeof createStarryNight>>} */
9494
let starryNight
9595

96-
const body = document.querySelector('.body')
96+
const editor = document.querySelector('#js-editor')
9797

98-
if (body && window.location.pathname === '/playground/') {
98+
if (window.location.pathname === '/playground/' && editor) {
9999
const root = document.createElement('div')
100100
root.classList.add('playground')
101-
body.after(root)
101+
editor.after(root)
102102
init(root)
103103
}
104104

@@ -204,7 +204,10 @@ function Playground() {
204204

205205
if (show === 'result') {
206206
/** @type {MDXModule} */
207-
const mod = await run(String(file), runtime)
207+
const mod = await run(String(file), {
208+
...runtime,
209+
baseUrl: window.location.href
210+
})
208211

209212
return (
210213
<ErrorBoundary FallbackComponent={ErrorFallback}>

docs/_asset/index.css

+10-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ hr {
331331
table {
332332
border-collapse: collapse;
333333
border-spacing: 0;
334-
display: block;
335334
overflow: auto;
336335
width: 100%;
337336
font-variant-numeric: lining-nums;
@@ -539,6 +538,16 @@ button.success {
539538
);
540539
}
541540

541+
.full-bleed {
542+
width: 100vw;
543+
position: relative;
544+
left: 50%;
545+
right: 50%;
546+
margin-left: -50vw;
547+
margin-right: -50vw;
548+
padding-inline: calc(1em + 1ex);
549+
}
550+
542551
/* Note that the `backdrop-filter` itself is applied in light mode. */
543552
@supports (backdrop-filter: blur(1ex)) {
544553
.navigation::before {
@@ -1224,7 +1233,6 @@ details[open] {
12241233
grid-template-columns: 49% 49%;
12251234
min-height: 40rem;
12261235
gap: calc(1em + 1ex);
1227-
margin-inline: calc(1em + 1ex);
12281236
}
12291237

12301238
.playground-area,

docs/_config.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ export const redirect = {
3838
'/contributing/index.html': '/community/contribute/',
3939
'/editor-plugins/index.html': '/docs/getting-started/#editor',
4040
'/editors/index.html': '/docs/getting-started/#editor',
41-
'/getting-started/create-react-app/index.html':
42-
'/docs/getting-started/#create-react-app-cra',
41+
'/getting-started/create-react-app/index.html': '/docs/getting-started/#vite',
4342
'/getting-started/gatsby/index.html': '/docs/getting-started/#gatsby',
4443
'/getting-started/next/index.html': '/docs/getting-started/#nextjs',
4544
'/getting-started/parcel/index.html': '/docs/getting-started/#parcel',
46-
'/getting-started/react-static/index.html':
47-
'/docs/getting-started/#react-static',
45+
'/getting-started/react-static/index.html': '/docs/getting-started/#vite',
4846
'/getting-started/table-of-components/index.html': '/table-of-components/',
4947
'/getting-started/typescript/index.html': '/docs/getting-started/#types',
5048
'/getting-started/webpack/index.html': '/docs/getting-started/#webpack',

docs/blog/v1.mdx

+39-39
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ for implementing this feature.
7777
**Good libraries need great docs**, so we’ve been working on adding content and
7878
improving the overall documentation website experience.
7979

80-
* [Search (thanks Algolia)](https://mobile.twitter.com/4lpine/status/1114270174096412672)
81-
* [Guides](/guides/)
82-
* [Automatic deployment via ZEIT](https://zeit.co)
83-
* [Custom Gatsby theme](https://gatsbyjs.org)
84-
* Reorganization of docs for intuitiveness
85-
* Full page rewrites to improve clarity
80+
* [Search (thanks Algolia)](https://mobile.twitter.com/4lpine/status/1114270174096412672)
81+
* [Guides](/guides/)
82+
* [Automatic deployment via ZEIT](https://zeit.co)
83+
* [Custom Gatsby theme](https://gatsbyjs.org)
84+
* Reorganization of docs for intuitiveness
85+
* Full page rewrites to improve clarity
8686

8787
Special thanks to [@jxnblk](https://github.com/jxnblks) and
8888
[@wooorm](https://github.com/wooorm) for their help improving the docs and
@@ -97,12 +97,12 @@ The community has evolved and we’ve come up with newer, better ideas over the
9797
last year.
9898
We have made sure the impact is small and have written a full migration guide.
9999

100-
* 🚨`@mdx-js/tag` is replaced by `@mdx-js/react` and an `@mdx` pragma
101-
[migration guide](/migrating/v1#pragma)
102-
* MDXProvider now merges component contexts when nested
103-
[migration guide](/migrating/v1#mdxprovider)
104-
* React support now requires `>= 16.8` in `@mdx-js/react`
105-
[migration guide](/migrating/v1#react)
100+
* 🚨`@mdx-js/tag` is replaced by `@mdx-js/react` and an `@mdx` pragma
101+
[migration guide](/migrating/v1#pragma)
102+
* MDXProvider now merges component contexts when nested
103+
[migration guide](/migrating/v1#mdxprovider)
104+
* React support now requires `>= 16.8` in `@mdx-js/react`
105+
[migration guide](/migrating/v1#react)
106106

107107
[Read the full v1 migration guide](/migrating/v1)
108108

@@ -123,11 +123,11 @@ We’ve also seen projects/products/application we never even imagined.
123123

124124
### Numbers
125125

126-
* **Downloads**: 125,000/week, 2.4M total
127-
* **Stars**: 6,200
128-
* **Contributors**: 50
129-
* **Pull requests**: 281
130-
* **Commits**: 670
126+
* **Downloads**: 125,000/week, 2.4M total
127+
* **Stars**: 6,200
128+
* **Contributors**: 50
129+
* **Pull requests**: 281
130+
* **Commits**: 670
131131

132132
The contributor growth is one of the most important aspects here as we have
133133
numerous community members that are familiar with MDX internals.
@@ -138,30 +138,30 @@ against an ever growing team of contributors.
138138

139139
### Ecosystem
140140

141-
* [Prettier](https://prettier.io)
142-
* [Docz](https://docz.site)
143-
* [MDX Deck](https://github.com/jxnblk/mdx-deck)
144-
* [Next.js](https://nextjs.org)
145-
* [Gatsby](https://gatsbyjs.org)
146-
* [AST Explorer](https://astexplorer.net)
147-
* [Vue support (alpha)](/docs/getting-started/#vue)
148-
* [Demoboard](https://frontarm.com/demoboard/)
149-
* [Editors](/docs/getting-started/#editor)
141+
* [Prettier](https://prettier.io)
142+
* [Docz](https://docz.site)
143+
* [MDX Deck](https://github.com/jxnblk/mdx-deck)
144+
* [Next.js](https://nextjs.org)
145+
* [Gatsby](https://gatsbyjs.org)
146+
* [AST Explorer](https://astexplorer.net)
147+
* [Vue support (alpha)](/docs/getting-started/#vue)
148+
* [Demoboard](https://frontarm.com/demoboard/)
149+
* [Editors](/docs/getting-started/#editor)
150150

151151
## 🛣 Roadmap
152152

153153
With v1 released we have a roadmap in place that we’ll continue working towards
154154
over the next 6 months or so in addition to bug fixes and parsing issues we
155155
might encounter.
156156

157-
* MDXs: [#454](https://github.com/mdx-js/mdx/issues/454)
158-
* Interleaving: [#195](https://github.com/mdx-js/mdx/issues/195)
159-
* Global shortcodes: [#508](https://github.com/mdx-js/mdx/pull/508)
160-
* Stable Vue support: [#238](https://github.com/mdx-js/mdx/issues/238)
161-
* Blocks: MDX WYSIWYG: [blocks/blocks](https://github.com/blocks/blocks)
162-
* MDX playground inspired by AST Explorer: [#220](https://github.com/mdx-js/mdx/issues/220)
163-
* New splash page: [#444](https://github.com/mdx-js/mdx/issues/444)
164-
* Showcase page: [#414](https://github.com/mdx-js/mdx/issues/414)
157+
* MDXs: [#454](https://github.com/mdx-js/mdx/issues/454)
158+
* Interleaving: [#195](https://github.com/mdx-js/mdx/issues/195)
159+
* Global shortcodes: [#508](https://github.com/mdx-js/mdx/pull/508)
160+
* Stable Vue support: [#238](https://github.com/mdx-js/mdx/issues/238)
161+
* Blocks: MDX WYSIWYG: [blocks/blocks](https://github.com/blocks/blocks)
162+
* MDX playground inspired by AST Explorer: [#220](https://github.com/mdx-js/mdx/issues/220)
163+
* New splash page: [#444](https://github.com/mdx-js/mdx/issues/444)
164+
* Showcase page: [#414](https://github.com/mdx-js/mdx/issues/414)
165165

166166
### Vue support
167167

@@ -196,11 +196,11 @@ dealing with many sources of content.
196196
unified projects are used all over the web, and it would never be possible
197197
without financial support from our fine sponsors.
198198

199-
* [ZEIT](https://zeit.co) 🥇
200-
* [Gatsby](https://gatsbyjs.org) 🥇
201-
* [Holloway](https://www.holloway.com) 🥉
202-
* [Backers](https://opencollective.com/unified#budget) 🏆
203-
* [You?](https://opencollective.com/unified)👤
199+
* [ZEIT](https://zeit.co) 🥇
200+
* [Gatsby](https://gatsbyjs.org) 🥇
201+
* [Holloway](https://www.holloway.com) 🥉
202+
* [Backers](https://opencollective.com/unified#budget) 🏆
203+
* [You?](https://opencollective.com/unified)👤
204204

205205
## 🙏 Thanks
206206

docs/blog/v2.mdx

+18-18
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ Here are the highlights:
2121
{/* more */}
2222

2323
<div className="emoji-list">
24-
* 📝 **Improved syntax** makes it easier to use markdown in JSX
25-
* 🧑‍💻 **JavaScript expressions** turn `{2 * Math.PI}` into {2 * Math.PI}
26-
* 🔌 New **esbuild**, **Rollup**, and **Node.js** integrations
27-
* ⚛️ **Any JSX runtime**: React, Preact, Vue, Emotion, you name it, they’re
28-
all supported
29-
* 🌳 **Improved AST** exposes more info in greater detail
30-
* 🏃‍♀️ Compiles at least **25% faster**
31-
* 🚴 Generated code runs twice as fast (**100% faster**)
32-
* 🚄 Bundle size of `@mdx-js/mdx` is more than three times as small
33-
(**250% smaller**)
34-
* 🧵 …and much, so much more
24+
* 📝 **Improved syntax** makes it easier to use markdown in JSX
25+
* 🧑‍💻 **JavaScript expressions** turn `{2 * Math.PI}` into {2 * Math.PI}
26+
* 🔌 New **esbuild**, **Rollup**, and **Node.js** integrations
27+
* ⚛️ **Any JSX runtime**: React, Preact, Vue, Emotion, you name it, they’re
28+
all supported
29+
* 🌳 **Improved AST** exposes more info in greater detail
30+
* 🏃‍♀️ Compiles at least **25% faster**
31+
* 🚴 Generated code runs twice as fast (**100% faster**)
32+
* 🚄 Bundle size of `@mdx-js/mdx` is more than three times as small
33+
(**250% smaller**)
34+
* 🧵 …and much, so much more
3535
</div>
3636

3737
It’s been 4 years since this project was announced.
@@ -41,13 +41,13 @@ Let’s dive in!
4141

4242
## Contents
4343

44-
* [Improvements to the MDX format](#improvements-to-the-mdx-format)
45-
* [Rollup, esbuild, and other integrations](#rollup-esbuild-and-other-integrations)
46-
* [Architectural improvements](#architectural-improvements)
47-
* [TypeScript](#typescript)
48-
* [Docs & site](#docs--site)
49-
* [Breaking changes](#breaking-changes)
50-
* [Thanks](#thanks)
44+
* [Improvements to the MDX format](#improvements-to-the-mdx-format)
45+
* [Rollup, esbuild, and other integrations](#rollup-esbuild-and-other-integrations)
46+
* [Architectural improvements](#architectural-improvements)
47+
* [TypeScript](#typescript)
48+
* [Docs & site](#docs--site)
49+
* [Breaking changes](#breaking-changes)
50+
* [Thanks](#thanks)
5151

5252
## Improvements to the MDX format
5353

docs/community/about.mdx

+23-23
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,28 @@ MDX solves this.
2929
There are many languages objectively better than markdown, however, markdown is
3030
great because:
3131

32-
* It looks like what it means and is relatively easy to read
33-
* Although images are [confusing][], most stuff is relatively simple to write
34-
* It’s loose and ambiguous: it may not work but you won’t get an error (great
35-
for someone posting a comment to a forum if they forgot an asterisk)
32+
* It looks like what it means and is relatively easy to read
33+
* Although images are [confusing][], most stuff is relatively simple to write
34+
* It’s loose and ambiguous: it may not work but you won’t get an error (great
35+
for someone posting a comment to a forum if they forgot an asterisk)
3636

3737
Markdown *does* have a way to extend it, HTML, but that has drawbacks:
3838

39-
* HTML in markdown is naïve, how it’s parsed sometimes doesn’t make sense
40-
* HTML is unsafe by default, so it’s sometimes (partially) unsupported
41-
* HTML and markdown don’t mix well, resulting in confusing rules such as
42-
blank lines or `markdown="1"` attributes
43-
* HTML is coupled with browsers, markdown is useful for other things too
39+
* HTML in markdown is naïve, how it’s parsed sometimes doesn’t make sense
40+
* HTML is unsafe by default, so it’s sometimes (partially) unsupported
41+
* HTML and markdown don’t mix well, resulting in confusing rules such as
42+
blank lines or `markdown="1"` attributes
43+
* HTML is coupled with browsers, markdown is useful for other things too
4444

4545
The frontend world has an alternative to HTML: JSX.
4646
JSX is great, amongst other things, because:
4747

48-
* It has a relatively familiar syntax (like XML)
49-
* It’s agnostic to semantics and intended for compilers (can have any
50-
domain-specific meaning)
51-
* It’s strict and unambiguous (great if an author forgot a slash somewhere, as
52-
they’ll get an error early, instead of a book going to print with broken
53-
stuff in it)
48+
* It has a relatively familiar syntax (like XML)
49+
* It’s agnostic to semantics and intended for compilers (can have any
50+
domain-specific meaning)
51+
* It’s strict and unambiguous (great if an author forgot a slash somewhere, as
52+
they’ll get an error early, instead of a book going to print with broken
53+
stuff in it)
5454

5555
## Who governs MDX?
5656

@@ -104,17 +104,17 @@ The following projects inspired `@mdx-js/*` originally:
104104

105105
{/* Note: please keep the original project names intact: */}
106106

107-
* [`jamesknelson/mdxc`](https://github.com/frontarm/mdx-util)
108-
* [`ticky/markdown-component-loader`](https://github.com/ticky/markdown-component-loader)
109-
* [`threepointone/markdown-in-js`](https://github.com/threepointone/markdown-in-js)
110-
* [`fazouane-marouane/remark-jsx`](https://github.com/remarkjs/remark-jsx)
111-
* [`mapbox/remark-react`](https://github.com/remarkjs/remark-react)
112-
* [`rx-ts/eslint-mdx`](https://github.com/mdx-js/eslint-mdx)
107+
* [`jamesknelson/mdxc`](https://github.com/frontarm/mdx-util)
108+
* [`ticky/markdown-component-loader`](https://github.com/ticky/markdown-component-loader)
109+
* [`threepointone/markdown-in-js`](https://github.com/threepointone/markdown-in-js)
110+
* [`fazouane-marouane/remark-jsx`](https://github.com/remarkjs/remark-jsx)
111+
* [`mapbox/remark-react`](https://github.com/remarkjs/remark-react)
112+
* [`rx-ts/eslint-mdx`](https://github.com/mdx-js/eslint-mdx)
113113

114114
The following articles inspired `@mdx-js/*` originally:
115115

116-
* [IA Markdown Content Blocks](https://github.com/iainc/Markdown-Content-Blocks)
117-
* [Idyll: Markup language for interactive documents](https://idyll-lang.org)
116+
* [IA Markdown Content Blocks](https://github.com/iainc/Markdown-Content-Blocks)
117+
* [Idyll: Markup language for interactive documents](https://idyll-lang.org)
118118

119119
[what]: /docs/what-is-mdx/
120120

0 commit comments

Comments
 (0)