mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
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:
parent
f750660317
commit
704df6864e
2 changed files with 19 additions and 7 deletions
|
@ -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.
|
||||
|
||||
<!--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue