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:
Yangshun Tay 2019-12-07 21:56:30 -08:00 committed by GitHub
parent cfc313d7c7
commit 55e676cb25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
141 changed files with 1181 additions and 968 deletions

View file

@ -8,4 +8,4 @@ authorTwitter: endiliey
![Docusaurus](/img/slash-introducing.png)
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.

View file

@ -8,14 +8,15 @@ Docusaurus is the best :)
![image1](assets/image1.png)
```js
console.log("Docusaurus");
console.log('Docusaurus');
```
![image2](assets/image2.jpg)
![image3](assets/image3.gif)
Don't replace the one below
```md
```md
![image4](assets/image4.bmp)
```
```

View file

@ -18,12 +18,13 @@ title: Document 2
- [doc2](./doc2.md)
## Do not replace this
```md
![image1](assets/image1.png)
```
```js
const doc1 = foo();
console.log("[image2](assets/image2.jpg)");
console.log('[image2](assets/image2.jpg)');
const testStr = `![image3](assets/image3.gif)`;
```
```

View file

@ -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]`;
```

View file

@ -6,4 +6,5 @@ title: Document 3
Test subdirectory file
### Replace this
- [doc3](subdir/doc3.md)

View file

@ -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; } }

View file

@ -9,7 +9,8 @@ Object {
"content": "
![Docusaurus](/img/slash-introducing.png)
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
![image1](assets/image1.png)
\`\`\`
\`\`\`js
const doc1 = foo();
console.log(\\"[image2](assets/image2.jpg)\\");
console.log('[image2](assets/image2.jpg)');
const testStr = \`![image3](assets/image3.gif)\`;
\`\`\`"
\`\`\`
"
`;
exports[`replaceAssetsLink transform document with valid assets link 1`] = `
@ -51,15 +54,17 @@ Docusaurus is the best :)
![image1](/blog/assets/image1.png)
\`\`\`js
console.log(\\"Docusaurus\\");
console.log('Docusaurus');
\`\`\`
![image2](/blog/assets/image2.jpg)
![image3](/blog/assets/image3.gif)
Don't replace the one below
\`\`\`md
\`\`\`md
![image4](assets/image4.bmp)
\`\`\`"
\`\`\`
"
`;

View file

@ -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 :)
![image1](assets/image1.png)
\`\`\`js
console.log(\\"Docusaurus\\");
console.log('Docusaurus');
\`\`\`
![image2](assets/image2.jpg)
![image3](assets/image3.gif)
Don't replace the one below
\`\`\`md
\`\`\`md
![image4](assets/image4.bmp)
\`\`\`"
\`\`\`
"
`;
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
![image1](assets/image1.png)
\`\`\`
\`\`\`js
const doc1 = foo();
console.log(\\"[image2](assets/image2.jpg)\\");
console.log('[image2](assets/image2.jpg)');
const testStr = \`![image3](assets/image3.gif)\`;
\`\`\`"
\`\`\`
"
`;
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
![image1](assets/image1.png)
\`\`\`
\`\`\`js
const doc1 = foo();
console.log(\\"[image2](assets/image2.jpg)\\");
console.log('[image2](assets/image2.jpg)');
const testStr = \`![image3](assets/image3.gif)\`;
\`\`\`"
\`\`\`
"
`;
exports[`replaceAssetsLink transform document with valid assets link 1`] = `
@ -128,15 +136,17 @@ Docusaurus is the best :)
![image1](/docs/assets/image1.png)
\`\`\`js
console.log(\\"Docusaurus\\");
console.log('Docusaurus');
\`\`\`
![image2](/docs/assets/image2.jpg)
![image3](/docs/assets/image3.gif)
Don't replace the one below
\`\`\`md
\`\`\`md
![image4](assets/image4.bmp)
\`\`\`"
\`\`\`
"
`;