mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 07:18:59 +02:00
* test(v2): Fix docusaurus-utils tests for windows * test(v2): Fix plugin-client-redirects test - add the posixPath in writeRedirectsFiles.ts * test(v2): Fix plugin-content-pages test add posixPath in test and index * test(v2): add window test configuration - add the window test configuration in nodejs-windows.yml * test(v2): revert plugin-content-pages test fix * test(v2): Fix mdx-loader/transformImage test * test(v2): add cleanPath in transformImage test * fix version path tests for windows * make versionMetadata test work on Windows * try to fix posix/win32 path issues * attempt to fix windows test * try to make source alias less win32 sensitive * try to make source alias less win32 sensitive * try to make source alias less win32 sensitive * try to make source alias less win32 sensitive * try to make source alias less win32 sensitive * try to make source alias less win32 sensitive * specific jest config for windows * attempt to fix windows testing issue * attempt to fix windows testing issue * attempt to fix windows testing issue * attempt to fix windows testing issue * attempt to fix windows testing issue * attempt to fix windows testing issue * attempt to fix windows testing issue * remove bad cleanPath fn * try to fix windows tests * try to fix windows tests * blog: try to fix windows tests by using same logic as on docs plugin * try to fix windows tests * try to fix windows tests * try to fix windows tests * try to fix windows tests * improve the Github CI setup for windows: make jobs run in parallel * revert GH action change Co-authored-by: Sachin Kumar Rajput <skr571999@gmail.com>
65 lines
1.4 KiB
Markdown
65 lines
1.4 KiB
Markdown
# Remark plugin npm2yarn
|
|
|
|
## Motivation:
|
|
|
|
Transforms npm bash command code blocks to Docusaurus tabs:
|
|
|
|
The following (remove the `//`):
|
|
|
|
````bash
|
|
// ```bash npm2yarn
|
|
// npm run build
|
|
// ```
|
|
````
|
|
|
|
Becomes:
|
|
|
|

|
|
|
|
**Note**: it only works when used with Docusaurus themes that have the `Tabs` and `TabItems` components.
|
|
|
|
## Install
|
|
|
|
```bash
|
|
npm install @docusaurus/remark-plugin-npm2yarn
|
|
```
|
|
|
|
It is a Remark plugin, **not a Docusaurus plugin**, so you have to install it as a Remark plugin in the config of your Docusaurus plugins.
|
|
|
|
```js
|
|
module.exports = {
|
|
presets: [
|
|
[
|
|
'@docusaurus/preset-classic',
|
|
{
|
|
docs: {
|
|
// ...
|
|
remarkPlugins: [
|
|
[require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
|
|
],
|
|
},
|
|
blog: {
|
|
// ...
|
|
remarkPlugins: [
|
|
[require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
|
|
],
|
|
},
|
|
pages: {
|
|
// ...
|
|
remarkPlugins: [
|
|
[require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
|
|
],
|
|
},
|
|
// ...
|
|
},
|
|
],
|
|
],
|
|
// ...
|
|
};
|
|
```
|
|
|
|
## Options
|
|
|
|
| Property | Type | Default | Description |
|
|
| --- | --- | --- | --- |
|
|
| `sync` | `boolean` | `false` | Syncing tab choices (yarn and npm). See https://v2.docusaurus.io/docs/markdown-features/#syncing-tab-choices for details. |
|