docs(v2): use explicit heading IDs (#4460)

This commit is contained in:
Alexey Pyltsyn 2021-03-19 13:00:41 +03:00 committed by GitHub
parent 962c3748ea
commit 291a72fbae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
162 changed files with 1435 additions and 1435 deletions

View file

@ -7,7 +7,7 @@ slug: '/api/plugins'
We provide official Docusaurus plugins.
## Content plugins
## Content plugins {#content-plugins}
These plugins are responsible to load your site's content, and create pages for your theme to render.
@ -15,7 +15,7 @@ These plugins are responsible to load your site's content, and create pages for
- [@docusaurus/plugin-content-blog](./plugin-content-blog.md)
- [@docusaurus/plugin-content-pages](./plugin-content-pages.md)
## Behavior plugins
## Behavior plugins {#behavior-plugins}
These plugins will add a useful behavior to your Docusaurus site.

View file

@ -22,13 +22,13 @@ Before using this plugin, you should look if your hosting provider doesn't offer
:::
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-client-redirects
```
## Configuration
## Configuration {#configuration}
Main usecase: you have `/myDocusaurusPage`, and you want to redirect to this page from `/myDocusaurusPage.html`:

View file

@ -6,7 +6,7 @@ slug: '/api/plugins/@docusaurus/plugin-content-blog'
Provides the [Blog](blog.md) feature and is the default blog plugin for Docusaurus.
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-content-blog
@ -18,7 +18,7 @@ If you have installed `@docusaurus/preset-classic`, you don't need to install it
:::
## Configuration
## Configuration {#configuration}
```js title="docusaurus.config.js"
module.exports = {
@ -118,18 +118,18 @@ module.exports = {
};
```
## i18n
## i18n {#i18n}
Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
### Translation files location
### Translation files location {#translation-files-location}
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-blog`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-blog-<pluginId>`
- **JSON files**: N/A
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-blog`
### Example file-system structure
### Example file-system structure {#example-file-system-structure}
```bash
website/i18n/<locale>/docusaurus-plugin-content-blog

View file

@ -6,7 +6,7 @@ slug: '/api/plugins/@docusaurus/plugin-content-docs'
Provides the [Docs](../../guides/docs/docs-introduction.md) functionality and is the default docs plugin for Docusaurus.
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-content-docs
@ -18,7 +18,7 @@ If you have installed `@docusaurus/preset-classic`, you don't need to install it
:::
## Configuration
## Configuration {#configuration}
```js title="docusaurus.config.js"
module.exports = {
@ -148,7 +148,7 @@ module.exports = {
};
```
## Markdown Frontmatter
## Markdown Frontmatter {#markdown-frontmatter}
Markdown documents can use the following markdown frontmatter metadata fields, enclosed by a line `---` on either side:
@ -183,18 +183,18 @@ slug: /myDoc
My Document Markdown content
```
## i18n
## i18n {#i18n}
Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
### Translation files location
### Translation files location {#translation-files-location}
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-docs`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-docs-<pluginId>`
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations)
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-docs/<version>`
### Example file-system structure
### Example file-system structure {#example-file-system-structure}
```bash
website/i18n/<locale>/docusaurus-plugin-content-docs

View file

@ -6,7 +6,7 @@ slug: '/api/plugins/@docusaurus/plugin-content-pages'
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 {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-content-pages
@ -18,7 +18,7 @@ If you have installed `@docusaurus/preset-classic`, you don't need to install it
:::
## Configuration
## Configuration {#configuration}
```js title="docusaurus.config.js"
module.exports = {
@ -67,18 +67,18 @@ module.exports = {
};
```
## i18n
## i18n {#i18n}
Read the [i18n introduction](../../i18n/i18n-introduction.md) first.
### Translation files location
### Translation files location {#translation-files-location}
- **Base path**: `website/i18n/<locale>/docusaurus-plugin-content-pages`
- **Multi-instance path**: `website/i18n/<locale>/docusaurus-plugin-content-pages-<pluginId>`
- **JSON files**: extracted with [`docusaurus write-translations`](../../cli.md#docusaurus-write-translations)
- **Markdown files**: `website/i18n/<locale>/docusaurus-plugin-content-pages`
### Example file-system structure
### Example file-system structure {#example-file-system-structure}
```bash
website/i18n/<locale>/docusaurus-plugin-content-pages

View file

@ -16,7 +16,7 @@ If you don't have any sensitive information, you can keep it on in production [l
:::
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-debug
@ -30,7 +30,7 @@ By default, it's enabled in dev, and disabled in prod, to avoid exposing potenti
:::
## Configuration
## Configuration {#configuration}
```js title="docusaurus.config.js"
module.exports = {

View file

@ -6,7 +6,7 @@ slug: '/api/plugins/@docusaurus/plugin-google-analytics'
The default [Google Analytics](https://developers.google.com/analytics/devguides/collection/analyticsjs/) plugin. It is a JavaScript library for measuring how users interact with your website.
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-google-analytics
@ -18,7 +18,7 @@ If you have installed `@docusaurus/preset-classic`, you don't need to install it
:::
## Configuration
## Configuration {#configuration}
```js title="docusaurus.config.js"
module.exports = {

View file

@ -6,7 +6,7 @@ slug: '/api/plugins/@docusaurus/plugin-google-gtag'
The default [Global Site Tag (gtag.js)](https://developers.google.com/analytics/devguides/collection/gtagjs/) plugin. It is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform. This section describes how to configure a Docusaurus site to enable global site tag for Google Analytics.
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-google-gtag
@ -18,7 +18,7 @@ If you have installed `@docusaurus/preset-classic`, you don't need to install it
:::
## Configuration
## Configuration {#configuration}
```js title="docusaurus.config.js"
module.exports = {

View file

@ -6,13 +6,13 @@ slug: '/api/plugins/@docusaurus/plugin-ideal-image'
Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder) **in the production builds**.
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-ideal-image
```
## Configuration
## Configuration {#configuration}
Modify your `docusaurus.config.js`
@ -24,7 +24,7 @@ module.exports = {
}
```
## Usage
## Usage {#usage}
This plugin supports the PNG, GIF and JPG formats only.
@ -39,7 +39,7 @@ import thumbnail from './path/to/img.png';
<Image img={require('./path/to/img.png')} />
```
## Options
## Options {#options}
| Option | Type | Default | Description |
| --- | --- | --- | --- |

View file

@ -6,13 +6,13 @@ slug: '/api/plugins/@docusaurus/plugin-pwa'
Docusaurus Plugin to add PWA support using [Workbox](https://developers.google.com/web/tools/workbox). This plugin generates a [Service Worker](https://developers.google.com/web/fundamentals/primers/service-workers) in production build only, and allows you to create fully PWA-compliant documentation site with offline and installation support.
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-pwa
```
## Configuration
## Configuration {#configuration}
Create a [PWA manifest](https://web.dev/add-manifest/) at `./static/manifest.json`.
@ -53,7 +53,7 @@ module.exports = {
};
```
## Progressive Web App
## Progressive Web App {#progressive-web-app}
Having a service worker installed is not enough to make your application a PWA. You'll need to at least include a [Web App Manifest](https://developer.mozilla.org/en-US/docs/Web/Manifest) and have the correct tags in `<head>` ([Options > pwaHead](#pwahead)).
@ -61,7 +61,7 @@ After deployment, you can use [Lighthouse](https://developers.google.com/web/too
For a more exhaustive list of what it takes for your site to be a PWA, refer to the [PWA Checklist](https://developers.google.com/web/progressive-web-apps/checklist)
## App installation support
## App installation support {#app-installation-support}
If your browser supports it, you should be able to install a Docusaurus site as an app.
@ -73,7 +73,7 @@ App installation requires the https protocol and a valid manifest.
:::
## Offline mode (precaching)
## Offline mode (precaching) {#offline-mode-precaching}
We enable users to browse a Docusaurus site offline, by using service-worker precaching.
@ -95,9 +95,9 @@ Offline mode / precaching requires downloading all the static assets of the site
:::
## Options
## Options {#options}
### `debug`
### `debug` {#debug}
- Type: `boolean`
- Default: `false`
@ -109,7 +109,7 @@ Turn debug mode on:
- Unoptimized SW file output
- Source maps
### `offlineModeActivationStrategies`
### `offlineModeActivationStrategies` {#offlinemodeactivationstrategies}
- Type: `Array<'appInstalled' | 'mobile' | 'saveData'| 'queryString' | 'always'>`
- Default: `['appInstalled','queryString','standalone']`
@ -139,7 +139,7 @@ The [`standalone` strategy](https://petelepage.com/blog/2019/07/is-my-pwa-instal
:::
### `injectManifestConfig`
### `injectManifestConfig` {#injectmanifestconfig}
[Workbox options](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.injectManifest) to pass to `workbox.injectManifest()`. This gives you control over which assets will be precached, and be available offline.
@ -170,7 +170,7 @@ module.exports = {
};
```
### `reloadPopup`
### `reloadPopup` {#reloadpopup}
- Type: `string | false`
- Default: `'@theme/PwaReloadPopup'`
@ -191,7 +191,7 @@ The default theme includes an implementation for the reload popup and uses [Infi
![pwa_reload.gif](/img/pwa_reload.gif)
### `pwaHead`
### `pwaHead` {#pwahead}
- Type: `Array<{ tagName: string } & Record<string,string>>`
- Default: `[]`
@ -258,7 +258,7 @@ module.exports = {
};
```
### `swCustom`
### `swCustom` {#swcustom}
- Type: `string | undefined`
- Default: `undefined`
@ -291,7 +291,7 @@ export default function swCustom(params) {
The module should have a `default` function export, and receives some params.
### `swRegister`
### `swRegister` {#swregister}
- Type: `string | false`
- Default: `'docusaurus-plugin-pwa/src/registerSW.js'`
@ -300,7 +300,7 @@ Adds an entry before the Docusaurus app so that registration can happen before t
Passing `false` will disable registration entirely.
## Manifest example
## Manifest example {#manifest-example}
The Docusaurus site manifest can serve as an inspiration:

View file

@ -6,7 +6,7 @@ slug: '/api/plugins/@docusaurus/plugin-sitemap'
This plugin creates sitemap for your site so that search engine crawlers can crawl your site more accurately.
## Installation
## Installation {#installation}
```bash npm2yarn
npm install --save @docusaurus/plugin-sitemap
@ -18,7 +18,7 @@ If you have installed `@docusaurus/preset-classic`, you don't need to install it
:::
## Configuration
## Configuration {#configuration}
```js title="docusaurus.config.js"
module.exports = {