2017-02-13 22:43:58 +08:00
|
|
|
# Doc helper
|
|
|
|
|
|
|
|
docsify extends Markdown syntax to make your documents more readable.
|
|
|
|
|
2021-07-31 00:37:52 +08:00
|
|
|
> Note: For the special code syntax cases, it's better to put them within code backticks to avoid any conflict from configurations or emojis.
|
2020-02-14 15:21:07 +08:00
|
|
|
|
2020-10-08 07:00:08 +08:00
|
|
|
## Important content
|
2017-02-13 22:43:58 +08:00
|
|
|
|
2017-03-10 05:19:07 +08:00
|
|
|
Important content like:
|
2017-02-13 22:43:58 +08:00
|
|
|
|
|
|
|
```markdown
|
|
|
|
!> **Time** is money, my friend!
|
|
|
|
```
|
|
|
|
|
2017-03-10 05:19:07 +08:00
|
|
|
is rendered as:
|
2017-02-13 22:43:58 +08:00
|
|
|
|
2017-03-10 05:19:07 +08:00
|
|
|
!> **Time** is money, my friend!
|
2017-02-13 22:43:58 +08:00
|
|
|
|
|
|
|
## General tips
|
|
|
|
|
2017-03-10 05:19:07 +08:00
|
|
|
General tips like:
|
2017-02-13 22:43:58 +08:00
|
|
|
|
|
|
|
```markdown
|
2018-02-11 20:50:48 +08:00
|
|
|
?> _TODO_ unit test
|
2017-02-13 22:43:58 +08:00
|
|
|
```
|
|
|
|
|
2017-03-10 05:19:07 +08:00
|
|
|
are rendered as:
|
2017-02-13 22:43:58 +08:00
|
|
|
|
2018-02-11 20:50:48 +08:00
|
|
|
?> _TODO_ unit test
|
2017-07-10 22:38:26 +08:00
|
|
|
|
|
|
|
## Ignore to compile link
|
|
|
|
|
2021-07-31 00:37:52 +08:00
|
|
|
Sometimes we will use some other relative path for the link, and we have to tell docsify that we don't need to compile this link. For example:
|
2017-07-10 22:38:26 +08:00
|
|
|
|
|
|
|
```md
|
|
|
|
[link](/demo/)
|
|
|
|
```
|
|
|
|
|
2021-07-31 00:37:52 +08:00
|
|
|
It will be compiled to `<a href="/#/demo/">link</a>` and will load `/demo/README.md`. Maybe you want to jump to `/demo/index.html`.
|
2017-07-10 22:38:26 +08:00
|
|
|
|
|
|
|
Now you can do that
|
|
|
|
|
|
|
|
```md
|
2018-02-11 20:50:48 +08:00
|
|
|
[link](/demo/ ':ignore')
|
2017-07-10 22:38:26 +08:00
|
|
|
```
|
2018-02-11 20:50:48 +08:00
|
|
|
|
2021-07-31 00:37:52 +08:00
|
|
|
You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set the title for the link.
|
2017-07-10 22:38:26 +08:00
|
|
|
|
|
|
|
```md
|
2018-02-11 20:50:48 +08:00
|
|
|
[link](/demo/ ':ignore title')
|
2017-07-10 22:38:26 +08:00
|
|
|
|
|
|
|
<a href="/demo/" title="title">link</a>
|
|
|
|
```
|
|
|
|
|
2017-08-10 08:45:49 +08:00
|
|
|
## Set target attribute for link
|
|
|
|
|
|
|
|
```md
|
2018-02-11 20:50:48 +08:00
|
|
|
[link](/demo ':target=_blank')
|
|
|
|
[link](/demo2 ':target=_self')
|
2017-08-10 08:45:49 +08:00
|
|
|
```
|
|
|
|
|
2017-10-30 19:00:31 +08:00
|
|
|
## Disable link
|
|
|
|
|
|
|
|
```md
|
2018-02-11 20:50:48 +08:00
|
|
|
[link](/demo ':disabled')
|
2017-10-30 19:00:31 +08:00
|
|
|
```
|
2017-11-09 13:06:23 +08:00
|
|
|
|
2021-07-31 00:37:52 +08:00
|
|
|
## GitHub Task Lists
|
2017-11-09 13:06:23 +08:00
|
|
|
|
|
|
|
```md
|
2018-06-29 21:27:41 +08:00
|
|
|
- [ ] foo
|
|
|
|
- bar
|
|
|
|
- [x] baz
|
|
|
|
- [] bam <~ not working
|
|
|
|
- [ ] bim
|
|
|
|
- [ ] lim
|
2017-11-09 13:06:23 +08:00
|
|
|
```
|
|
|
|
|
2018-06-29 21:27:41 +08:00
|
|
|
- [ ] foo
|
|
|
|
- bar
|
|
|
|
- [x] baz
|
|
|
|
- [] bam <~ not working
|
|
|
|
- [ ] bim
|
|
|
|
- [ ] lim
|
|
|
|
|
2020-02-09 00:24:18 +08:00
|
|
|
## Image
|
|
|
|
|
|
|
|
### Resizing
|
2018-06-29 21:27:41 +08:00
|
|
|
|
|
|
|
```md
|
2020-02-09 00:24:18 +08:00
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':size=WIDTHxHEIGHT')
|
2018-06-29 21:27:41 +08:00
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':size=50x100')
|
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':size=100')
|
2018-07-05 16:50:21 +08:00
|
|
|
|
|
|
|
<!-- Support percentage -->
|
2018-11-02 07:38:54 +08:00
|
|
|
|
2018-07-05 16:50:21 +08:00
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':size=10%')
|
2018-06-29 21:27:41 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':size=50x100')
|
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':size=100')
|
2018-07-05 16:50:21 +08:00
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':size=10%')
|
2018-11-01 08:07:10 +08:00
|
|
|
|
2020-02-09 00:24:18 +08:00
|
|
|
### Customise class
|
|
|
|
|
|
|
|
```md
|
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':class=someCssClass')
|
|
|
|
```
|
|
|
|
|
|
|
|
### Customise ID
|
|
|
|
|
|
|
|
```md
|
|
|
|
![logo](https://docsify.js.org/_media/icon.svg ':id=someCssId')
|
|
|
|
```
|
|
|
|
|
2018-11-01 08:07:10 +08:00
|
|
|
## Customise ID for headings
|
|
|
|
|
|
|
|
```md
|
2020-07-20 15:11:53 +08:00
|
|
|
### Hello, world! :id=hello-world
|
2018-11-02 07:38:54 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
## Markdown in html tag
|
|
|
|
|
|
|
|
You need to insert a space between the html and markdown content.
|
|
|
|
This is useful for rendering markdown content in the details element.
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
<details>
|
|
|
|
<summary>Self-assessment (Click to expand)</summary>
|
|
|
|
|
|
|
|
- Abc
|
|
|
|
- Abc
|
|
|
|
|
|
|
|
</details>
|
|
|
|
```
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary>Self-assessment (Click to expand)</summary>
|
|
|
|
|
|
|
|
- Abc
|
|
|
|
- Abc
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
2021-07-31 00:37:52 +08:00
|
|
|
Markdown content can also be wrapped in html tags.
|
2018-11-02 07:38:54 +08:00
|
|
|
|
|
|
|
```markdown
|
|
|
|
<div style='color: red'>
|
|
|
|
|
|
|
|
- listitem
|
|
|
|
- listitem
|
|
|
|
- listitem
|
|
|
|
|
|
|
|
</div>
|
|
|
|
```
|
|
|
|
|
|
|
|
<div style='color: red'>
|
|
|
|
|
|
|
|
- Abc
|
|
|
|
- Abc
|
|
|
|
|
|
|
|
</div>
|