diff --git a/website/docs/api/plugins/plugin-content-blog.md b/website/docs/api/plugins/plugin-content-blog.md index 4952487a31bc..06d7bdca5b5f 100644 --- a/website/docs/api/plugins/plugin-content-blog.md +++ b/website/docs/api/plugins/plugin-content-blog.md @@ -5,6 +5,8 @@ title: '📦 plugin-content-blog' slug: '/api/plugins/@docusaurus/plugin-content-blog' --- +import APITable from '@site/src/components/APITable'; + Provides the [Blog](blog.mdx) feature and is the default blog plugin for Docusaurus. ## Installation {#installation} @@ -25,7 +27,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -62,7 +64,7 @@ Accepted fields: | `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. | | `sortPosts` | 'descending' \| 'ascending' | `'descending'` | Governs the direction of blog post sorting. | - + ```typescript type EditUrlFunction = (params: { @@ -193,7 +195,7 @@ Markdown documents can use the following Markdown FrontMatter metadata fields, e Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -214,7 +216,7 @@ Accepted fields: | `image` | `string` | `undefined` | Cover or thumbnail image that will be used when displaying the link to your post. | | `slug` | `string` | File path | Allows to customize the blog post url (`//`). Support multiple patterns: `slug: my-blog-post`, `slug: /my/path/to/blog/post`, slug: `/`. | - + ```typescript type Tag = string | {label: string; permalink: string}; diff --git a/website/docs/api/plugins/plugin-content-docs.md b/website/docs/api/plugins/plugin-content-docs.md index 8eb28ade59e3..7dd96d96f2bf 100644 --- a/website/docs/api/plugins/plugin-content-docs.md +++ b/website/docs/api/plugins/plugin-content-docs.md @@ -5,6 +5,8 @@ title: '📦 plugin-content-docs' slug: '/api/plugins/@docusaurus/plugin-content-docs' --- +import APITable from '@site/src/components/APITable'; + Provides the [Docs](../../guides/docs/docs-introduction.md) functionality and is the default docs plugin for Docusaurus. ## Installation {#installation} @@ -25,7 +27,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -58,7 +60,7 @@ Accepted fields: | `versions` | `Versions` | `{}` | Independent customization of each version's properties. | | `onlyIncludeVersions` | `string[]` | All versions available | Only include a subset of all available versions.
Tip: limit to 2 or 3 versions to improve startup and build time in dev and deploy previews. | -
+ ```typescript type EditUrlFunction = (params: { @@ -239,7 +241,7 @@ Markdown documents can use the following Markdown FrontMatter metadata fields, e Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -263,7 +265,7 @@ Accepted fields: | `slug` | `string` | File path | Allows to customize the document url (`//`). Support multiple patterns: `slug: my-doc`, `slug: /my/path/myDoc`, `slug: /`. | | `tags` | `Tag[]` | `undefined` | A list of strings or objects of two string fields `label` and `permalink` to tag to your docs. | - + ```typescript type Tag = string | {label: string; permalink: string}; diff --git a/website/docs/api/plugins/plugin-content-pages.md b/website/docs/api/plugins/plugin-content-pages.md index 2059121458c8..971ab7c92533 100644 --- a/website/docs/api/plugins/plugin-content-pages.md +++ b/website/docs/api/plugins/plugin-content-pages.md @@ -5,6 +5,8 @@ title: '📦 plugin-content-pages' slug: '/api/plugins/@docusaurus/plugin-content-pages' --- +import APITable from '@site/src/components/APITable'; + The default pages plugin for Docusaurus. The classic template ships with this plugin with default configurations. This plugin provides [creating pages](guides/creating-pages.md) functionality. ## Installation {#installation} @@ -25,7 +27,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -39,7 +41,7 @@ Accepted fields: | `beforeDefaultRemarkPlugins` | `any[]` | `[]` | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins. | | `beforeDefaultRehypePlugins` | `any[]` | `[]` | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins. | - + ## Example configuration {#ex-config} diff --git a/website/docs/api/themes/theme-configuration.md b/website/docs/api/themes/theme-configuration.md index d2884b5cfb37..efde10ef935b 100644 --- a/website/docs/api/themes/theme-configuration.md +++ b/website/docs/api/themes/theme-configuration.md @@ -6,6 +6,8 @@ slug: '/api/themes/configuration' toc_max_heading_level: 4 --- +import APITable from '@site/src/components/APITable'; + This configuration applies to all [main themes](./overview.md). ## Common {#common} @@ -18,7 +20,7 @@ It is possible to customize the color mode support within the `colorMode` object Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -31,7 +33,7 @@ Accepted fields: | `switchConfig.lightIcon` | `string` | `'🌞'` | Icon for the switch while in light mode. | | `switchConfig.lightIconStyle` | JSX style object | `{}` | CSS to apply to light icon. | - + Example configuration: @@ -75,13 +77,13 @@ You can configure a default image that will be used for your meta tag, in partic Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `image` | `string` | `undefined` | The meta image URL for the site. Relative to your site's "static" directory. Cannot be SVGs. Can be external URLs too. | - + Example configuration: @@ -100,13 +102,13 @@ You can configure additional html metadata (and override existing ones). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `metadata` | `Metadata[]` | `[]` | Any field will be directly passed to the `` tag. Possible fields include `id`, `name`, `property`, `content`, `itemprop`, etc. | - + Example configuration: @@ -125,7 +127,7 @@ Sometimes you want to announce something in your website. Just for such a case, Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -135,7 +137,7 @@ Accepted fields: | `textColor` | `string` | `'#000'` | Announcement text color. | | `isCloseable` | `boolean` | `true` | Whether this announcement can be dismissed with a '×' button. | - + Example configuration: @@ -160,7 +162,7 @@ module.exports = { Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -170,7 +172,7 @@ Accepted fields: | `hideOnScroll` | `boolean` | `false` | Whether the navbar is hidden when the user scrolls down. | | `style` | 'primary' \| 'dark' | Same as theme | Sets the navbar style, ignoring the dark/light theme. | - + ### Navbar logo {#navbar-logo} @@ -180,7 +182,7 @@ To improve dark mode support, you can also set a different logo for this mode. Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -192,7 +194,7 @@ Accepted fields: | `height` | string \| number | `undefined` | Specifies the `height` attribute. | | `target` | `string` | Calculated based on `href` (external links will open in a new tab, all others in the current one). | The `target` attribute of the link; controls whether the link is opened in a new tab, the current one, or otherwise. | - + Example configuration: @@ -267,7 +269,7 @@ Outbound (external) links automatically get `target="_blank" rel="noopener noref Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -281,7 +283,7 @@ Accepted fields: | `activeBaseRegex` | `string` | `undefined` | Alternative to `activeBasePath` if required. | | `className` | `string` | `''` | Custom CSS class (for styling any item). | - + :::note @@ -327,7 +329,7 @@ Note that the dropdown base item is a clickable link as well, so this item can r Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -336,7 +338,7 @@ Accepted fields: | `items` | [LinkLikeItem](#navbar-dropdown)[] | **Required** | The items to be contained in the dropdown. | | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | - + Example configuration: @@ -376,7 +378,7 @@ If you want to link to a specific doc, this special navbar item type will render Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -386,7 +388,7 @@ Accepted fields: | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc belongs to. | - + Example configuration: @@ -417,7 +419,7 @@ The user will be able to switch from one version to another, while staying on th Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -428,7 +430,7 @@ Accepted fields: | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc versioning belongs to. | | `dropdownActiveClassDisabled` | `boolean` | `false` | Do not add the link active class when browsing docs. | - + Example configuration: @@ -457,7 +459,7 @@ If you use docs with versioning, this special navbar item type will link to the Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -467,7 +469,7 @@ Accepted fields: | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc versioning belongs to. | - + Example configuration: @@ -498,7 +500,7 @@ The user will be able to switch from one locale to another, while staying on the Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -507,7 +509,7 @@ Accepted fields: | `dropdownItemsBefore` | [LinkLikeItem](#navbar-dropdown)[] | `[]` | Add additional dropdown items at the beginning of the dropdown. | | `dropdownItemsAfter` | [LinkLikeItem](#navbar-dropdown)[] | `[]` | Add additional dropdown items at the end of the dropdown. | - + Example configuration: @@ -540,14 +542,14 @@ If you use the [search](../../search.md), the search bar will be the rightmost e However, with this special navbar item type, you can change the default location. - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `type` | `'search'` | **Required** | Sets the type of this item to a search bar. | | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | - + ```js title="docusaurus.config.js" module.exports = { @@ -604,7 +606,7 @@ Docusaurus uses [Prism React Renderer](https://github.com/FormidableLabs/prism-r Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -612,7 +614,7 @@ Accepted fields: | `darkTheme` | `PrismTheme` | `palenight` | The Prism theme to use for dark-theme code blocks. | | `defaultLanguage` | `string` | `undefined` | The side of the navbar this item should appear on. | - + ### Theme {#theme} @@ -662,7 +664,7 @@ You can add logo and a copyright to the footer via `themeConfig.footer`. Logo ca Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -671,7 +673,7 @@ Accepted fields: | `style` | 'dark' \| 'light' | `'light'` | The color theme of the footer component. | | `items` | `FooterItem[]` | `[]` | The link groups to be present. | - + Example configuration: @@ -700,18 +702,18 @@ You can add links to the footer via `themeConfig.footer.links`. Accepted fields of each link section: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `title` | `string` | `undefined` | Label of the section of these links. | | `items` | `FooterLink[]` | `[]` | Links in this section. | - + Accepted fields of each item in `items`: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -720,7 +722,7 @@ Accepted fields of each item in `items`: | `href` | `string` | **Required** | A full-page navigation, used for navigating outside of the website. **Only one of `to` or `href` should be used.** | | `html` | `string` | `undefined` | Renders the html pass-through instead of a simple link. In case `html` is used, no other options should be provided. | - + Example configuration: @@ -776,14 +778,14 @@ module.exports = { You can adjust the default table of contents via `themeConfig.tableOfContents`. - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `minHeadingLevel` | `number` | `2` | The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value. | | `maxHeadingLevel` | `number` | `3` | Max heading level displayed in the TOC. Should be an integer between 2 and 6. | - + Example configuration: diff --git a/website/src/components/APITable/index.tsx b/website/src/components/APITable/index.tsx new file mode 100644 index 000000000000..81cf86731aea --- /dev/null +++ b/website/src/components/APITable/index.tsx @@ -0,0 +1,93 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React, { + Children, + ComponentProps, + ReactElement, + ReactNode, + isValidElement, + useRef, + useEffect, + forwardRef, +} from 'react'; +import {useHistory} from '@docusaurus/router'; +import styles from './styles.module.css'; + +interface Props { + readonly children: ReactElement>; + readonly name?: string; +} + +// ReactNode equivalent of HTMLElement#innerText +function getText(node: ReactElement): string { + let curNode: ReactNode = node; + while (isValidElement(curNode)) { + [curNode] = Children.toArray(curNode.props.children); + } + return curNode as string; +} + +const APITableRow = forwardRef( + ( + { + name, + children, + }: {name: string | undefined; children: ReactElement>}, + ref: React.RefObject, + ) => { + const entryName = getText(children); + const anchor = name ? `#${name}-${entryName}` : `#${entryName}`; + const history = useHistory(); + return ( + { + history.push(anchor); + }} + onKeyDown={(e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + history.push(anchor); + } + }}> + {children.props.children} + + ); + }, +); + +/* + * Note: this is not a quite robust component since it makes a lot of + * assumptions about how the children looks; however, those assumptions + * should be generally correct in the MDX context. + */ +export default function APITable({children, name}: Props): JSX.Element { + const [thead, tbody] = Children.toArray( + children.props.children, + ) as ReactElement[]; + const highlightedRow = useRef(null); + useEffect(() => { + highlightedRow.current?.focus(); + }, [highlightedRow]); + const rows = Children.map( + tbody.props.children, + (row: ReactElement>) => ( + + {row} + + ), + ); + + return ( + + {thead} + {rows} +
+ ); +} diff --git a/website/src/components/APITable/styles.module.css b/website/src/components/APITable/styles.module.css new file mode 100644 index 000000000000..1f85c6670549 --- /dev/null +++ b/website/src/components/APITable/styles.module.css @@ -0,0 +1,22 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +.apiTable { + font-size: small; +} + +.apiTable tbody tr { + transition: box-shadow 0.2s; +} + +.apiTable tbody tr:focus, +.apiTable tbody tr:hover { + outline: none; + box-shadow: 0px 0px 7px 0px inset var(--ifm-color-warning); + cursor: pointer; + transition: box-shadow 0.2s; +} diff --git a/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-blog.md b/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-blog.md index f769ab10b3f4..c54bd3164ca4 100644 --- a/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-blog.md +++ b/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-blog.md @@ -4,6 +4,8 @@ title: '📦 plugin-content-blog' slug: '/api/plugins/@docusaurus/plugin-content-blog' --- +import APITable from '@site/src/components/APITable'; + Provides the [Blog](blog.mdx) feature and is the default blog plugin for Docusaurus. ## Installation {#installation} @@ -24,7 +26,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -60,7 +62,7 @@ Accepted fields: | `feedOptions.copyright` | `string` | `undefined` | Copyright message. | | `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. | - + ```typescript type EditUrlFunction = (params: { @@ -191,7 +193,7 @@ Markdown documents can use the following Markdown FrontMatter metadata fields, e Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -212,7 +214,7 @@ Accepted fields: | `image` | `string` | `undefined` | Cover or thumbnail image that will be used when displaying the link to your post. | | `slug` | `string` | File path | Allows to customize the blog post url (`//`). Support multiple patterns: `slug: my-blog-post`, `slug: /my/path/to/blog/post`, slug: `/`. | - + ```typescript type Tag = string | {label: string; permalink: string}; diff --git a/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-docs.md b/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-docs.md index ab324d4a096f..3b92343ab507 100644 --- a/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-docs.md +++ b/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-docs.md @@ -4,6 +4,8 @@ title: '📦 plugin-content-docs' slug: '/api/plugins/@docusaurus/plugin-content-docs' --- +import APITable from '@site/src/components/APITable'; + Provides the [Docs](../../guides/docs/docs-introduction.md) functionality and is the default docs plugin for Docusaurus. ## Installation {#installation} @@ -24,7 +26,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -57,7 +59,7 @@ Accepted fields: | `versions` | `Versions` | `{}` | Independent customization of each version's properties. | | `onlyIncludeVersions` | `string[]` | All versions available | Only include a subset of all available versions.
Tip: limit to 2 or 3 versions to improve startup and build time in dev and deploy previews. | -
+ ```typescript type EditUrlFunction = (params: { @@ -238,7 +240,7 @@ Markdown documents can use the following Markdown FrontMatter metadata fields, e Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -262,7 +264,7 @@ Accepted fields: | `slug` | `string` | File path | Allows to customize the document url (`//`). Support multiple patterns: `slug: my-doc`, `slug: /my/path/myDoc`, `slug: /`. | | `tags` | `Tag[]` | `undefined` | A list of strings or objects of two string fields `label` and `permalink` to tag to your docs. | - + ```typescript type Tag = string | {label: string; permalink: string}; diff --git a/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-pages.md b/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-pages.md index 27e3b0c9b9eb..89e30a87789f 100644 --- a/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-pages.md +++ b/website/versioned_docs/version-2.0.0-beta.8/api/plugins/plugin-content-pages.md @@ -4,6 +4,8 @@ title: '📦 plugin-content-pages' slug: '/api/plugins/@docusaurus/plugin-content-pages' --- +import APITable from '@site/src/components/APITable'; + The default pages plugin for Docusaurus. The classic template ships with this plugin with default configurations. This plugin provides [creating pages](guides/creating-pages.md) functionality. ## Installation {#installation} @@ -24,7 +26,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -38,7 +40,7 @@ Accepted fields: | `beforeDefaultRemarkPlugins` | `any[]` | `[]` | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins. | | `beforeDefaultRehypePlugins` | `any[]` | `[]` | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins. | - + ## Example configuration {#ex-config} diff --git a/website/versioned_docs/version-2.0.0-beta.8/api/themes/theme-configuration.md b/website/versioned_docs/version-2.0.0-beta.8/api/themes/theme-configuration.md index af90e16d4bd1..4bc16ec1a093 100644 --- a/website/versioned_docs/version-2.0.0-beta.8/api/themes/theme-configuration.md +++ b/website/versioned_docs/version-2.0.0-beta.8/api/themes/theme-configuration.md @@ -5,6 +5,8 @@ slug: '/api/themes/configuration' toc_max_heading_level: 4 --- +import APITable from '@site/src/components/APITable'; + This configuration applies to all [main themes](./overview.md). ## Common {#common} @@ -17,7 +19,7 @@ It is possible to customize the color mode support within the `colorMode` object Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -30,7 +32,7 @@ Accepted fields: | `switchConfig.lightIcon` | `string` | `'🌞'` | Icon for the switch while in light mode. | | `switchConfig.lightIconStyle` | JSX style object | `{}` | CSS to apply to light icon. | - + Example configuration: @@ -74,13 +76,13 @@ You can configure a default image that will be used for your meta tag, in partic Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `image` | `string` | `undefined` | The meta image URL for the site. Relative to your site's "static" directory. Cannot be SVGs. Can be external URLs too. | - + Example configuration: @@ -99,13 +101,13 @@ You can configure additional html metadatas (and override existing ones). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `metadatas` | `Metadata[]` | `[]` | Any field will be directly passed to the `` tag. Possible fields include `id`, `name`, `property`, `content`, `itemprop`, etc. | - + Example configuration: @@ -124,7 +126,7 @@ Sometimes you want to announce something in your website. Just for such a case, Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -134,7 +136,7 @@ Accepted fields: | `textColor` | `string` | `'#000'` | Announcement text color. | | `isCloseable` | `boolean` | `true` | Whether this announcement can be dismissed with a '×' button. | - + Example configuration: @@ -159,7 +161,7 @@ module.exports = { Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -169,7 +171,7 @@ Accepted fields: | `hideOnScroll` | `boolean` | `false` | Whether the navbar is hidden when the user scrolls down. | | `style` | 'primary' \| 'dark' | Same as theme | Sets the navbar style, ignoring the dark/light theme. | - + ### Navbar logo {#navbar-logo} @@ -179,7 +181,7 @@ To improve dark mode support, you can also set a different logo for this mode. Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -189,7 +191,7 @@ Accepted fields: | `href` | `string` | `siteConfig.baseUrl` | Link to navigate to when the logo is clicked. | | `target` | `string` | Calculated based on `href` (external links will open in a new tab, all others in the current one). | The `target` attribute of the link; controls whether the link is opened in a new tab, the current one, or otherwise. | - + Example configuration: @@ -262,7 +264,7 @@ Outbound (external) links automatically get `target="_blank" rel="noopener noref Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -276,7 +278,7 @@ Accepted fields: | `activeBaseRegex` | `string` | `undefined` | Alternative to `activeBasePath` if required. | | `className` | `string` | `''` | Custom CSS class (for styling any item). | - + :::note @@ -322,7 +324,7 @@ Note that the dropdown base item is a clickable link as well, so this item can r Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -331,7 +333,7 @@ Accepted fields: | `items` | [LinkLikeItem](#navbar-dropdown)[] | **Required** | The items to be contained in the dropdown. | | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | - + Example configuration: @@ -371,7 +373,7 @@ If you want to link to a specific doc, this special navbar item type will render Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -381,7 +383,7 @@ Accepted fields: | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc belongs to. | - + Example configuration: @@ -412,7 +414,7 @@ The user will be able to switch from one version to another, while staying on th Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -423,7 +425,7 @@ Accepted fields: | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc versioning belongs to. | | `dropdownActiveClassDisabled` | `boolean` | `false` | Do not add the link active class when browsing docs. | - + Example configuration: @@ -452,7 +454,7 @@ If you use docs with versioning, this special navbar item type will link to the Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -462,7 +464,7 @@ Accepted fields: | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc versioning belongs to. | - + Example configuration: @@ -493,7 +495,7 @@ The user will be able to switch from one locale to another, while staying on the Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -502,7 +504,7 @@ Accepted fields: | `dropdownItemsBefore` | [LinkLikeItem](#navbar-dropdown)[] | `[]` | Add additional dropdown items at the beginning of the dropdown. | | `dropdownItemsAfter` | [LinkLikeItem](#navbar-dropdown)[] | `[]` | Add additional dropdown items at the end of the dropdown. | - + Example configuration: @@ -535,14 +537,14 @@ If you use the [search](../../search.md), the search bar will be the rightmost e However, with this special navbar item type, you can change the default location. - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `type` | `'search'` | **Required** | Sets the type of this item to a search bar. | | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | - + ```js title="docusaurus.config.js" module.exports = { @@ -599,7 +601,7 @@ Docusaurus uses [Prism React Renderer](https://github.com/FormidableLabs/prism-r Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -607,7 +609,7 @@ Accepted fields: | `darkTheme` | `PrismTheme` | `palenight` | The Prism theme to use for dark-theme code blocks. | | `defaultLanguage` | `string` | `undefined` | The side of the navbar this item should appear on. | - + ### Theme {#theme} @@ -657,7 +659,7 @@ You can add logo and a copyright to the footer via `themeConfig.footer`. Logo ca Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -666,7 +668,7 @@ Accepted fields: | `style` | 'dark' \| 'light' | `'light'` | The color theme of the footer component. | | `items` | `FooterItem[]` | `[]` | The link groups to be present. | - + Example configuration: @@ -693,18 +695,18 @@ You can add links to the footer via `themeConfig.footer.links`. Accepted fields of each link section: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `title` | `string` | `undefined` | Label of the section of these links. | | `items` | `FooterLink[]` | `[]` | Links in this section. | - + Accepted fields of each item in `items`: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -713,7 +715,7 @@ Accepted fields of each item in `items`: | `href` | `string` | **Required** | A full-page navigation, used for navigating outside of the website. **Only one of `to` or `href` should be used.** | | `html` | `string` | `undefined` | Renders the html pass-through instead of a simple link. In case `html` is used, no other options should be provided. | - + Example configuration: @@ -769,14 +771,14 @@ module.exports = { You can adjust the default table of contents via `themeConfig.tableOfContents`. - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `minHeadingLevel` | `number` | `2` | The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value. | | `maxHeadingLevel` | `number` | `3` | Max heading level displayed in the TOC. Should be an integer between 2 and 6. | - + Example configuration: diff --git a/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-blog.md b/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-blog.md index f769ab10b3f4..c54bd3164ca4 100644 --- a/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-blog.md +++ b/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-blog.md @@ -4,6 +4,8 @@ title: '📦 plugin-content-blog' slug: '/api/plugins/@docusaurus/plugin-content-blog' --- +import APITable from '@site/src/components/APITable'; + Provides the [Blog](blog.mdx) feature and is the default blog plugin for Docusaurus. ## Installation {#installation} @@ -24,7 +26,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -60,7 +62,7 @@ Accepted fields: | `feedOptions.copyright` | `string` | `undefined` | Copyright message. | | `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. | - + ```typescript type EditUrlFunction = (params: { @@ -191,7 +193,7 @@ Markdown documents can use the following Markdown FrontMatter metadata fields, e Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -212,7 +214,7 @@ Accepted fields: | `image` | `string` | `undefined` | Cover or thumbnail image that will be used when displaying the link to your post. | | `slug` | `string` | File path | Allows to customize the blog post url (`//`). Support multiple patterns: `slug: my-blog-post`, `slug: /my/path/to/blog/post`, slug: `/`. | - + ```typescript type Tag = string | {label: string; permalink: string}; diff --git a/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-docs.md b/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-docs.md index ab324d4a096f..3b92343ab507 100644 --- a/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-docs.md +++ b/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-docs.md @@ -4,6 +4,8 @@ title: '📦 plugin-content-docs' slug: '/api/plugins/@docusaurus/plugin-content-docs' --- +import APITable from '@site/src/components/APITable'; + Provides the [Docs](../../guides/docs/docs-introduction.md) functionality and is the default docs plugin for Docusaurus. ## Installation {#installation} @@ -24,7 +26,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -57,7 +59,7 @@ Accepted fields: | `versions` | `Versions` | `{}` | Independent customization of each version's properties. | | `onlyIncludeVersions` | `string[]` | All versions available | Only include a subset of all available versions.
Tip: limit to 2 or 3 versions to improve startup and build time in dev and deploy previews. | -
+ ```typescript type EditUrlFunction = (params: { @@ -238,7 +240,7 @@ Markdown documents can use the following Markdown FrontMatter metadata fields, e Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -262,7 +264,7 @@ Accepted fields: | `slug` | `string` | File path | Allows to customize the document url (`//`). Support multiple patterns: `slug: my-doc`, `slug: /my/path/myDoc`, `slug: /`. | | `tags` | `Tag[]` | `undefined` | A list of strings or objects of two string fields `label` and `permalink` to tag to your docs. | - + ```typescript type Tag = string | {label: string; permalink: string}; diff --git a/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-pages.md b/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-pages.md index 27e3b0c9b9eb..89e30a87789f 100644 --- a/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-pages.md +++ b/website/versioned_docs/version-2.0.0-beta.9/api/plugins/plugin-content-pages.md @@ -4,6 +4,8 @@ title: '📦 plugin-content-pages' slug: '/api/plugins/@docusaurus/plugin-content-pages' --- +import APITable from '@site/src/components/APITable'; + The default pages plugin for Docusaurus. The classic template ships with this plugin with default configurations. This plugin provides [creating pages](guides/creating-pages.md) functionality. ## Installation {#installation} @@ -24,7 +26,7 @@ You can configure this plugin through the [preset options](#ex-config-preset). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -38,7 +40,7 @@ Accepted fields: | `beforeDefaultRemarkPlugins` | `any[]` | `[]` | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins. | | `beforeDefaultRehypePlugins` | `any[]` | `[]` | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins. | - + ## Example configuration {#ex-config} diff --git a/website/versioned_docs/version-2.0.0-beta.9/api/themes/theme-configuration.md b/website/versioned_docs/version-2.0.0-beta.9/api/themes/theme-configuration.md index 4b91fad475e7..013acbabba21 100644 --- a/website/versioned_docs/version-2.0.0-beta.9/api/themes/theme-configuration.md +++ b/website/versioned_docs/version-2.0.0-beta.9/api/themes/theme-configuration.md @@ -5,6 +5,8 @@ slug: '/api/themes/configuration' toc_max_heading_level: 4 --- +import APITable from '@site/src/components/APITable'; + This configuration applies to all [main themes](./overview.md). ## Common {#common} @@ -17,7 +19,7 @@ It is possible to customize the color mode support within the `colorMode` object Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -30,7 +32,7 @@ Accepted fields: | `switchConfig.lightIcon` | `string` | `'🌞'` | Icon for the switch while in light mode. | | `switchConfig.lightIconStyle` | JSX style object | `{}` | CSS to apply to light icon. | - + Example configuration: @@ -74,13 +76,13 @@ You can configure a default image that will be used for your meta tag, in partic Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `image` | `string` | `undefined` | The meta image URL for the site. Relative to your site's "static" directory. Cannot be SVGs. Can be external URLs too. | - + Example configuration: @@ -99,13 +101,13 @@ You can configure additional html metadatas (and override existing ones). Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `metadatas` | `Metadata[]` | `[]` | Any field will be directly passed to the `` tag. Possible fields include `id`, `name`, `property`, `content`, `itemprop`, etc. | - + Example configuration: @@ -124,7 +126,7 @@ Sometimes you want to announce something in your website. Just for such a case, Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -134,7 +136,7 @@ Accepted fields: | `textColor` | `string` | `'#000'` | Announcement text color. | | `isCloseable` | `boolean` | `true` | Whether this announcement can be dismissed with a '×' button. | - + Example configuration: @@ -159,7 +161,7 @@ module.exports = { Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -169,7 +171,7 @@ Accepted fields: | `hideOnScroll` | `boolean` | `false` | Whether the navbar is hidden when the user scrolls down. | | `style` | 'primary' \| 'dark' | Same as theme | Sets the navbar style, ignoring the dark/light theme. | - + ### Navbar logo {#navbar-logo} @@ -179,7 +181,7 @@ To improve dark mode support, you can also set a different logo for this mode. Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -191,7 +193,7 @@ Accepted fields: | `height` | string \| number | `undefined` | Specifies the `height` attribute. | | `target` | `string` | Calculated based on `href` (external links will open in a new tab, all others in the current one). | The `target` attribute of the link; controls whether the link is opened in a new tab, the current one, or otherwise. | - + Example configuration: @@ -266,7 +268,7 @@ Outbound (external) links automatically get `target="_blank" rel="noopener noref Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -280,7 +282,7 @@ Accepted fields: | `activeBaseRegex` | `string` | `undefined` | Alternative to `activeBasePath` if required. | | `className` | `string` | `''` | Custom CSS class (for styling any item). | - + :::note @@ -326,7 +328,7 @@ Note that the dropdown base item is a clickable link as well, so this item can r Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -335,7 +337,7 @@ Accepted fields: | `items` | [LinkLikeItem](#navbar-dropdown)[] | **Required** | The items to be contained in the dropdown. | | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | - + Example configuration: @@ -375,7 +377,7 @@ If you want to link to a specific doc, this special navbar item type will render Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -385,7 +387,7 @@ Accepted fields: | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc belongs to. | - + Example configuration: @@ -416,7 +418,7 @@ The user will be able to switch from one version to another, while staying on th Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -427,7 +429,7 @@ Accepted fields: | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc versioning belongs to. | | `dropdownActiveClassDisabled` | `boolean` | `false` | Do not add the link active class when browsing docs. | - + Example configuration: @@ -456,7 +458,7 @@ If you use docs with versioning, this special navbar item type will link to the Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -466,7 +468,7 @@ Accepted fields: | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | | `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc versioning belongs to. | - + Example configuration: @@ -497,7 +499,7 @@ The user will be able to switch from one locale to another, while staying on the Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -506,7 +508,7 @@ Accepted fields: | `dropdownItemsBefore` | [LinkLikeItem](#navbar-dropdown)[] | `[]` | Add additional dropdown items at the beginning of the dropdown. | | `dropdownItemsAfter` | [LinkLikeItem](#navbar-dropdown)[] | `[]` | Add additional dropdown items at the end of the dropdown. | - + Example configuration: @@ -539,14 +541,14 @@ If you use the [search](../../search.md), the search bar will be the rightmost e However, with this special navbar item type, you can change the default location. - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `type` | `'search'` | **Required** | Sets the type of this item to a search bar. | | `position` | 'left' \| 'right' | `'left'` | The side of the navbar this item should appear on. | - + ```js title="docusaurus.config.js" module.exports = { @@ -603,7 +605,7 @@ Docusaurus uses [Prism React Renderer](https://github.com/FormidableLabs/prism-r Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -611,7 +613,7 @@ Accepted fields: | `darkTheme` | `PrismTheme` | `palenight` | The Prism theme to use for dark-theme code blocks. | | `defaultLanguage` | `string` | `undefined` | The side of the navbar this item should appear on. | - + ### Theme {#theme} @@ -661,7 +663,7 @@ You can add logo and a copyright to the footer via `themeConfig.footer`. Logo ca Accepted fields: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -670,7 +672,7 @@ Accepted fields: | `style` | 'dark' \| 'light' | `'light'` | The color theme of the footer component. | | `items` | `FooterItem[]` | `[]` | The link groups to be present. | - + Example configuration: @@ -699,18 +701,18 @@ You can add links to the footer via `themeConfig.footer.links`. Accepted fields of each link section: - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `title` | `string` | `undefined` | Label of the section of these links. | | `items` | `FooterLink[]` | `[]` | Links in this section. | - + Accepted fields of each item in `items`: - + | Name | Type | Default | Description | | --- | --- | --- | --- | @@ -719,7 +721,7 @@ Accepted fields of each item in `items`: | `href` | `string` | **Required** | A full-page navigation, used for navigating outside of the website. **Only one of `to` or `href` should be used.** | | `html` | `string` | `undefined` | Renders the html pass-through instead of a simple link. In case `html` is used, no other options should be provided. | - + Example configuration: @@ -775,14 +777,14 @@ module.exports = { You can adjust the default table of contents via `themeConfig.tableOfContents`. - + | Name | Type | Default | Description | | --- | --- | --- | --- | | `minHeadingLevel` | `number` | `2` | The minimum heading level shown in the table of contents. Must be between 2 and 6 and lower or equal to the max value. | | `maxHeadingLevel` | `number` | `3` | Max heading level displayed in the TOC. Should be an integer between 2 and 6. | - + Example configuration: