mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-16 08:15:55 +02:00
misc: add command to run prettier on docs (#2102)
* misc: add command to run prettier on docs * Fix GH issue template * Fix tests * Add prettier-docs command to precommit
This commit is contained in:
parent
cfc313d7c7
commit
55e676cb25
141 changed files with 1181 additions and 968 deletions
|
@ -8,4 +8,4 @@ authorTwitter: endiliey
|
|||
|
||||

|
||||
|
||||
We are very happy to introduce [Docusaurus](https://github.com/facebook/docusaurus) to help you manage one or many open source websites.
|
||||
We are very happy to introduce [Docusaurus](https://github.com/facebook/docusaurus) to help you manage one or many open source websites.
|
||||
|
|
|
@ -8,14 +8,15 @@ Docusaurus is the best :)
|
|||

|
||||
|
||||
```js
|
||||
console.log("Docusaurus");
|
||||
console.log('Docusaurus');
|
||||
```
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Don't replace the one below
|
||||
```md
|
||||
|
||||
```md
|
||||

|
||||
```
|
||||
```
|
||||
|
|
|
@ -18,12 +18,13 @@ title: Document 2
|
|||
- [doc2](./doc2.md)
|
||||
|
||||
## Do not replace this
|
||||
|
||||
```md
|
||||

|
||||
```
|
||||
|
||||
```js
|
||||
const doc1 = foo();
|
||||
console.log("[image2](assets/image2.jpg)");
|
||||
console.log('[image2](assets/image2.jpg)');
|
||||
const testStr = ``;
|
||||
```
|
||||
```
|
||||
|
|
|
@ -18,13 +18,14 @@ title: Reference Links
|
|||
- [doc2][doc2]
|
||||
|
||||
## Do not replace this
|
||||
|
||||
```md
|
||||
![image1][image1]
|
||||
```
|
||||
|
||||
```js
|
||||
const doc1 = foo();
|
||||
console.log("[image2][image2]");
|
||||
console.log('[image2][image2]');
|
||||
const testStr = `![image3][image3]`;
|
||||
```
|
||||
|
||||
|
|
|
@ -6,4 +6,5 @@ title: Document 3
|
|||
Test subdirectory file
|
||||
|
||||
### Replace this
|
||||
|
||||
- [doc3](subdir/doc3.md)
|
||||
|
|
|
@ -4,23 +4,8 @@ title: This is not a css
|
|||
|
||||
This is a markdown, not a css
|
||||
|
||||
.homeWrapperInner .homeCodeSnippet > div:nth-child(1) {
|
||||
display: none;
|
||||
}
|
||||
.homeWrapperInner .homeCodeSnippet > div:nth-child(1) { display: none; }
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.projectTitle {
|
||||
font-size: 30px;
|
||||
}
|
||||
@media (max-width: 480px) { .projectTitle { font-size: 30px; }
|
||||
|
||||
.homeCodeSnippet .hljs {
|
||||
font-size: 13px;
|
||||
padding: 0;
|
||||
}
|
||||
.homeWrapperInner .homeCodeSnippet > div:nth-child(1) {
|
||||
display: block;
|
||||
}
|
||||
.homeWrapperInner .homeCodeSnippet > div:nth-child(2) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.homeCodeSnippet .hljs { font-size: 13px; padding: 0; } .homeWrapperInner .homeCodeSnippet > div:nth-child(1) { display: block; } .homeWrapperInner .homeCodeSnippet > div:nth-child(2) { display: none; } }
|
||||
|
|
|
@ -9,7 +9,8 @@ Object {
|
|||
"content": "
|
||||

|
||||
|
||||
We are very happy to introduce [Docusaurus](https://github.com/facebook/docusaurus) to help you manage one or many open source websites.",
|
||||
We are very happy to introduce [Docusaurus](https://github.com/facebook/docusaurus) to help you manage one or many open source websites.
|
||||
",
|
||||
"id": "Docusaurus",
|
||||
"path": "2018/08/17/docusaurus.html",
|
||||
"title": "Docusaurus",
|
||||
|
@ -33,15 +34,17 @@ exports[`replaceAssetsLink does not transform document without valid assets link
|
|||
- [doc2](./doc2.md)
|
||||
|
||||
## Do not replace this
|
||||
|
||||
\`\`\`md
|
||||

|
||||
\`\`\`
|
||||
|
||||
\`\`\`js
|
||||
const doc1 = foo();
|
||||
console.log(\\"[image2](assets/image2.jpg)\\");
|
||||
console.log('[image2](assets/image2.jpg)');
|
||||
const testStr = \`\`;
|
||||
\`\`\`"
|
||||
\`\`\`
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`replaceAssetsLink transform document with valid assets link 1`] = `
|
||||
|
@ -51,15 +54,17 @@ Docusaurus is the best :)
|
|||

|
||||
|
||||
\`\`\`js
|
||||
console.log(\\"Docusaurus\\");
|
||||
console.log('Docusaurus');
|
||||
\`\`\`
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Don't replace the one below
|
||||
\`\`\`md
|
||||
|
||||
\`\`\`md
|
||||

|
||||
\`\`\`"
|
||||
\`\`\`
|
||||
"
|
||||
`;
|
||||
|
|
|
@ -5,6 +5,7 @@ exports[`mdToHtmlify transform link even in subdirectory 1`] = `
|
|||
Test subdirectory file
|
||||
|
||||
### Replace this
|
||||
|
||||
- [doc3](/docs/subdir/doc3)
|
||||
"
|
||||
`;
|
||||
|
@ -16,17 +17,19 @@ Docusaurus is the best :)
|
|||

