mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 17:57:48 +02:00
docs: fix some casing inconsistencies (#7081)
This commit is contained in:
parent
24c205a835
commit
ff96606865
45 changed files with 97 additions and 97 deletions
2
.github/workflows/build-perf.yml
vendored
2
.github/workflows/build-perf.yml
vendored
|
@ -53,4 +53,4 @@ jobs:
|
|||
- name: Build (warm cache)
|
||||
run: yarn workspace website build --locale en
|
||||
timeout-minutes: 2
|
||||
# TODO post a Github comment with build with perf warnings?
|
||||
# TODO post a GitHub comment with build with perf warnings?
|
||||
|
|
8
.github/workflows/tests-e2e.yml
vendored
8
.github/workflows/tests-e2e.yml
vendored
|
@ -100,7 +100,7 @@ jobs:
|
|||
working-directory: ../test-website
|
||||
|
||||
npm:
|
||||
name: E2E — NPM
|
||||
name: E2E — npm
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -114,7 +114,7 @@ jobs:
|
|||
run: yarn
|
||||
- name: Generate test-website project against main branch
|
||||
run: yarn test:build:website -s
|
||||
- name: Install test-website project with NPM
|
||||
- name: Install test-website project with npm
|
||||
run: npm install
|
||||
working-directory: ../test-website
|
||||
env:
|
||||
|
@ -129,7 +129,7 @@ jobs:
|
|||
working-directory: ../test-website
|
||||
|
||||
pnpm:
|
||||
name: E2E — PNPM
|
||||
name: E2E — pnpm
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -143,7 +143,7 @@ jobs:
|
|||
run: yarn
|
||||
- name: Generate test-website project against main branch
|
||||
run: yarn test:build:website -s
|
||||
- name: Install test-website project with PNPM
|
||||
- name: Install test-website project with pnpm
|
||||
run: |
|
||||
curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
|
||||
pnpm install
|
||||
|
|
20
CHANGELOG.md
20
CHANGELOG.md
|
@ -434,7 +434,7 @@
|
|||
- [#6633](https://github.com/facebook/docusaurus/pull/6633) docs: improve wording of using Markdown file paths ([@BigDataWriter](https://github.com/BigDataWriter))
|
||||
- [#6624](https://github.com/facebook/docusaurus/pull/6624) docs: add Resoto & Some Engineering Inc. to showcase ([@TheCatLady](https://github.com/TheCatLady))
|
||||
- [#6611](https://github.com/facebook/docusaurus/pull/6611) docs: fix bad anchor link syntax ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#6591](https://github.com/facebook/docusaurus/pull/6591) docs: improve Github Actions example jobs ([@ebarojas](https://github.com/ebarojas))
|
||||
- [#6591](https://github.com/facebook/docusaurus/pull/6591) docs: improve GitHub Actions example jobs ([@ebarojas](https://github.com/ebarojas))
|
||||
- [#6426](https://github.com/facebook/docusaurus/pull/6426) feat(website): add Tweets section ([@yangshun](https://github.com/yangshun))
|
||||
- [#6532](https://github.com/facebook/docusaurus/pull/6532) docs: add SAP Cloud SDK to showcase ([@artemkovalyov](https://github.com/artemkovalyov))
|
||||
- [#6513](https://github.com/facebook/docusaurus/pull/6513) docs: clean up CONTRIBUTING ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
|
@ -932,7 +932,7 @@
|
|||
- [#6123](https://github.com/facebook/docusaurus/pull/6123) test: use snapshots for sidebar tests ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- Other
|
||||
- [#6122](https://github.com/facebook/docusaurus/pull/6122) fix(website): fix yarn build:website:fast ([@slorber](https://github.com/slorber))
|
||||
- [#6080](https://github.com/facebook/docusaurus/pull/6080) chore: add NPM and PNPM to E2E tests ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#6080](https://github.com/facebook/docusaurus/pull/6080) chore: add npm and pnpm to E2E tests ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `create-docusaurus`, `docusaurus-cssnano-preset`, `docusaurus-mdx-loader`, `docusaurus-migrate`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-debug`, `docusaurus-plugin-google-analytics`, `docusaurus-plugin-google-gtag`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-pwa`, `docusaurus-plugin-sitemap`, `docusaurus-preset-classic`, `docusaurus-remark-plugin-npm2yarn`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-live-codeblock`, `docusaurus-theme-search-algolia`, `docusaurus-theme-translations`, `docusaurus-types`, `docusaurus-utils-common`, `docusaurus-utils-validation`, `docusaurus-utils`, `docusaurus`, `lqip-loader`
|
||||
- [#6092](https://github.com/facebook/docusaurus/pull/6092) misc: ignore some files during npm publish ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
|
||||
|
@ -1101,7 +1101,7 @@ Bad npm publish, use beta.13 instead
|
|||
- [#5903](https://github.com/facebook/docusaurus/pull/5903) docs: refer to deployed branch as deployment rather than target ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5902](https://github.com/facebook/docusaurus/pull/5902) fix(website): fix i18n routes for Canny board ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5900](https://github.com/facebook/docusaurus/pull/5900) docs: document global variables in MDX scope ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#4409](https://github.com/facebook/docusaurus/pull/4409) docs: add example for Github Pages deployment; rewrite deployment section ([@polarathene](https://github.com/polarathene))
|
||||
- [#4409](https://github.com/facebook/docusaurus/pull/4409) docs: add example for GitHub Pages deployment; rewrite deployment section ([@polarathene](https://github.com/polarathene))
|
||||
- [#5888](https://github.com/facebook/docusaurus/pull/5888) docs: update GitHub deployment instructions ([@rootwork](https://github.com/rootwork))
|
||||
- [#5895](https://github.com/facebook/docusaurus/pull/5895) docs: Add juffalow.com to Docusaurus showcase ([@juffalow](https://github.com/juffalow))
|
||||
- [#5881](https://github.com/facebook/docusaurus/pull/5881) docs: fix wrong code sample in docusaurus-core ([@matthijsgroen](https://github.com/matthijsgroen))
|
||||
|
@ -1128,7 +1128,7 @@ Bad npm publish, use beta.13 instead
|
|||
- [#5919](https://github.com/facebook/docusaurus/pull/5919) misc(workflow): E2E tests should not be run with website changes ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5907](https://github.com/facebook/docusaurus/pull/5907) chore(workflow): merge jobs into one workflow & give each job a name ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5889](https://github.com/facebook/docusaurus/pull/5889) chore(website): enable eslint in website ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- [#5870](https://github.com/facebook/docusaurus/pull/5870) chore(README): fix broken Github Actions Workflow Status icon ([@HemantSachdeva](https://github.com/HemantSachdeva))
|
||||
- [#5870](https://github.com/facebook/docusaurus/pull/5870) chore(README): fix broken GitHub Actions Workflow Status icon ([@HemantSachdeva](https://github.com/HemantSachdeva))
|
||||
- `docusaurus-module-type-aliases`, `docusaurus-types`, `docusaurus`
|
||||
- [#6064](https://github.com/facebook/docusaurus/pull/6064) refactor(core): fix types for client code ([@Josh-Cena](https://github.com/Josh-Cena))
|
||||
- `create-docusaurus`, `docusaurus-mdx-loader`, `docusaurus-migrate`, `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-ideal-image`, `docusaurus-plugin-pwa`, `docusaurus-plugin-sitemap`, `docusaurus-theme-translations`, `docusaurus-utils`, `docusaurus`
|
||||
|
@ -3004,7 +3004,7 @@ Starting with this release for a proper work of i18n functionality, you need to
|
|||
- [#3976](https://github.com/facebook/docusaurus/pull/3976) docs(v2): Add AI-Speaker site to showcase page ([@asystentka-jolka](https://github.com/asystentka-jolka))
|
||||
- [#3974](https://github.com/facebook/docusaurus/pull/3974) docs(v2): doc typo on sidebar admonition ([@slorber](https://github.com/slorber))
|
||||
- [#3962](https://github.com/facebook/docusaurus/pull/3962) docs(v2): Add migration info doc regarding docs folder location ([@slorber](https://github.com/slorber))
|
||||
- [#3950](https://github.com/facebook/docusaurus/pull/3950) docs(v2): update Github entreprise deployment doc ([@samhrncir](https://github.com/samhrncir))
|
||||
- [#3950](https://github.com/facebook/docusaurus/pull/3950) docs(v2): update GitHub entreprise deployment doc ([@samhrncir](https://github.com/samhrncir))
|
||||
- [#3945](https://github.com/facebook/docusaurus/pull/3945) docs(v2): Added information about setting `/` in routeBasePath ([@Siemienik](https://github.com/Siemienik))
|
||||
- `docusaurus-theme-classic`
|
||||
- [#4356](https://github.com/facebook/docusaurus/pull/4356) polish(v2): [theme-classic] add Chinese translations (zh-Hant & zh-Hans) ([@MisterFISHUP](https://github.com/MisterFISHUP))
|
||||
|
@ -3432,7 +3432,7 @@ Starting with this release for a proper work of i18n functionality, you need to
|
|||
|
||||
- Other
|
||||
- [#3769](https://github.com/facebook/docusaurus/pull/3769) docs(v2): fix statements background, update footer background ([@Simek](https://github.com/Simek))
|
||||
- [#3744](https://github.com/facebook/docusaurus/pull/3744) chore(v2): add build size bot workflow Github CI workflow ([@jcs98](https://github.com/jcs98))
|
||||
- [#3744](https://github.com/facebook/docusaurus/pull/3744) chore(v2): add build size bot workflow GitHub CI workflow ([@jcs98](https://github.com/jcs98))
|
||||
- [#3741](https://github.com/facebook/docusaurus/pull/3741) chore: update yarn lock again ([@slorber](https://github.com/slorber))
|
||||
- [#3740](https://github.com/facebook/docusaurus/pull/3740) chore: update yarn lock ([@slorber](https://github.com/slorber))
|
||||
- [#3738](https://github.com/facebook/docusaurus/pull/3738) chore(internal): add yarn deduplicate script, cleanup lock ([@Simek](https://github.com/Simek))
|
||||
|
@ -3550,7 +3550,7 @@ Failed release
|
|||
- Other
|
||||
- [#3576](https://github.com/facebook/docusaurus/pull/3576) docs(v2): removed obsolete "you" identifier ([@christian-bromann](https://github.com/christian-bromann))
|
||||
- [#3589](https://github.com/facebook/docusaurus/pull/3589) docs(v2): add taro to users ([@honlyHuang](https://github.com/honlyHuang))
|
||||
- [#3565](https://github.com/facebook/docusaurus/pull/3565) docs(v2): deployment, add required Github token scope infos ([@russtaylor](https://github.com/russtaylor))
|
||||
- [#3565](https://github.com/facebook/docusaurus/pull/3565) docs(v2): deployment, add required GitHub token scope infos ([@russtaylor](https://github.com/russtaylor))
|
||||
- [#3574](https://github.com/facebook/docusaurus/pull/3574) docs(v2): adding vue-nodegui to users ([@shubhamzanwar](https://github.com/shubhamzanwar))
|
||||
- [#3556](https://github.com/facebook/docusaurus/pull/3556) Added Axioms to users ([@abhishektiwari](https://github.com/abhishektiwari))
|
||||
- [#3558](https://github.com/facebook/docusaurus/pull/3558) docs(v2): embedding real source code in MDX as a code block ([@slorber](https://github.com/slorber))
|
||||
|
@ -4489,7 +4489,7 @@ Bad release, check ## 2.0.0-alpha.58
|
|||
- `docusaurus-theme-search-algolia`
|
||||
- [#2762](https://github.com/facebook/docusaurus/pull/2762) fix(v2): avoid duplication search input in navbar ([@lex111](https://github.com/lex111))
|
||||
- `lqip-loader`
|
||||
- [#2693](https://github.com/facebook/docusaurus/pull/2693) fix(v2): add support esModule to lqip-loader ([@ykzts](https://github.com/ykzts))
|
||||
- [#2693](https://github.com/facebook/docusaurus/pull/2693) fix(v2): add support ES Module to lqip-loader ([@ykzts](https://github.com/ykzts))
|
||||
- `docusaurus-init`
|
||||
- [#2751](https://github.com/facebook/docusaurus/pull/2751) fix(v2): fix index page features.length when 0 ([@jdeniau](https://github.com/jdeniau))
|
||||
|
||||
|
@ -4998,7 +4998,7 @@ Bad release, check ## 2.0.0-alpha.58
|
|||
- [#2253](https://github.com/facebook/docusaurus/pull/2253) feat(v2): allow specify custom link for logo ([@lex111](https://github.com/lex111))
|
||||
- [#2255](https://github.com/facebook/docusaurus/pull/2255) feat(v2): add site title to meta title ([@lex111](https://github.com/lex111))
|
||||
- `docusaurus-plugin-content-pages`, `docusaurus-utils`, `docusaurus`
|
||||
- [#2221](https://github.com/facebook/docusaurus/pull/2221) feat(v2): allow for Typescript pages and components ([@jonathanrdelgado](https://github.com/jonathanrdelgado))
|
||||
- [#2221](https://github.com/facebook/docusaurus/pull/2221) feat(v2): allow for TypeScript pages and components ([@jonathanrdelgado](https://github.com/jonathanrdelgado))
|
||||
|
||||
#### :boom: Breaking Change
|
||||
|
||||
|
@ -5623,7 +5623,7 @@ If you are still encountering the error. Please check whether you use `module.ex
|
|||
## 2.0.0-alpha.24 (2019-07-24)
|
||||
|
||||
- Remove unused metadata for pages. This minimize number of http request & smaller bundle size.
|
||||
- Upgrade dependencies of css-loader from 2.x to 3.x. Css modules localIdentName hash now only use the last 4 characters instead of 8.
|
||||
- Upgrade dependencies of css-loader from 2.x to 3.x. CSS modules localIdentName hash now only use the last 4 characters instead of 8.
|
||||
- Fix broken markdown linking replacement for mdx files
|
||||
- Fix potential security vulnerability because we're exposing the directory structure of the host machine. Instead of absolute path, we use relative path from site directory. Resulting in shorter webpack chunk naming and smaller bundle size.
|
||||
- Use contenthash instead of chunkhash for better long term caching
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<a href="#backers" alt="sponsors on Open Collective"><img src="https://opencollective.com/Docusaurus/backers/badge.svg" /></a>
|
||||
<a href="#sponsors" alt="Sponsors on Open Collective"><img src="https://opencollective.com/Docusaurus/sponsors/badge.svg" /></a>
|
||||
<a href="https://www.npmjs.com/package/@docusaurus/core"><img src="https://img.shields.io/npm/v/@docusaurus/core.svg?style=flat" alt="npm version"></a>
|
||||
<a href="https://github.com/facebook/docusaurus/actions/workflows/tests.yml"><img src="https://github.com/facebook/docusaurus/actions/workflows/tests.yml/badge.svg" alt="Github Actions status"></a>
|
||||
<a href="https://github.com/facebook/docusaurus/actions/workflows/tests.yml"><img src="https://github.com/facebook/docusaurus/actions/workflows/tests.yml/badge.svg" alt="GitHub Actions status"></a>
|
||||
<a href="CONTRIBUTING.md#pull-requests"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
|
||||
<a href="https://discord.gg/docusaurus"><img src="https://img.shields.io/discord/102860784329052160.svg" align="right" alt="Discord Chat" /></a>
|
||||
<a href= "https://github.com/prettier/prettier"><img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg"></a>
|
||||
|
|
|
@ -10,7 +10,7 @@ Get access from the Docusaurus npm admins (@yangshun/@JoelMarcey).
|
|||
|
||||
You need publish access to **the main Docusaurus repository** (not a fork).
|
||||
|
||||
## NPM
|
||||
## npm
|
||||
|
||||
Publishing will only work if you are logged into npm with an account with publishing rights to the package.
|
||||
|
||||
|
@ -78,7 +78,7 @@ The `tag:` label prefix is for PRs only. Other labels are not used by the change
|
|||
|
||||
Generate a GitHub auth token by going to https://github.com/settings/tokens (the only permission needed is `public_repo`). Save the token somewhere for future reference.
|
||||
|
||||
Fetch the tags from Github (lerna-changelog looks for commits since last tag by default):
|
||||
Fetch the tags from GitHub (lerna-changelog looks for commits since last tag by default):
|
||||
|
||||
```sh
|
||||
git fetch --tags
|
||||
|
@ -163,7 +163,7 @@ npm access ls-packages
|
|||
</pre>
|
||||
</details>
|
||||
|
||||
It can happen that some accesses are not granted, as an admin might add you to the @docusaurus NPM organization, but you don't have access to the packages that are not in that organization.
|
||||
It can happen that some accesses are not granted, as an admin might add you to the @docusaurus npm organization, but you don't have access to the packages that are not in that organization.
|
||||
|
||||
Please **double-check your permissions on these packages**, otherwise you'll publish a half-release and will have to release a new version.
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ yarn start
|
|||
|
||||
### VS Code
|
||||
|
||||
Use the following code in VSCode to enable breakpoints. Please ensure you have a later version of node for non-legacy debugging.
|
||||
Use the following code in VS Code to enable breakpoints. Please ensure you have a later version of node for non-legacy debugging.
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
|
@ -55,12 +55,12 @@ function findPackageManagerFromUserAgent():
|
|||
|
||||
async function askForPackageManagerChoice(): Promise<SupportedPackageManager> {
|
||||
const hasYarn = shell.exec('yarn --version', {silent: true}).code === 0;
|
||||
const hasPNPM = shell.exec('pnpm --version', {silent: true}).code === 0;
|
||||
const hasPnpm = shell.exec('pnpm --version', {silent: true}).code === 0;
|
||||
|
||||
if (!hasYarn && !hasPNPM) {
|
||||
if (!hasYarn && !hasPnpm) {
|
||||
return 'npm';
|
||||
}
|
||||
const choices = ['npm', hasYarn && 'yarn', hasPNPM && 'pnpm']
|
||||
const choices = ['npm', hasYarn && 'yarn', hasPnpm && 'pnpm']
|
||||
.filter((p): p is string => Boolean(p))
|
||||
.map((p) => ({title: p, value: p}));
|
||||
|
||||
|
@ -165,7 +165,7 @@ async function copyTemplate(
|
|||
}
|
||||
|
||||
await fs.copy(path.resolve(templatesDir, template), dest, {
|
||||
// Symlinks don't exist in published NPM packages anymore, so this is only
|
||||
// Symlinks don't exist in published npm packages anymore, so this is only
|
||||
// to prevent errors during local testing
|
||||
filter: async (filePath) => !(await fs.lstat(filePath)).isSymbolicLink(),
|
||||
});
|
||||
|
@ -337,7 +337,7 @@ export default async function init(
|
|||
// Docusaurus templates.
|
||||
if (useTS) {
|
||||
if (!(await hasTS(template))) {
|
||||
logger.error`Template name=${template} doesn't provide the Typescript variant.`;
|
||||
logger.error`Template name=${template} doesn't provide the TypeScript variant.`;
|
||||
process.exit(1);
|
||||
}
|
||||
template = `${template}${TypeScriptTemplateSuffix}`;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
},
|
||||
{
|
||||
"type": "link",
|
||||
"label": "Github",
|
||||
"label": "GitHub",
|
||||
"href": "https://github.com"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ exports[`docsVersion first time versioning 1`] = `
|
|||
},
|
||||
{
|
||||
"href": "https://github.com",
|
||||
"label": "Github",
|
||||
"label": "GitHub",
|
||||
"type": "link",
|
||||
},
|
||||
{
|
||||
|
|
|
@ -225,7 +225,7 @@ exports[`simple website content 4`] = `
|
|||
},
|
||||
{
|
||||
"href": "https://github.com",
|
||||
"label": "Github",
|
||||
"label": "GitHub",
|
||||
"type": "link",
|
||||
},
|
||||
{
|
||||
|
@ -850,7 +850,7 @@ exports[`simple website content: data 1`] = `
|
|||
},
|
||||
{
|
||||
\\"type\\": \\"link\\",
|
||||
\\"label\\": \\"Github\\",
|
||||
\\"label\\": \\"GitHub\\",
|
||||
\\"href\\": \\"https://github.com\\"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"foo/baz",
|
||||
{
|
||||
"type": "link",
|
||||
"label": "Github",
|
||||
"label": "GitHub",
|
||||
"href": "https://github.com"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -218,7 +218,7 @@ exports[`loadSidebars sidebars with known sidebar item type 1`] = `
|
|||
},
|
||||
{
|
||||
"href": "https://github.com",
|
||||
"label": "Github",
|
||||
"label": "GitHub",
|
||||
"type": "link",
|
||||
},
|
||||
{
|
||||
|
|
|
@ -228,7 +228,7 @@ describe('validateSidebars', () => {
|
|||
`);
|
||||
});
|
||||
|
||||
it('hTML type requires a value', () => {
|
||||
it('html type requires a value', () => {
|
||||
const sidebars: SidebarsConfig = {
|
||||
sidebar1: [
|
||||
{
|
||||
|
@ -248,7 +248,7 @@ describe('validateSidebars', () => {
|
|||
`);
|
||||
});
|
||||
|
||||
it('hTML type accepts valid values', () => {
|
||||
it('html type accepts valid values', () => {
|
||||
const sidebars: SidebarsConfig = {
|
||||
sidebar1: [
|
||||
{
|
||||
|
|
|
@ -145,7 +145,7 @@ describe('themeConfig', () => {
|
|||
{
|
||||
type: 'doc',
|
||||
docId: 'npm',
|
||||
label: 'NPM',
|
||||
label: 'npm',
|
||||
},
|
||||
{
|
||||
to: '/yarn',
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import path from 'path';
|
||||
|
||||
// Based on https://github.com/gatsbyjs/gatsby/pull/21518/files
|
||||
// MacOS (APFS) and Windows (NTFS) filename length limit = 255 chars,
|
||||
// macOS (APFS) and Windows (NTFS) filename length limit = 255 chars,
|
||||
// Others = 255 bytes
|
||||
const MAX_PATH_SEGMENT_CHARS = 255;
|
||||
const MAX_PATH_SEGMENT_BYTES = 255;
|
||||
|
@ -21,7 +21,7 @@ const isWindows = () => process.platform === 'win32';
|
|||
export const isNameTooLong = (str: string): boolean =>
|
||||
// Not entirely correct: we can't assume FS from OS. But good enough?
|
||||
isMacOs() || isWindows()
|
||||
? str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS // MacOS (APFS) and Windows (NTFS) filename length limit (255 chars)
|
||||
? str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS // macOS (APFS) and Windows (NTFS) filename length limit (255 chars)
|
||||
: Buffer.from(str).length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_BYTES; // Other (255 bytes)
|
||||
|
||||
export function shortName(str: string): string {
|
||||
|
|
|
@ -87,7 +87,7 @@ This feature has not been an easy one, and we would like to thank everyone that
|
|||
- [Claire](https://github.com/clairefro) for adopting Docusaurus 2 on the new Redwood platform and providing many feedbacks
|
||||
- [Massoud](https://github.com/massoudmaboudi) for reviewing my work on LTR and adopting it on Datagit
|
||||
- [Crowdin](https://crowdin.com/) for their support and willingness to improve their translation SaaS
|
||||
- The Docusaurus community for their patience, and providing many useful feedbacks on Github
|
||||
- The Docusaurus community for their patience, and providing many useful feedbacks on GitHub
|
||||
|
||||
Thanks for reading.
|
||||
|
||||
|
|
|
@ -34,11 +34,11 @@ Our codebase has been polished over time as well. We have improved test coverage
|
|||
|
||||
## Trends
|
||||
|
||||
### NPM
|
||||
### npm
|
||||
|
||||
Docusaurus v2 continues to grow steadily. V2 installation is now 8 times more than v1. In terms of weekly downloads, we have witnessed another three-fold increase (+209.4%), growing from 28,066 in early January to a peak of 86,846 in mid-December.
|
||||
|
||||
[](https://www.npmtrends.com/docusaurus-vs-@docusaurus/core)
|
||||
[](https://www.npmtrends.com/docusaurus-vs-@docusaurus/core)
|
||||
|
||||
(Ah, the classic Christmas dip...)
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ module.exports = {
|
|||
|
||||
### Module definition {#module-definition}
|
||||
|
||||
You can use a plugin as a module path referencing a separate file or NPM package:
|
||||
You can use a plugin as a module path referencing a separate file or npm package:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
|
|
|
@ -522,7 +522,7 @@ jobs:
|
|||
|
||||
### Triggering deployment with Travis CI {#triggering-deployment-with-travis-ci}
|
||||
|
||||
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the `yarn deploy` script whenever your website is updated. The following section covers how to do just that using [Travis CI](https://travis-ci.com/), a popular continuous integration service provider.
|
||||
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to npm, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the `yarn deploy` script whenever your website is updated. The following section covers how to do just that using [Travis CI](https://travis-ci.com/), a popular continuous integration service provider.
|
||||
|
||||
1. Go to https://github.com/settings/tokens and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). When creating the token, grant it the `repo` scope so that it has the permissions it needs.
|
||||
2. Using your GitHub account, [add the Travis CI app](https://github.com/marketplace/travis-ci) to the repository you want to activate.
|
||||
|
|
|
@ -115,7 +115,7 @@ This is merely a recommended directory structure, and you will still need to man
|
|||
|
||||
:::
|
||||
|
||||
By default, any Markdown or Javascript file starting with `_` will be ignored and no routes will be created for that file (see the `exclude` option).
|
||||
By default, any Markdown or JavaScript file starting with `_` will be ignored and no routes will be created for that file (see the `exclude` option).
|
||||
|
||||
```bash
|
||||
my-website
|
||||
|
|
|
@ -534,7 +534,7 @@ If you have multiple of these multi-language code tabs, and you want to sync the
|
|||
|
||||
### Docusaurus npm2yarn remark plugin {#npm2yarn-remark-plugin}
|
||||
|
||||
Displaying CLI commands in both NPM and Yarn is a very common need, for example:
|
||||
Displaying CLI commands in both npm and Yarn is a very common need, for example:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install @docusaurus/remark-plugin-npm2yarn
|
||||
|
|
|
@ -124,7 +124,7 @@ The writeup below is **not** meant to be a comprehensive guide to creating a plu
|
|||
|
||||
:::
|
||||
|
||||
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate NPM package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` that operates on the AST.
|
||||
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate npm package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` that operates on the AST.
|
||||
|
||||
```js "src/remark/section-prefix.js"
|
||||
const visit = require('unist-util-visit');
|
||||
|
|
|
@ -142,13 +142,13 @@ You may want choices of the same kind of tabs to sync with each other. For examp
|
|||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + C to copy.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + V to paste.</TabItem>
|
||||
</Tabs>
|
||||
```
|
||||
|
||||
|
@ -156,12 +156,12 @@ You may want choices of the same kind of tabs to sync with each other. For examp
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + C to copy.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + V to paste.</TabItem>
|
||||
</Tabs>
|
||||
</BrowserWindow>
|
||||
<br/>
|
||||
|
@ -174,7 +174,7 @@ For all tab groups that have the same `groupId`, the possible values do not need
|
|||
<TabItem value="win" label="Windows">
|
||||
I am Windows.
|
||||
</TabItem>
|
||||
<TabItem value="mac" label="MacOS">
|
||||
<TabItem value="mac" label="macOS">
|
||||
I am macOS.
|
||||
</TabItem>
|
||||
<TabItem value="linux" label="Linux">
|
||||
|
@ -187,7 +187,7 @@ For all tab groups that have the same `groupId`, the possible values do not need
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">I am Windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">I am macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">I am macOS.</TabItem>
|
||||
<TabItem value="linux" label="Linux">I am Linux.</TabItem>
|
||||
</Tabs>
|
||||
</BrowserWindow>
|
||||
|
@ -201,7 +201,7 @@ Tab choices with different group IDs will not interfere with each other:
|
|||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Windows in windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">macOS is macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">macOS is macOS.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
// highlight-next-line
|
||||
|
@ -215,7 +215,7 @@ Tab choices with different group IDs will not interfere with each other:
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Windows in windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">macOS is macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">macOS is macOS.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<Tabs groupId="non-mac-operating-systems">
|
||||
|
|
|
@ -182,7 +182,7 @@ You should **not commit** it, and it may be a good idea to create a dedicated **
|
|||
|
||||
This tutorial uses the CLI version `3.5.2`, but we expect `3.x` releases to keep working.
|
||||
|
||||
Install the Crowdin CLI as an NPM package to your Docusaurus site:
|
||||
Install the Crowdin CLI as an npm package to your Docusaurus site:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install @crowdin/cli@3
|
||||
|
@ -468,7 +468,7 @@ module.exports = {
|
|||
if (locale !== DefaultLocale) {
|
||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||
}
|
||||
// Link to Github for English docs
|
||||
// Link to GitHub for English docs
|
||||
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||
},
|
||||
// highlight-end
|
||||
|
|
|
@ -437,7 +437,7 @@ On your [static hosting provider](../deployment.mdx):
|
|||
|
||||
:::caution
|
||||
|
||||
This strategy is **not possible** with Github Pages, as it is only possible to **have a single deployment**.
|
||||
This strategy is **not possible** with GitHub Pages, as it is only possible to **have a single deployment**.
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ Docusaurus is written in TypeScript and provides first-class TypeScript support.
|
|||
|
||||
## Initialization {#initialization}
|
||||
|
||||
Docusaurus supports writing and using TypeScript theme components. If the init template provides a Typescript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
|
||||
Docusaurus supports writing and using TypeScript theme components. If the init template provides a TypeScript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
|
||||
|
||||
```bash
|
||||
npx create-docusaurus@latest my-website classic --typescript
|
||||
|
@ -104,7 +104,7 @@ module.exports = config;
|
|||
|
||||
Type annotations are very useful and help your IDE understand the type of config objects!
|
||||
|
||||
The best IDEs (VSCode, WebStorm, IntelliJ...) will provide a nice auto-completion experience.
|
||||
The best IDEs (VS Code, WebStorm, IntelliJ...) will provide a nice auto-completion experience.
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import {sortBy} from '@site/src/utils/jsUtils';
|
|||
*
|
||||
* Example PR: https://github.com/facebook/docusaurus/pull/3976
|
||||
*
|
||||
* If you edit this file through the Github interface, you can:
|
||||
* If you edit this file through the GitHub interface, you can:
|
||||
* - Submit first your users.tsx edit PR
|
||||
* - This will create a branch on your Docusaurus fork (usually "patch-1")
|
||||
* - Go to https://github.com/<username>/docusaurus/tree/<branch>/website/src/data/showcase
|
||||
|
@ -281,7 +281,7 @@ const Users: User[] = [
|
|||
{
|
||||
title: 'Blog Matheus Brunelli',
|
||||
description:
|
||||
'Desenvolvimento de software, carreira, dicas de livros e muito Javascript!',
|
||||
'Desenvolvimento de software, carreira, dicas de livros e muito JavaScript!',
|
||||
preview: require('./showcase/blogmatheusbrunelli.png'),
|
||||
website: 'https://mrbrunelli.github.io/blog/',
|
||||
source: 'https://github.com/mrbrunelli/blog',
|
||||
|
@ -624,7 +624,7 @@ const Users: User[] = [
|
|||
},
|
||||
{
|
||||
title: 'FirelordJS',
|
||||
description: 'Typescript Wrapper for Firestore',
|
||||
description: 'TypeScript Wrapper for Firestore',
|
||||
preview: require('./showcase/firelordjs.png'),
|
||||
website: 'https://firelordjs.com',
|
||||
source: 'https://github.com/tylim88/FirelordJSDoc',
|
||||
|
@ -1008,7 +1008,7 @@ const Users: User[] = [
|
|||
{
|
||||
title: 'Molecule',
|
||||
description:
|
||||
'Molecule is a lightweight Web IDE UI framework built with React.js and inspired by VSCode.',
|
||||
'Molecule is a lightweight Web IDE UI framework built with React.js and inspired by VS Code.',
|
||||
preview: require('./showcase/molecule-home.png'),
|
||||
website: 'https://dtstack.github.io/molecule/',
|
||||
source: 'https://github.com/DTStack/molecule/tree/main/website',
|
||||
|
|
|
@ -35,7 +35,7 @@ module.exports = {
|
|||
|
||||
### Module definition {#module-definition}
|
||||
|
||||
You can use a plugin as a module path referencing a separate file or NPM package:
|
||||
You can use a plugin as a module path referencing a separate file or npm package:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
|
|
|
@ -522,7 +522,7 @@ jobs:
|
|||
|
||||
### Triggering deployment with Travis CI {#triggering-deployment-with-travis-ci}
|
||||
|
||||
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the `yarn deploy` script whenever your website is updated. The following section covers how to do just that using [Travis CI](https://travis-ci.com/), a popular continuous integration service provider.
|
||||
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to npm, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the `yarn deploy` script whenever your website is updated. The following section covers how to do just that using [Travis CI](https://travis-ci.com/), a popular continuous integration service provider.
|
||||
|
||||
1. Go to https://github.com/settings/tokens and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). When creating the token, grant it the `repo` scope so that it has the permissions it needs.
|
||||
2. Using your GitHub account, [add the Travis CI app](https://github.com/marketplace/travis-ci) to the repository you want to activate.
|
||||
|
|
|
@ -117,7 +117,7 @@ This is merely a recommended directory structure, and you will still need to man
|
|||
|
||||
:::
|
||||
|
||||
By default, any Markdown or Javascript file starting with `_` will be ignored and no routes will be created for that file (see the `exclude` option).
|
||||
By default, any Markdown or JavaScript file starting with `_` will be ignored and no routes will be created for that file (see the `exclude` option).
|
||||
|
||||
```bash
|
||||
my-website
|
||||
|
|
|
@ -526,7 +526,7 @@ If you have multiple of these multi-language code tabs, and you want to sync the
|
|||
|
||||
### Docusaurus npm2yarn remark plugin {#npm2yarn-remark-plugin}
|
||||
|
||||
Displaying CLI commands in both NPM and Yarn is a very common need, for example:
|
||||
Displaying CLI commands in both npm and Yarn is a very common need, for example:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install @docusaurus/remark-plugin-npm2yarn
|
||||
|
|
|
@ -124,7 +124,7 @@ The writeup below is **not** meant to be a comprehensive guide to creating a plu
|
|||
|
||||
:::
|
||||
|
||||
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate NPM package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` that operates on the AST.
|
||||
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate npm package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` that operates on the AST.
|
||||
|
||||
```js "src/remark/section-prefix.js"
|
||||
const visit = require('unist-util-visit');
|
||||
|
|
|
@ -142,13 +142,13 @@ You may want choices of the same kind of tabs to sync with each other. For examp
|
|||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + C to copy.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + V to paste.</TabItem>
|
||||
</Tabs>
|
||||
```
|
||||
|
||||
|
@ -156,12 +156,12 @@ You may want choices of the same kind of tabs to sync with each other. For examp
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + C to copy.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + V to paste.</TabItem>
|
||||
</Tabs>
|
||||
</BrowserWindow>
|
||||
<br/>
|
||||
|
@ -174,7 +174,7 @@ For all tab groups that have the same `groupId`, the possible values do not need
|
|||
<TabItem value="win" label="Windows">
|
||||
I am Windows.
|
||||
</TabItem>
|
||||
<TabItem value="mac" label="MacOS">
|
||||
<TabItem value="mac" label="macOS">
|
||||
I am macOS.
|
||||
</TabItem>
|
||||
<TabItem value="linux" label="Linux">
|
||||
|
@ -187,7 +187,7 @@ For all tab groups that have the same `groupId`, the possible values do not need
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">I am Windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">I am macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">I am macOS.</TabItem>
|
||||
<TabItem value="linux" label="Linux">I am Linux.</TabItem>
|
||||
</Tabs>
|
||||
</BrowserWindow>
|
||||
|
@ -201,7 +201,7 @@ Tab choices with different group IDs will not interfere with each other:
|
|||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Windows in windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">macOS is macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">macOS is macOS.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
// highlight-next-line
|
||||
|
@ -215,7 +215,7 @@ Tab choices with different group IDs will not interfere with each other:
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Windows in windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">macOS is macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">macOS is macOS.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<Tabs groupId="non-mac-operating-systems">
|
||||
|
|
|
@ -182,7 +182,7 @@ You should **not commit** it, and it may be a good idea to create a dedicated **
|
|||
|
||||
This tutorial uses the CLI version `3.5.2`, but we expect `3.x` releases to keep working.
|
||||
|
||||
Install the Crowdin CLI as an NPM package to your Docusaurus site:
|
||||
Install the Crowdin CLI as an npm package to your Docusaurus site:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install @crowdin/cli@3
|
||||
|
@ -468,7 +468,7 @@ module.exports = {
|
|||
if (locale !== DefaultLocale) {
|
||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||
}
|
||||
// Link to Github for English docs
|
||||
// Link to GitHub for English docs
|
||||
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||
},
|
||||
// highlight-end
|
||||
|
|
|
@ -437,7 +437,7 @@ On your [static hosting provider](../deployment.mdx):
|
|||
|
||||
:::caution
|
||||
|
||||
This strategy is **not possible** with Github Pages, as it is only possible to **have a single deployment**.
|
||||
This strategy is **not possible** with GitHub Pages, as it is only possible to **have a single deployment**.
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ Docusaurus is written in TypeScript and provides first-class TypeScript support.
|
|||
|
||||
## Initialization {#initialization}
|
||||
|
||||
Docusaurus supports writing and using TypeScript theme components. If the init template provides a Typescript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
|
||||
Docusaurus supports writing and using TypeScript theme components. If the init template provides a TypeScript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
|
||||
|
||||
```bash
|
||||
npx create-docusaurus@latest my-website classic --typescript
|
||||
|
@ -104,7 +104,7 @@ module.exports = config;
|
|||
|
||||
Type annotations are very useful and help your IDE understand the type of config objects!
|
||||
|
||||
The best IDEs (VSCode, WebStorm, IntelliJ...) will provide a nice auto-completion experience.
|
||||
The best IDEs (VS Code, WebStorm, IntelliJ...) will provide a nice auto-completion experience.
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ module.exports = {
|
|||
|
||||
### Module definition {#module-definition}
|
||||
|
||||
You can use a plugin as a module path referencing a separate file or NPM package:
|
||||
You can use a plugin as a module path referencing a separate file or npm package:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
|
|
|
@ -522,7 +522,7 @@ jobs:
|
|||
|
||||
### Triggering deployment with Travis CI {#triggering-deployment-with-travis-ci}
|
||||
|
||||
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the `yarn deploy` script whenever your website is updated. The following section covers how to do just that using [Travis CI](https://travis-ci.com/), a popular continuous integration service provider.
|
||||
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to npm, and deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the `yarn deploy` script whenever your website is updated. The following section covers how to do just that using [Travis CI](https://travis-ci.com/), a popular continuous integration service provider.
|
||||
|
||||
1. Go to https://github.com/settings/tokens and generate a new [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). When creating the token, grant it the `repo` scope so that it has the permissions it needs.
|
||||
2. Using your GitHub account, [add the Travis CI app](https://github.com/marketplace/travis-ci) to the repository you want to activate.
|
||||
|
|
|
@ -115,7 +115,7 @@ This is merely a recommended directory structure, and you will still need to man
|
|||
|
||||
:::
|
||||
|
||||
By default, any Markdown or Javascript file starting with `_` will be ignored and no routes will be created for that file (see the `exclude` option).
|
||||
By default, any Markdown or JavaScript file starting with `_` will be ignored and no routes will be created for that file (see the `exclude` option).
|
||||
|
||||
```bash
|
||||
my-website
|
||||
|
|
|
@ -534,7 +534,7 @@ If you have multiple of these multi-language code tabs, and you want to sync the
|
|||
|
||||
### Docusaurus npm2yarn remark plugin {#npm2yarn-remark-plugin}
|
||||
|
||||
Displaying CLI commands in both NPM and Yarn is a very common need, for example:
|
||||
Displaying CLI commands in both npm and Yarn is a very common need, for example:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install @docusaurus/remark-plugin-npm2yarn
|
||||
|
|
|
@ -124,7 +124,7 @@ The writeup below is **not** meant to be a comprehensive guide to creating a plu
|
|||
|
||||
:::
|
||||
|
||||
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate NPM package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` that operates on the AST.
|
||||
For example, let's make a plugin that visits every `h2` heading and adds a `Section X. ` prefix. First, create your plugin source file anywhere—you can even publish it as a separate npm package and install it like explained above. We would put ours at `src/remark/section-prefix.js`. A remark/rehype plugin is just a function that receives the `options` and returns a `transformer` that operates on the AST.
|
||||
|
||||
```js "src/remark/section-prefix.js"
|
||||
const visit = require('unist-util-visit');
|
||||
|
|
|
@ -142,13 +142,13 @@ You may want choices of the same kind of tabs to sync with each other. For examp
|
|||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + C to copy.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + V to paste.</TabItem>
|
||||
</Tabs>
|
||||
```
|
||||
|
||||
|
@ -156,12 +156,12 @@ You may want choices of the same kind of tabs to sync with each other. For examp
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + C to copy.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + C to copy.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Use Ctrl + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">Use Command + V to paste.</TabItem>
|
||||
<TabItem value="mac" label="macOS">Use Command + V to paste.</TabItem>
|
||||
</Tabs>
|
||||
</BrowserWindow>
|
||||
<br/>
|
||||
|
@ -174,7 +174,7 @@ For all tab groups that have the same `groupId`, the possible values do not need
|
|||
<TabItem value="win" label="Windows">
|
||||
I am Windows.
|
||||
</TabItem>
|
||||
<TabItem value="mac" label="MacOS">
|
||||
<TabItem value="mac" label="macOS">
|
||||
I am macOS.
|
||||
</TabItem>
|
||||
<TabItem value="linux" label="Linux">
|
||||
|
@ -187,7 +187,7 @@ For all tab groups that have the same `groupId`, the possible values do not need
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">I am Windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">I am macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">I am macOS.</TabItem>
|
||||
<TabItem value="linux" label="Linux">I am Linux.</TabItem>
|
||||
</Tabs>
|
||||
</BrowserWindow>
|
||||
|
@ -201,7 +201,7 @@ Tab choices with different group IDs will not interfere with each other:
|
|||
// highlight-next-line
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Windows in windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">macOS is macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">macOS is macOS.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
// highlight-next-line
|
||||
|
@ -215,7 +215,7 @@ Tab choices with different group IDs will not interfere with each other:
|
|||
<BrowserWindow>
|
||||
<Tabs groupId="operating-systems">
|
||||
<TabItem value="win" label="Windows">Windows in windows.</TabItem>
|
||||
<TabItem value="mac" label="MacOS">macOS is macOS.</TabItem>
|
||||
<TabItem value="mac" label="macOS">macOS is macOS.</TabItem>
|
||||
</Tabs>
|
||||
|
||||
<Tabs groupId="non-mac-operating-systems">
|
||||
|
|
|
@ -182,7 +182,7 @@ You should **not commit** it, and it may be a good idea to create a dedicated **
|
|||
|
||||
This tutorial uses the CLI version `3.5.2`, but we expect `3.x` releases to keep working.
|
||||
|
||||
Install the Crowdin CLI as an NPM package to your Docusaurus site:
|
||||
Install the Crowdin CLI as an npm package to your Docusaurus site:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install @crowdin/cli@3
|
||||
|
@ -468,7 +468,7 @@ module.exports = {
|
|||
if (locale !== DefaultLocale) {
|
||||
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
|
||||
}
|
||||
// Link to Github for English docs
|
||||
// Link to GitHub for English docs
|
||||
return `https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
|
||||
},
|
||||
// highlight-end
|
||||
|
|
|
@ -437,7 +437,7 @@ On your [static hosting provider](../deployment.mdx):
|
|||
|
||||
:::caution
|
||||
|
||||
This strategy is **not possible** with Github Pages, as it is only possible to **have a single deployment**.
|
||||
This strategy is **not possible** with GitHub Pages, as it is only possible to **have a single deployment**.
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ Docusaurus is written in TypeScript and provides first-class TypeScript support.
|
|||
|
||||
## Initialization {#initialization}
|
||||
|
||||
Docusaurus supports writing and using TypeScript theme components. If the init template provides a Typescript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
|
||||
Docusaurus supports writing and using TypeScript theme components. If the init template provides a TypeScript variant, you can directly initialize a site with full TypeScript support by using the `--typescript` flag.
|
||||
|
||||
```bash
|
||||
npx create-docusaurus@latest my-website classic --typescript
|
||||
|
@ -104,7 +104,7 @@ module.exports = config;
|
|||
|
||||
Type annotations are very useful and help your IDE understand the type of config objects!
|
||||
|
||||
The best IDEs (VSCode, WebStorm, IntelliJ...) will provide a nice auto-completion experience.
|
||||
The best IDEs (VS Code, WebStorm, IntelliJ...) will provide a nice auto-completion experience.
|
||||
|
||||
:::
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue