docs(v2): improve cli docs (#4259)

* added more details about --danger flag for swizzle

* added referencing to blog posts

* improved the docs for swizzling.

* added new Farsi/Persian translation

* Update website/docs/cli.md

* Update website/docs/cli.md

* Update website/docs/using-themes.md

* PR cleanup

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Massoud Maboudi 2021-02-22 23:08:05 +03:30 committed by GitHub
parent f750660317
commit 704df6864e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 7 deletions

View file

@ -92,18 +92,18 @@ We highly discourage swizzling of components until we've reached a Beta stage. T
:::
Change any Docusaurus theme components to your liking with `docusaurus swizzle`.
Change any Docusaurus theme components to your liking with `npm run swizzle`.
```shell
docusaurus swizzle [themeName] [componentName] [siteDir]
```bash npm2yarn
npm run swizzle [themeName] [componentName] [siteDir]
# Example (leaving out the siteDir to indicate this directory)
docusaurus swizzle @docusaurus/theme-classic DocSidebar
npm run swizzle @docusaurus/theme-classic DocSidebar
```
Running the command will copy the relevant theme files to your site folder. You may then make any changes to it and Docusaurus will use it instead of the one provided from the theme.
`docusaurus swizzle` without `themeName` lists all the themes available for swizzling similarly `docusaurus swizzle <themeName>` without `componentName` lists all the components available for swizzling.
`npm run swizzle` without `themeName` lists all the themes available for swizzling similarly `npm run swizzle <themeName>` without `componentName` lists all the components available for swizzling.
#### Options
@ -114,6 +114,18 @@ Running the command will copy the relevant theme files to your site folder. You
| `--danger` | Allow swizzling of unstable components |
| `--typescript` | Swizzle TypeScript components |
An example to use `--danger` flag let's consider the below code:
```bash npm2yarn
npm run swizzle @docusaurus/theme-classic Logo -- --danger
```
:::caution
Unstable Components: components that have a higher risk of breaking changes due to internal refactorings.
:::
To unswizzle a component, simply delete the files of the swizzled component.
<!--