mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
docs(v2): i18n doc + polish (#4014)
* add some initial i18n doc * i18n doc progress * i18n tutorial progress * i18n tutorial progress * polish Crowdin docs * i18n sidebar in guides * polish crowdin doc * update Crowdin doc a bit * fix annoying relative link to global site resource in template (breaks i18n tutorial) * template: use simpler export for homepage * add markdown page example * rename mdx.md to interactiveDoc.mdx * update bootstrap/facebook templates too * sync init template package scripts * add slug frontmatter doc * improve i18n doc * complete i18n doc * temporarily enable the localeDropdown * doc typo * improve the i18n doc * Add Git i18n doc * add missing "--" for npm run options (unfortunately they don't get stripped by npm2yarn, and are required foor npm) * improve a bit the Crowdin doc
This commit is contained in:
parent
af8dc63202
commit
a8ee7fd3e8
50 changed files with 1469 additions and 102 deletions
|
@ -29,9 +29,9 @@ To serve as an example page when styling markdown based Docusaurus sites.
|
|||
|
||||
## Emphasis
|
||||
|
||||
Emphasis, aka italics, with *asterisks* or _underscores_.
|
||||
Emphasis, aka italics, with _asterisks_ or _underscores_.
|
||||
|
||||
Strong emphasis, aka bold, with **asterisks** or __underscores__.
|
||||
Strong emphasis, aka bold, with **asterisks** or **underscores**.
|
||||
|
||||
Combined emphasis with **asterisks and _underscores_**.
|
||||
|
||||
|
@ -43,16 +43,18 @@ Strikethrough uses two tildes. ~~Scratch this.~~
|
|||
|
||||
1. First ordered list item
|
||||
1. Another item
|
||||
- Unordered sub-list.
|
||||
|
||||
- Unordered sub-list.
|
||||
|
||||
1. Actual numbers don't matter, just that it's a number
|
||||
1. Ordered sub-list
|
||||
1. Ordered sub-list
|
||||
1. And another item.
|
||||
|
||||
* Unordered list can use asterisks
|
||||
- Unordered list can use asterisks
|
||||
|
||||
- Or minuses
|
||||
* Or minuses
|
||||
|
||||
+ Or pluses
|
||||
- Or pluses
|
||||
|
||||
---
|
||||
|
||||
|
@ -88,10 +90,9 @@ Reference-style: ![alt text][logo]
|
|||
|
||||
[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 2'
|
||||
|
||||
Images from any folder can be used by providing path to file. Path should be relative to markdown file.
|
||||
|
||||

|
||||
Images from any folder can be used by providing path to file. Path should be relative to the original markdown file or absolute to the `/static` folder.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -5,13 +5,23 @@ title: Powered by MDX
|
|||
|
||||
You can write JSX and use React components within your Markdown thanks to [MDX](https://mdxjs.com/).
|
||||
|
||||
export const Highlight = ({children, color}) => ( <span style={{
|
||||
The `.mdx` extension is not required, but will enable better support from tooling (IDE, Prettier...).
|
||||
|
||||
export const Highlight = ({children, color}) => (
|
||||
<span
|
||||
style={{
|
||||
backgroundColor: color,
|
||||
borderRadius: '2px',
|
||||
color: '#fff',
|
||||
padding: '0.2rem',
|
||||
}}>{children}</span> );
|
||||
}}
|
||||
onClick={() => alert('Highlight pressed!')}>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
|
||||
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">Facebook blue</Highlight> are my favorite colors.
|
||||
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">
|
||||
Facebook blue
|
||||
</Highlight> are my favorite colors.
|
||||
|
||||
I can write **Markdown** alongside my _JSX_!
|
|
@ -8,7 +8,9 @@
|
|||
"build": "docusaurus build",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
"serve": "docusaurus serve"
|
||||
"serve": "docusaurus serve",
|
||||
"clear": "docusaurus clear",
|
||||
"write-translations": "write-translations"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-alpha.70",
|
||||
|
|
|
@ -55,7 +55,7 @@ function Feature({imageUrl, title, description}) {
|
|||
);
|
||||
}
|
||||
|
||||
function Home() {
|
||||
export default function Home() {
|
||||
const context = useDocusaurusContext();
|
||||
const {siteConfig = {}} = context;
|
||||
|
||||
|
@ -86,5 +86,3 @@ function Home() {
|
|||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Home;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
title: Markdown page example
|
||||
---
|
||||
|
||||
# Markdown page example
|
||||
|
||||
You don't need React to write simple standalone pages.
|
|
@ -88,9 +88,9 @@ Reference-style: ![alt text][logo]
|
|||
|
||||
[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 2'
|
||||
|
||||
Images from any folder can be used by providing path to file. Path should be relative to markdown file.
|
||||
Images from any folder can be used by providing path to file. Path should be relative to the original markdown file or absolute to the `/static` folder.
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -5,13 +5,23 @@ title: Powered by MDX
|
|||
|
||||
You can write JSX and use React components within your Markdown thanks to [MDX](https://mdxjs.com/).
|
||||
|
||||
export const Highlight = ({children, color}) => ( <span style={{
|
||||
The `.mdx` extension is not required, but will enable better support from tooling (IDE, Prettier...).
|
||||
|
||||
export const Highlight = ({children, color}) => (
|
||||
<span
|
||||
style={{
|
||||
backgroundColor: color,
|
||||
borderRadius: '2px',
|
||||
color: '#fff',
|
||||
padding: '0.2rem',
|
||||
}}>{children}</span> );
|
||||
}}
|
||||
onClick={() => alert('Highlight pressed!')}>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
|
||||
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">Facebook blue</Highlight> are my favorite colors.
|
||||
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">
|
||||
Facebook blue
|
||||
</Highlight> are my favorite colors.
|
||||
|
||||
I can write **Markdown** alongside my _JSX_!
|
|
@ -9,7 +9,8 @@
|
|||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
"serve": "docusaurus serve",
|
||||
"clear": "docusaurus clear"
|
||||
"clear": "docusaurus clear",
|
||||
"write-translations": "write-translations"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-alpha.70",
|
||||
|
|
|
@ -54,7 +54,7 @@ function Feature({imageUrl, title, description}) {
|
|||
);
|
||||
}
|
||||
|
||||
function Home() {
|
||||
export default function Home() {
|
||||
const context = useDocusaurusContext();
|
||||
const {siteConfig = {}} = context;
|
||||
return (
|
||||
|
@ -93,5 +93,3 @@ function Home() {
|
|||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Home;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
title: Markdown page example
|
||||
---
|
||||
|
||||
# Markdown page example
|
||||
|
||||
You don't need React to write simple standalone pages.
|
|
@ -29,9 +29,9 @@ To serve as an example page when styling markdown based Docusaurus sites.
|
|||
|
||||
## Emphasis
|
||||
|
||||
Emphasis, aka italics, with *asterisks* or _underscores_.
|
||||
Emphasis, aka italics, with _asterisks_ or _underscores_.
|
||||
|
||||
Strong emphasis, aka bold, with **asterisks** or __underscores__.
|
||||
Strong emphasis, aka bold, with **asterisks** or **underscores**.
|
||||
|
||||
Combined emphasis with **asterisks and _underscores_**.
|
||||
|
||||
|
@ -43,16 +43,18 @@ Strikethrough uses two tildes. ~~Scratch this.~~
|
|||
|
||||
1. First ordered list item
|
||||
1. Another item
|
||||
- Unordered sub-list.
|
||||
|
||||
- Unordered sub-list.
|
||||
|
||||
1. Actual numbers don't matter, just that it's a number
|
||||
1. Ordered sub-list
|
||||
1. Ordered sub-list
|
||||
1. And another item.
|
||||
|
||||
* Unordered list can use asterisks
|
||||
- Unordered list can use asterisks
|
||||
|
||||
- Or minuses
|
||||
* Or minuses
|
||||
|
||||
+ Or pluses
|
||||
- Or pluses
|
||||
|
||||
---
|
||||
|
||||
|
@ -88,9 +90,9 @@ Reference-style: ![alt text][logo]
|
|||
|
||||
[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 2'
|
||||
|
||||
Images from any folder can be used by providing path to file. Path should be relative to markdown file.
|
||||
Images from any folder can be used by providing path to file. Path should be relative to the original markdown file or absolute to the `/static` folder.
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -5,13 +5,23 @@ title: Powered by MDX
|
|||
|
||||
You can write JSX and use React components within your Markdown thanks to [MDX](https://mdxjs.com/).
|
||||
|
||||
export const Highlight = ({children, color}) => ( <span style={{
|
||||
The `.mdx` extension is not required, but will enable better support from tooling (IDE, Prettier...).
|
||||
|
||||
export const Highlight = ({children, color}) => (
|
||||
<span
|
||||
style={{
|
||||
backgroundColor: color,
|
||||
borderRadius: '2px',
|
||||
color: '#fff',
|
||||
padding: '0.2rem',
|
||||
}}>{children}</span> );
|
||||
}}
|
||||
onClick={() => alert('Highlight pressed!')}>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
|
||||
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">Facebook blue</Highlight> are my favorite colors.
|
||||
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">
|
||||
Facebook blue
|
||||
</Highlight> are my favorite colors.
|
||||
|
||||
I can write **Markdown** alongside my _JSX_!
|
|
@ -10,10 +10,11 @@
|
|||
"deploy": "docusaurus deploy",
|
||||
"serve": "docusaurus serve",
|
||||
"clear": "docusaurus clear",
|
||||
"write-translations": "write-translations",
|
||||
"ci": "yarn lint && yarn prettier:diff",
|
||||
"lint": "eslint --cache \"**/*.js\" && stylelint \"**/*.css\"",
|
||||
"prettier": "prettier --config .prettierrc --write \"**/*.{js,md}\"",
|
||||
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,md}\""
|
||||
"prettier": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
|
||||
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,md,mdx}\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-alpha.70",
|
||||
|
|
|
@ -63,7 +63,7 @@ function Feature({imageUrl, title, description}) {
|
|||
);
|
||||
}
|
||||
|
||||
function Home() {
|
||||
export default function Home() {
|
||||
const context = useDocusaurusContext();
|
||||
const {siteConfig = {}} = context;
|
||||
return (
|
||||
|
@ -107,5 +107,3 @@ function Home() {
|
|||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Home;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
title: Markdown page example
|
||||
---
|
||||
|
||||
# Markdown page example
|
||||
|
||||
You don't need React to write simple standalone pages.
|
Loading…
Add table
Add a link
Reference in a new issue