mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-28 00:17:14 +02:00
docs: normalize capitalization (#7619)
This commit is contained in:
parent
aeb6c971c0
commit
e12a2efaeb
44 changed files with 99 additions and 99 deletions
|
@ -418,8 +418,8 @@ The following fields are all deprecated, you may remove from your configuration
|
|||
- `facebookPixelId`
|
||||
- `fonts`
|
||||
- `highlight` - We now use [Prism](https://prismjs.com/) instead of [highlight.js](https://highlightjs.org/).
|
||||
- `markdownOptions` - We use MDX in v2 instead of Remarkable. Your markdown options have to be converted to Remark/Rehype plugins.
|
||||
- `markdownPlugins` - We use MDX in v2 instead of Remarkable. Your markdown plugins have to be converted to Remark/Rehype plugins.
|
||||
- `markdownOptions` - We use MDX in v2 instead of Remarkable. Your Markdown options have to be converted to Remark/Rehype plugins.
|
||||
- `markdownPlugins` - We use MDX in v2 instead of Remarkable. Your Markdown plugins have to be converted to Remark/Rehype plugins.
|
||||
- `manifest`
|
||||
- `onPageNav` - This is turned on by default now.
|
||||
- `separateCss` - It can imported in the same manner as `custom.css` mentioned above.
|
||||
|
@ -470,7 +470,7 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
If you want to keep the `.html` extension as the canonical url of a page, docs can declare a `slug: installation.html` front matter.
|
||||
If you want to keep the `.html` extension as the canonical URL of a page, docs can declare a `slug: installation.html` front matter.
|
||||
|
||||
## Components {#components}
|
||||
|
||||
|
@ -577,7 +577,7 @@ This feature is replaced by [inline table of content](../guides/markdown-feature
|
|||
|
||||
### Update Markdown syntax to be MDX-compatible {#update-markdown-syntax-to-be-mdx-compatible}
|
||||
|
||||
In Docusaurus 2, the markdown syntax has been changed to [MDX](https://mdxjs.com/). Hence there might be some broken syntax in the existing docs which you would have to update. A common example is self-closing tags like `<img>` and `<br>` which are valid in HTML would have to be explicitly closed now ( `<img/>` and `<br/>`). All tags in MDX documents have to be valid JSX.
|
||||
In Docusaurus 2, the Markdown syntax has been changed to [MDX](https://mdxjs.com/). Hence there might be some broken syntax in the existing docs which you would have to update. A common example is self-closing tags like `<img>` and `<br>` which are valid in HTML would have to be explicitly closed now ( `<img/>` and `<br/>`). All tags in MDX documents have to be valid JSX.
|
||||
|
||||
Front matter is parsed by [gray-matter](https://github.com/jonschlinkert/gray-matter). If your front matter use special characters like `:`, you now need to quote it: `title: Part 1: my part1 title` → `title: "Part 1: my part1 title"`.
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ There are multiple things to migrate to obtain a fully functional Docusaurus 2 w
|
|||
- packages
|
||||
- CLI commands
|
||||
- site configuration
|
||||
- markdown files
|
||||
- Markdown files
|
||||
- sidebars file
|
||||
- pages, components and CSS
|
||||
- versioned docs
|
||||
|
|
|
@ -110,21 +110,21 @@ Unfortunately, Crowdin does not have any "Duplicate/clone Project" feature, whic
|
|||
- Download the Crowdin translations locally
|
||||
- Try to run/build your site and see if there are any errors
|
||||
|
||||
You will likely have errors on your first-try: the pre-translation might try to translate things that it should not be translated (front matter, admonition, code blocks...), and the translated md files might be invalid for the MDX parser.
|
||||
You will likely have errors on your first-try: the pre-translation might try to translate things that it should not be translated (front matter, admonition, code blocks...), and the translated MD files might be invalid for the MDX parser.
|
||||
|
||||
You will have to fix all the errors until your site builds. You can do that by modifying the translated md files locally, and fix your site for one locale at a time using `docusaurus build --locale fr`.
|
||||
You will have to fix all the errors until your site builds. You can do that by modifying the translated MD files locally, and fix your site for one locale at a time using `docusaurus build --locale fr`.
|
||||
|
||||
There is no ultimate guide we could write to fix these errors, but common errors are due to:
|
||||
|
||||
- Not marking enough strings as "hidden strings" in Crowdin, leading to pre-translation trying to translate these strings.
|
||||
- Having bad v1 translations, leading to invalid markup in v2: bad html elements inside translations and unclosed tags
|
||||
- Having bad v1 translations, leading to invalid markup in v2: bad HTML elements inside translations and unclosed tags
|
||||
- Anything rejected by the MDX parser, like using HTML elements instead of JSX elements (use the [MDX playground](https://mdxjs.com/playground/) for debugging)
|
||||
|
||||
You might want to repeat this pre-translation process, eventually trying the "Perfect" option and limiting pre-translation only some languages/files.
|
||||
|
||||
:::tip
|
||||
|
||||
Use [`mdx-code-block`](../i18n/i18n-crowdin.mdx#mdx-solutions) around problematic markdown elements: Crowdin is less likely mess things up with code blocks.
|
||||
Use [`mdx-code-block`](../i18n/i18n-crowdin.mdx#mdx-solutions) around problematic Markdown elements: Crowdin is less likely mess things up with code blocks.
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ The versioned docs should normally be migrated correctly by the [migration CLI](
|
|||
|
||||
## Migrate your `versioned_docs` front matter {#migrate-your-versioned_docs-front-matter}
|
||||
|
||||
Unlike v1, The markdown header for each versioned doc is no longer altered by using `version-${version}-${original_id}` as the value for the actual ID field. See scenario below for better explanation.
|
||||
Unlike v1, The Markdown header for each versioned doc is no longer altered by using `version-${version}-${original_id}` as the value for the actual ID field. See scenario below for better explanation.
|
||||
|
||||
For example, if you have a `docs/hello.md`.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue