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

@ -10,24 +10,27 @@ description: This is custom description
Click the `clear` link to start with a clean slate, or get the `permalink` to share or save your results.
***
---
# h1 Heading
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
## Horizontal Rules
___
---
***
***
---
---
## Typographic replacements
@ -45,14 +48,13 @@ Remarkable -- awesome
'Smartypants, single quotes'
## Emphasis
**This is bold text**
__This is bold text__
**This is bold text**
*This is italic text*
_This is italic text_
_This is italic text_

View file

@ -11,18 +11,16 @@ Like links, Images also have a footnote style syntax
With a reference later in the document defining the URL location:
[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat"
[id]: https://octodex.github.com/images/dojocat.jpg 'The Dojocat'
## Links
[link text](http://dev.nodeca.com)
[link with title](http://nodeca.github.io/pica/demo/ "title text!")
[link with title](http://nodeca.github.io/pica/demo/ 'title text!')
Autoconverted link https://github.com/nodeca/pica (enable linkify to see)
## Footnotes
Footnote 1 link[^first].
@ -35,21 +33,19 @@ Duplicated footnote reference[^second].
[^first]: Footnote **can have markup**
and multiple paragraphs.
and multiple paragraphs.
[^second]: Footnote text.
## Definition lists
Term 1
: Definition 1
with lazy continuation.
: Definition 1 with lazy continuation.
Term 2 with *inline markup*
Term 2 with _inline markup_
: Definition 2
: Definition 2
{ some code, part of Definition 2 }
@ -57,13 +53,9 @@ Term 2 with *inline markup*
_Compact style:_
Term 1
~ Definition 1
Term 2
~ Definition 2a
~ Definition 2b
Term 1 ~ Definition 1
Term 2 ~ Definition 2a ~ Definition 2b
## Abbreviations
@ -71,4 +63,4 @@ This is HTML abbreviation example.
It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.
*[HTML]: Hyper Text Markup Language
\*[HTML]: Hyper Text Markup Language

View file

@ -7,11 +7,9 @@ Hi, Endilie here :)
## Relative links
Replace this
[foo](foo/bar.md)
Replace this [foo](foo/bar.md)
Can't replace this
[file](file.md)
Can't replace this [file](file.md)
Do not replace below
@ -22,21 +20,22 @@ Do not replace below
## Blockquotes
> Blockquotes can also be nested...
>> ...by using additional greater-than signs right next to each other...
>
> > ...by using additional greater-than signs right next to each other...
> >
> > > ...or with spaces between arrows.
## Lists
Unordered
+ Create a list by starting a line with `+`, `-`, or `*`
+ Sub-lists are made by indenting 2 spaces:
- Create a list by starting a line with `+`, `-`, or `*`
- Sub-lists are made by indenting 2 spaces:
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Ac tristique libero volutpat at
* Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy!
- Very easy!
Ordered
@ -44,9 +43,8 @@ Ordered
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
1. You can use sequential numbers...
1. ...or keep all the numbers as `1.`
1) You can use sequential numbers...
1) ...or keep all the numbers as `1.`
Start numbering with offset:

View file

@ -3,4 +3,4 @@ custom_edit_url: https://github.com/customUrl/docs/lorem.md
unrelated_frontmatter: won't be part of metadata
---
Lorem ipsum.
Lorem ipsum.

View file

@ -3,9 +3,11 @@
![image1](assets/image1.png)
# Don't replace inside fenced codeblock
```md
![doc4](doc4.md)
```
### Non-existing Docs
- [hahaha](hahaha.md)

View file

@ -7,4 +7,4 @@
## Repeating Docs
- [doc1](doc1.md)
- [doc2](./doc2.md)
- [doc2](./doc2.md)

View file

@ -9,6 +9,7 @@
- [doc2][doc2]
## Do not replace this
```md
![image1][image1]
```

View file

@ -1,2 +1,3 @@
### Relative linking
- [doc1](../doc2.md)

View file

@ -3,4 +3,5 @@
- [doc1](subdir/doc1.md)
### With hash
- [doc2](doc2.md#existing-docs)
- [doc2](doc2.md#existing-docs)

View file

@ -1,2 +1,3 @@
### Relative linking
- [doc1](../doc2.md)

View file

@ -6,17 +6,20 @@ exports[`transform nothing 1`] = `
![image1](assets/image1.png)
# Don't replace inside fenced codeblock
\`\`\`md
![doc4](doc4.md)
\`\`\`
### Non-existing Docs
- [hahaha](hahaha.md)
"
`;
exports[`transform relative links 1`] = `
"### Relative linking
- [doc1](/docs/doc2)
"
`;
@ -31,7 +34,8 @@ exports[`transform to correct links 1`] = `
## Repeating Docs
- [doc1](/docs/doc1)
- [doc2](/docs/doc2)"
- [doc2](/docs/doc2)
"
`;
exports[`transforms absolute links in versioned docs 1`] = `
@ -40,7 +44,9 @@ exports[`transforms absolute links in versioned docs 1`] = `
- [doc1](/docs/1.0.0/subdir/doc1)
### With hash
- [doc2](/docs/1.0.0/doc2#existing-docs)"
- [doc2](/docs/1.0.0/doc2#existing-docs)
"
`;
exports[`transforms reference links 1`] = `
@ -55,6 +61,7 @@ exports[`transforms reference links 1`] = `
- [doc2][doc2]
## Do not replace this
\`\`\`md
![image1][image1]
\`\`\`
@ -67,6 +74,7 @@ exports[`transforms reference links 1`] = `
exports[`transforms relative links in versioned docs 1`] = `
"### Relative linking
- [doc1](/docs/1.0.0/doc2)
"
`;