docs: wrap more JSX in mdx-code-block (#7568)

This commit is contained in:
Joshua Chen 2022-06-05 15:41:06 +08:00 committed by GitHub
parent 6d481f6a29
commit c03def7d5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 1 deletions

View file

@ -404,8 +404,10 @@ You can express typical sidebar items without much customization more concisely
An item with type `doc` can be simply a string representing its ID:
```mdx-code-block
<Tabs>
<TabItem value="Longhand">
```
```js title="sidebars.js"
module.exports = {
@ -420,8 +422,10 @@ module.exports = {
};
```
```mdx-code-block
</TabItem>
<TabItem value="Shorthand">
```
```js title="sidebars.js"
module.exports = {
@ -433,8 +437,10 @@ module.exports = {
};
```
```mdx-code-block
</TabItem>
</Tabs>
```
So it's possible to simplify the example above to:
@ -472,8 +478,10 @@ module.exports = {
A category item can be represented by an object whose key is its label, and the value is an array of subitems.
```mdx-code-block
<Tabs>
<TabItem value="Longhand">
```
```js title="sidebars.js"
module.exports = {
@ -489,8 +497,10 @@ module.exports = {
};
```
```mdx-code-block
</TabItem>
<TabItem value="Shorthand">
```
```js title="sidebars.js"
module.exports = {
@ -504,8 +514,10 @@ module.exports = {
};
```
```mdx-code-block
</TabItem>
</Tabs>
```
This permits us to simplify that example to:
@ -553,8 +565,10 @@ Note how the two consecutive category shorthands are compressed into one object
Wherever you have an array of items that is reduced to one category shorthand, you can omit that enclosing array as well.
```mdx-code-block
<Tabs>
<TabItem value="Before">
```
```js title="sidebars.js"
module.exports = {
@ -572,8 +586,10 @@ module.exports = {
};
```
```mdx-code-block
</TabItem>
<TabItem value="After">
```
```js title="sidebars.js"
module.exports = {
@ -587,5 +603,7 @@ module.exports = {
};
```
```mdx-code-block
</TabItem>
</Tabs>
```

View file

@ -102,8 +102,10 @@ When tagging a new version, the document versioning mechanism will:
1. Place the new file into the corresponding version folder.
2. Include the reference to the new file in the corresponding sidebar file according to the version number.
```mdx-code-block
<Tabs>
<TabItem value="Current version structure">
```
```bash
# The new file.
@ -113,8 +115,10 @@ docs/new.md
sidebars.js
```
```mdx-code-block
</TabItem>
<TabItem value="Older version structure">
```
```bash
# The new file.
@ -124,8 +128,10 @@ versioned_docs/version-1.0.0/new.md
versioned_sidebars/version-1.0.0-sidebars.json
```
```mdx-code-block
</TabItem>
</Tabs>
```
### Updating an existing version {#updating-an-existing-version}