Skip to content

Commit

Permalink
docs: new APITable comp to render large tables (#5891)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Nov 10, 2021
1 parent 7a07963 commit ecce576
Show file tree
Hide file tree
Showing 14 changed files with 277 additions and 138 deletions.
10 changes: 6 additions & 4 deletions website/docs/api/plugins/plugin-content-blog.md
Expand Up @@ -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}
Expand All @@ -25,7 +27,7 @@ You can configure this plugin through the [preset options](#ex-config-preset).

Accepted fields:

<small>
<APITable>

| Name | Type | Default | Description |
| --- | --- | --- | --- |
Expand Down Expand Up @@ -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` | <code>'descending' \| 'ascending' </code> | `'descending'` | Governs the direction of blog post sorting. |

</small>
</APITable>

```typescript
type EditUrlFunction = (params: {
Expand Down Expand Up @@ -193,7 +195,7 @@ Markdown documents can use the following Markdown FrontMatter metadata fields, e

Accepted fields:

<small>
<APITable>

| Name | Type | Default | Description |
| --- | --- | --- | --- |
Expand All @@ -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 (`/<routeBasePath>/<slug>`). Support multiple patterns: `slug: my-blog-post`, `slug: /my/path/to/blog/post`, slug: `/`. |

</small>
</APITable>

```typescript
type Tag = string | {label: string; permalink: string};
Expand Down
10 changes: 6 additions & 4 deletions website/docs/api/plugins/plugin-content-docs.md
Expand Up @@ -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}
Expand All @@ -25,7 +27,7 @@ You can configure this plugin through the [preset options](#ex-config-preset).

Accepted fields:

<small>
<APITable>

| Name | Type | Default | Description |
| --- | --- | --- | --- |
Expand Down Expand Up @@ -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. <br /> Tip: limit to 2 or 3 versions to improve startup and build time in dev and deploy previews. |

</small>
</APITable>

```typescript
type EditUrlFunction = (params: {
Expand Down Expand Up @@ -239,7 +241,7 @@ Markdown documents can use the following Markdown FrontMatter metadata fields, e

Accepted fields:

<small>
<APITable>

| Name | Type | Default | Description |
| --- | --- | --- | --- |
Expand All @@ -263,7 +265,7 @@ Accepted fields:
| `slug` | `string` | File path | Allows to customize the document url (`/<routeBasePath>/<slug>`). 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. |

</small>
</APITable>

```typescript
type Tag = string | {label: string; permalink: string};
Expand Down
6 changes: 4 additions & 2 deletions website/docs/api/plugins/plugin-content-pages.md
Expand Up @@ -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}
Expand All @@ -25,7 +27,7 @@ You can configure this plugin through the [preset options](#ex-config-preset).

Accepted fields:

<small>
<APITable>

| Name | Type | Default | Description |
| --- | --- | --- | --- |
Expand All @@ -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. |

</small>
</APITable>

## Example configuration {#ex-config}

Expand Down

0 comments on commit ecce576

Please sign in to comment.