|
||||
|
||||
\`\`\`js
|
||||
console.log(\\"Docusaurus\\");
|
||||
console.log('Docusaurus');
|
||||
\`\`\`
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Don't replace the one below
|
||||
\`\`\`md
|
||||
|
||||
\`\`\`md
|
||||

|
||||
\`\`\`"
|
||||
\`\`\`
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`mdToHtmlify transform to correct link 1`] = `
|
||||
|
@ -46,15 +49,17 @@ exports[`mdToHtmlify transform to correct link 1`] = `
|
|||
- [doc2](/docs/en/next/doc2)
|
||||
|
||||
## Do not replace this
|
||||
|
||||
\`\`\`md
|
||||

|
||||
\`\`\`
|
||||
|
||||
\`\`\`js
|
||||
const doc1 = foo();
|
||||
console.log(\\"[image2](assets/image2.jpg)\\");
|
||||
console.log('[image2](assets/image2.jpg)');
|
||||
const testStr = \`\`;
|
||||
\`\`\`"
|
||||
\`\`\`
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`mdToHtmlify transforms reference links 1`] = `
|
||||
|
@ -74,13 +79,14 @@ exports[`mdToHtmlify transforms reference links 1`] = `
|
|||
- [doc2][doc2]
|
||||
|
||||
## Do not replace this
|
||||
|
||||
\`\`\`md
|
||||
![image1][image1]
|
||||
\`\`\`
|
||||
|
||||
\`\`\`js
|
||||
const doc1 = foo();
|
||||
console.log(\\"[image2][image2]\\");
|
||||
console.log('[image2][image2]');
|
||||
const testStr = \`![image3][image3]\`;
|
||||
\`\`\`
|
||||
|
||||
|
@ -110,15 +116,17 @@ exports[`replaceAssetsLink does not transform document without valid assets link
|
|||
- [doc2](./doc2.md)
|
||||
|
||||
## Do not replace this
|
||||
|
||||
\`\`\`md
|
||||

|
||||
\`\`\`
|
||||
|
||||
\`\`\`js
|
||||
const doc1 = foo();
|
||||
console.log(\\"[image2](assets/image2.jpg)\\");
|
||||
console.log('[image2](assets/image2.jpg)');
|
||||
const testStr = \`\`;
|
||||
\`\`\`"
|
||||
\`\`\`
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`replaceAssetsLink transform document with valid assets link 1`] = `
|
||||
|
@ -128,15 +136,17 @@ Docusaurus is the best :)
|
|||

|
||||
|
||||
\`\`\`js
|
||||
console.log(\\"Docusaurus\\");
|
||||
console.log('Docusaurus');
|
||||
\`\`\`
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Don't replace the one below
|
||||
\`\`\`md
|
||||
|
||||
\`\`\`md
|
||||

|
||||
\`\`\`"
|
||||
\`\`\`
|
||||
"
|
||||
`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue