docs(v2): misc updates (#2010)

This commit is contained in:
Yangshun Tay 2019-11-17 06:43:41 -08:00 committed by GitHub
commit c16407c95a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 23 deletions

View file

@ -44,7 +44,7 @@ Builds and serves the static site with [Webpack Dev Server](https://webpack.js.o
**options** **options**
| Options | Default | Description | | Options | Default | Description |
|-|-|-| | --- | --- | --- |
| `--port` | `3000` | Specifies the port of the dev server | | `--port` | `3000` | Specifies the port of the dev server |
| `--host` | `localhost` | Specify a host to use. E.g., if you want your server to be accessible externally, you can use `--host 0.0.0.0` | | `--host` | `localhost` | Specify a host to use. E.g., if you want your server to be accessible externally, you can use `--host 0.0.0.0` |
| `--hot-only` | `false` | Enables Hot Module Replacement without page refresh as fallback in case of build failures. More information [here](https://webpack.js.org/configuration/dev-server/#devserverhotonly). | | `--hot-only` | `false` | Enables Hot Module Replacement without page refresh as fallback in case of build failures. More information [here](https://webpack.js.org/configuration/dev-server/#devserverhotonly). |
@ -57,12 +57,13 @@ Compiles your site for production.
**options** **options**
| Options | Default | Description | | Options | Default | Description |
|-|-|-| | --- | --- | --- |
| `--bundle-analyzer` | | Analyze your bundle with [bundle analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) | | `--bundle-analyzer` | | Analyze your bundle with [bundle analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) |
### `docusaurus swizzle` ### `docusaurus swizzle`
> ⚠️ We would like to discourage swizzling of components until we've minimally reached a Beta stage. The components APIs have been changing rapidly and are likely to keep changing until we reach Beta. Stick with the default appearance for now if possible to save yourself some potential pain in future.
Swizzle any Docusaurus Theme components with your own component with `docusaurus swizzle`. Swizzle any Docusaurus Theme components with your own component with `docusaurus swizzle`.
```shell ```shell
@ -79,6 +80,7 @@ Running the above command will copy the relevant theme files to your site folder
To unswizzle a component, simply delete the files of the swizzled component. To unswizzle a component, simply delete the files of the swizzled component.
<!-- TODO a separate section for swizzle tutorial --> <!-- TODO a separate section for swizzle tutorial -->
To learn more about swizzling, check [here](#). To learn more about swizzling, check [here](#).
### `docusaurus deploy` ### `docusaurus deploy`

View file

@ -3,7 +3,7 @@ id: design-principles
title: Design Principles title: Design Principles
--- ---
_This section is a work in progress._ > :warning: _This section is a work in progress._
- **Little to learn** - Docusaurus should be easy to learn and use as the API is quite small. Most things will still be achievable by users, even if it takes them more code and more time to write. Not having abstractions is better than having the wrong abstractions, and we don't want users to have to hack around the wrong abstractions. Mandatory talk - [Minimal API Surface Area](https://www.youtube.com/watch?v=4anAwXYqLG8). - **Little to learn** - Docusaurus should be easy to learn and use as the API is quite small. Most things will still be achievable by users, even if it takes them more code and more time to write. Not having abstractions is better than having the wrong abstractions, and we don't want users to have to hack around the wrong abstractions. Mandatory talk - [Minimal API Surface Area](https://www.youtube.com/watch?v=4anAwXYqLG8).
- **Intuitive** - Users will not feel overwhelmed when looking at the project directory of a Docusaurus project or adding new features. It should look intuitive and easy to build on top of, using approaches they are familiar with. - **Intuitive** - Users will not feel overwhelmed when looking at the project directory of a Docusaurus project or adding new features. It should look intuitive and easy to build on top of, using approaches they are familiar with.
@ -17,8 +17,6 @@ _This section is a work in progress._
We believe that as developers, knowing how a library works is helpful in allowing us to become better at using it. Hence we're dedicating effort into explaining the architecture and various components of Docusaurus with the hope that users reading it will gain a deeper understanding of the tool and be even more proficient in using it. We believe that as developers, knowing how a library works is helpful in allowing us to become better at using it. Hence we're dedicating effort into explaining the architecture and various components of Docusaurus with the hope that users reading it will gain a deeper understanding of the tool and be even more proficient in using it.
_This section is a work in progress._
<!-- <!--
Explain the principles that guide the development of Docusaurus. Explain the principles that guide the development of Docusaurus.

View file

@ -4,7 +4,9 @@ title: Introduction
description: Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly. description: Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly.
--- ---
#### :warning: Disclaimers import useBaseUrl from '@docusaurus/useBaseUrl';
## :warning: Disclaimer
This is an **early and alpha release** of Docusaurus 2. We are making it available early to maximize community participation and feedback. Expect it to evolve a lot over the course of the alpha-beta period. If you are adventurous enough to be an early adopter, chat with us on [**Discord**](https://discordapp.com/invite/docusaurus) :wink:. This is an **early and alpha release** of Docusaurus 2. We are making it available early to maximize community participation and feedback. Expect it to evolve a lot over the course of the alpha-beta period. If you are adventurous enough to be an early adopter, chat with us on [**Discord**](https://discordapp.com/invite/docusaurus) :wink:.
@ -17,11 +19,12 @@ This is an **early and alpha release** of Docusaurus 2. We are making it availab
**Do not use this if** **Do not use this if**
- :x: You need a full production-ready solution (<small>try [Docusaurus 1](https://docusaurus.io/) instead</small>) - :x: You need a full production-ready solution (<small>try [Docusaurus 1](https://docusaurus.io/) instead</small>)
- :x: You need the versioning and translation features present in v1
- :x: You prefer not to work with potential breaking changes and/or features not yet working properly as we improve it during alpha period - :x: You prefer not to work with potential breaking changes and/or features not yet working properly as we improve it during alpha period
## A better Docusaurus is coming to town ## A better Docusaurus is coming to town
<img src="https://docusaurus.io/img/slash-introducing.svg" alt="Docusaurus"/> <img alt="Docusaurus " src={useBaseUrl('img/slash-introducing.svg')} />
Docusaurus 1 used to be a pure documentation site generator. In Docusaurus 2, we rebuilt it from the ground up, allowing for more customizability but preserved the best parts of Docusaurus 1 - easy to get started, versioned docs (_coming soon_), and i18n (_coming soon_). Docusaurus 1 used to be a pure documentation site generator. In Docusaurus 2, we rebuilt it from the ground up, allowing for more customizability but preserved the best parts of Docusaurus 1 - easy to get started, versioned docs (_coming soon_), and i18n (_coming soon_).

View file

@ -3,7 +3,7 @@ id: lifecycle-apis
title: Lifecycle APIs title: Lifecycle APIs
--- ---
_This section is a work in progress._ > :warning: _This section is a work in progress._
Lifecycle APIs are shared by Themes and Plugins. Lifecycle APIs are shared by Themes and Plugins.

View file

@ -119,4 +119,4 @@ The class names which will be processed by webpack into a globally unique class
### CSS-in-JS ### CSS-in-JS
_This section is a work in progress. [Welcoming PRs](https://github.com/facebook/docusaurus/issues/1640)._ > :warning: _This section is a work in progress._ [Welcoming PRs](https://github.com/facebook/docusaurus/issues/1640).\_

View file

@ -3,7 +3,7 @@ id: theme-classic
title: Classic Theme Configuration title: Classic Theme Configuration
--- ---
_This section is a work in progress._ > :warning: _This section is a work in progress._
## Common ## Common
@ -71,8 +71,8 @@ module.exports = {
prism: { prism: {
theme: require('prism-react-renderer/themes/dracula'), theme: require('prism-react-renderer/themes/dracula'),
}, },
} },
} };
``` ```
### Default language ### Default language
@ -86,6 +86,6 @@ module.exports = {
prism: { prism: {
defaultLanguage: 'javascript', defaultLanguage: 'javascript',
}, },
} },
} };
``` ```