Compare commits
87 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d3246a26f |
||
|
|
8ea4865c84 | ||
|
|
676f84cffa | ||
|
|
7bdcadc7d7 | ||
|
|
5bd24fb83c | ||
|
|
76cc0f672b | ||
|
|
3f50381090 | ||
|
|
b847c20cab | ||
|
|
ce829b24d6 |
||
|
|
1ce53cf9ec |
||
|
|
bc1d8e4bda | ||
|
|
78f5564a30 | ||
|
|
6cc069cb9f | ||
|
|
d355272461 | ||
|
|
af161cd3b4 | ||
|
|
5bcb016bee | ||
|
|
b38c2065e0 | ||
|
|
e5bab8d967 | ||
|
|
da3e2d7b18 | ||
|
|
b93a667f24 | ||
|
|
e8d850c9ba | ||
|
|
514a027991 |
||
|
|
314e2d9d39 |
||
|
|
a86de3d81a | ||
|
|
5f960102e7 | ||
|
|
0bd5c8b020 | ||
|
|
044a5ec2b8 | ||
|
|
b15eccfac0 | ||
|
|
4e0298088b |
||
|
|
09616dec06 | ||
|
|
f74b53f53e |
||
|
|
bba44fb536 |
||
|
|
270fa6cb41 |
||
|
|
24e61f5e2f |
||
|
|
ca8ae50717 | ||
|
|
31654f12ec | ||
|
|
d80aa2189b |
||
|
|
21cde83949 |
||
|
|
c1d4961a64 |
||
|
|
2039e0dd1c | ||
|
|
d5910bd1f9 |
||
|
|
a35531967a | ||
|
|
dac0bfec6c | ||
|
|
01ea44106b | ||
|
|
11ea1f8d12 | ||
|
|
bc4d06bb16 | ||
|
|
29d9cda3de | ||
|
|
140bf10377 | ||
|
|
dfd31b5de7 | ||
|
|
d1c72686bb | ||
|
|
8cd786c9d5 |
||
|
|
b53571810b | ||
|
|
cb53106fa7 |
||
|
|
fd86c727af | ||
|
|
69ef489210 | ||
|
|
c3345ba20c | ||
|
|
1447c8a40a | ||
|
|
3b952ac7c3 | ||
|
|
99dbaa3050 | ||
|
|
6ac7bace21 | ||
|
|
28beff80f7 | ||
|
|
049726e11e | ||
|
|
a257a4ab4e | ||
|
|
a07a613312 | ||
|
|
4db8cd6abf | ||
|
|
a72e7490c3 | ||
|
|
cc79e2e992 | ||
|
|
5b6525b8f1 | ||
|
|
aa719e3a47 | ||
|
|
22a5927eaf | ||
|
|
5ab9d8cb87 | ||
|
|
f84242d380 | ||
|
|
1a945d445a |
||
|
|
81ec7c763b | ||
|
|
d91a66cadd | ||
|
|
58b130996e | ||
|
|
ee800a6572 | ||
|
|
6daecc8a68 | ||
|
|
325ecd08e6 | ||
|
|
9a09458eee | ||
|
|
fdd8826b3b |
||
|
|
fcd1087c16 |
||
|
|
ab19b13210 | ||
|
|
5fcf210dd1 | ||
|
|
2edf47ec73 | ||
|
|
b52607dec9 | ||
|
|
e89a2b3fea |
78 changed files with 2335 additions and 7492 deletions
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
<!-- Love docsify? Please consider supporting our collective:
|
|
||||||
👉 https://opencollective.com/docsify/donate -->
|
|
||||||
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
|
||||||
|
---
|
||||||
|
<!-- Please don't delete this template or we'll close your issue -->
|
||||||
|
<!-- Please use English language -->
|
||||||
|
<!-- Before creating an issue please make sure you are using the latest version of Docsify. -->
|
||||||
|
<!-- Please ask questions on StackOverflow: https://stackoverflow.com/questions/ask?tags=docsify -->
|
||||||
|
|
||||||
|
## Bug Report
|
||||||
|
|
||||||
|
#### Steps to reproduce
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### What is current behaviour
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### What is the expected behaviour
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Other relevant information
|
||||||
|
|
||||||
|
<!-- (Update "[ ]" to "[x]" to check a box) -->
|
||||||
|
- [ ] Bug does still occur when all/other plugins are disabled?
|
||||||
|
|
||||||
|
- Your OS:
|
||||||
|
- Node.js version:
|
||||||
|
- npm/yarn version:
|
||||||
|
- Browser version:
|
||||||
|
- Docsify version:
|
||||||
|
- Docsify plugins:
|
||||||
|
|
||||||
|
<!-- Love docsify? Please consider supporting our collective:
|
||||||
|
👉 https://opencollective.com/docsify/donate -->
|
||||||
25
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
25
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
|
||||||
|
---
|
||||||
|
<!-- Please don't delete this template or we'll close your issue -->
|
||||||
|
<!-- Please use English language -->
|
||||||
|
<!-- Before creating an issue please make sure you are using the latest version of Docsify. -->
|
||||||
|
<!-- Please ask questions on StackOverflow 👉 https://stackoverflow.com/questions/ask?tags=docsify -->
|
||||||
|
|
||||||
|
## Feature request
|
||||||
|
|
||||||
|
#### What problem does this feature solve?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### What does the proposed API look like?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### How should this be implemented in your opinion?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Are you willing to work on this yourself?
|
||||||
55
.github/PULL_REQUEST_TEMPLATE.md
vendored
55
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
|
@ -1,5 +1,54 @@
|
||||||
Please makes sure these boxes are checked before submitting your PR, thank you!
|
<!-- Please use English language -->
|
||||||
|
<!-- Please don't delete this template -->
|
||||||
|
|
||||||
|
<!-- PULL REQUEST TEMPLATE -->
|
||||||
|
<!-- (Update "[ ]" to "[x]" to check a box) -->
|
||||||
|
|
||||||
|
**Summary**
|
||||||
|
|
||||||
|
**What kind of change does this PR introduce?** (check at least one)
|
||||||
|
|
||||||
|
- [ ] Bugfix
|
||||||
|
- [ ] Feature
|
||||||
|
- [ ] Code style update
|
||||||
|
- [ ] Refactor
|
||||||
|
- [ ] Docs
|
||||||
|
- [ ] Build-related changes
|
||||||
|
- [ ] Other, please describe:
|
||||||
|
|
||||||
|
If changing the UI of default theme, please provide the **before/after** screenshot:
|
||||||
|
|
||||||
|
**Does this PR introduce a breaking change?** (check one)
|
||||||
|
|
||||||
|
- [ ] Yes
|
||||||
|
- [ ] No
|
||||||
|
|
||||||
|
If yes, please describe the impact and migration path for existing applications:
|
||||||
|
|
||||||
|
**The PR fulfills these requirements:**
|
||||||
|
|
||||||
|
- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
|
||||||
|
|
||||||
|
You have tested in the following browsers: (Providing a detailed version will be better.)
|
||||||
|
|
||||||
|
- [ ] Chrome
|
||||||
|
- [ ] Firefox
|
||||||
|
- [ ] Safari
|
||||||
|
- [ ] Edge
|
||||||
|
- [ ] IE
|
||||||
|
|
||||||
|
If adding a **new feature**, the PR's description includes:
|
||||||
|
|
||||||
|
- [ ] A convincing reason for adding this feature
|
||||||
|
- [ ] Related documents have been updated
|
||||||
|
- [ ] Related tests have been updated
|
||||||
|
|
||||||
|
To avoid wasting your time, it's best to open a **feature request issue** first and wait for approval before working on it.
|
||||||
|
|
||||||
|
|
||||||
|
**Other information:**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
* [ ] Make sure you are merging your commits to `master` branch.
|
|
||||||
* [ ] Add some descriptions and refer relative issues for you PR.
|
|
||||||
* [ ] DO NOT include files inside `lib` directory.
|
* [ ] DO NOT include files inside `lib` directory.
|
||||||
|
|
||||||
|
|
|
||||||
10
.gitignore
vendored
10
.gitignore
vendored
|
|
@ -1,7 +1,9 @@
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/themes/*
|
|
||||||
!.gitkeep
|
|
||||||
node_modules
|
|
||||||
/lib/
|
|
||||||
.idea
|
.idea
|
||||||
|
node_modules
|
||||||
|
themes/
|
||||||
|
lib/
|
||||||
|
|
||||||
|
# exceptions
|
||||||
|
!.gitkeep
|
||||||
416
CHANGELOG.md
416
CHANGELOG.md
|
|
@ -1,164 +1,234 @@
|
||||||
|
<a name="4.9.4"></a>
|
||||||
|
## [4.9.4](https://github.com/docsifyjs/docsify/compare/v4.9.2...v4.9.4) (2019-05-05)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.9.2"></a>
|
||||||
|
## [4.9.2](https://github.com/docsifyjs/docsify/compare/v4.9.1...v4.9.2) (2019-04-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* re-render gitalk when router changed ([11ea1f8](https://github.com/docsifyjs/docsify/commit/11ea1f8))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* allows relative path, fixed [#590](https://github.com/docsifyjs/docsify/issues/590) ([31654f1](https://github.com/docsifyjs/docsify/commit/31654f1))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.9.1"></a>
|
||||||
|
## [4.9.1](https://github.com/docsifyjs/docsify/compare/v4.9.0...v4.9.1) (2019-02-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* github assets url ([#774](https://github.com/docsifyjs/docsify/issues/774)) ([140bf10](https://github.com/docsifyjs/docsify/commit/140bf10))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.9.0"></a>
|
||||||
|
# [4.9.0](https://github.com/docsifyjs/docsify/compare/v4.8.6...v4.9.0) (2019-02-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* task list rendering (Fix [#749](https://github.com/docsifyjs/docsify/issues/749)) ([#757](https://github.com/docsifyjs/docsify/issues/757)) ([69ef489](https://github.com/docsifyjs/docsify/commit/69ef489))
|
||||||
|
* upgrade npm-run-all ([049726e](https://github.com/docsifyjs/docsify/commit/049726e))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **search-plugin:** add namespace option ([#706](https://github.com/docsifyjs/docsify/issues/706)) ([28beff8](https://github.com/docsifyjs/docsify/commit/28beff8))
|
||||||
|
* Add new theme "dolphin" ([#735](https://github.com/docsifyjs/docsify/issues/735)) ([c3345ba](https://github.com/docsifyjs/docsify/commit/c3345ba))
|
||||||
|
* Provide code fragments feature ([#748](https://github.com/docsifyjs/docsify/issues/748)) ([1447c8a](https://github.com/docsifyjs/docsify/commit/1447c8a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.8.6"></a>
|
||||||
|
## [4.8.6](https://github.com/docsifyjs/docsify/compare/v4.8.5...v4.8.6) (2018-11-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* IE10 compatibility ([#691](https://github.com/docsifyjs/docsify/issues/691)) ([4db8cd6](https://github.com/docsifyjs/docsify/commit/4db8cd6))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.8.5"></a>
|
||||||
|
## [4.8.5](https://github.com/docsifyjs/docsify/compare/v4.8.4...v4.8.5) (2018-11-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* expose version info for Docsify, fixed [#641](https://github.com/docsifyjs/docsify/issues/641) ([aa719e3](https://github.com/docsifyjs/docsify/commit/aa719e3))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.8.4"></a>
|
||||||
|
## [4.8.4](https://github.com/docsifyjs/docsify/compare/v4.8.3...v4.8.4) (2018-11-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **cover:** Compatible with legacy styles, fixed [#677](https://github.com/docsifyjs/docsify/issues/677) ([#678](https://github.com/docsifyjs/docsify/issues/678)) ([1a945d4](https://github.com/docsifyjs/docsify/commit/1a945d4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.8.3"></a>
|
||||||
|
|
||||||
|
## [4.8.3](https://github.com/docsifyjs/docsify/compare/v4.8.2...v4.8.3) (2018-11-01)
|
||||||
|
|
||||||
|
Fix the last release files has the old version marked...
|
||||||
|
|
||||||
|
<a name="4.8.2"></a>
|
||||||
|
|
||||||
|
## [4.8.2](https://github.com/docsifyjs/docsify/compare/v4.8.1...v4.8.2) (2018-11-01)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- cover button style, fixed [#670](https://github.com/docsifyjs/docsify/issues/670), fixed [#665](https://github.com/docsifyjs/docsify/issues/665) ([#675](https://github.com/docsifyjs/docsify/issues/675)) ([fcd1087](https://github.com/docsifyjs/docsify/commit/fcd1087))
|
||||||
|
- update match regex ([#669](https://github.com/docsifyjs/docsify/issues/669)) ([2edf47e](https://github.com/docsifyjs/docsify/commit/2edf47e))
|
||||||
|
- use copy of cached value ([#668](https://github.com/docsifyjs/docsify/issues/668)) ([5fcf210](https://github.com/docsifyjs/docsify/commit/5fcf210))
|
||||||
|
- **compiler:** import prism-markup-templating, fixed [#672](https://github.com/docsifyjs/docsify/issues/672) ([#676](https://github.com/docsifyjs/docsify/issues/676)) ([fdd8826](https://github.com/docsifyjs/docsify/commit/fdd8826))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- add heading config id ([#671](https://github.com/docsifyjs/docsify/issues/671)) ([ab19b13](https://github.com/docsifyjs/docsify/commit/ab19b13))
|
||||||
|
|
||||||
<a name="4.8.1"></a>
|
<a name="4.8.1"></a>
|
||||||
|
|
||||||
## [4.8.1](https://github.com/docsifyjs/docsify/compare/v4.8.0...v4.8.1) (2018-10-31)
|
## [4.8.1](https://github.com/docsifyjs/docsify/compare/v4.8.0...v4.8.1) (2018-10-31)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* ssr package dep, fixed [#605](https://github.com/docsifyjs/docsify/issues/605) ([2bc880d](https://github.com/docsifyjs/docsify/commit/2bc880d))
|
- ssr package dep, fixed [#605](https://github.com/docsifyjs/docsify/issues/605) ([2bc880d](https://github.com/docsifyjs/docsify/commit/2bc880d))
|
||||||
* **compiler:** extra quotes for codeblock ([4f588e0](https://github.com/docsifyjs/docsify/commit/4f588e0))
|
- **compiler:** extra quotes for codeblock ([4f588e0](https://github.com/docsifyjs/docsify/commit/4f588e0))
|
||||||
* **compiler:** prevent render of html code in paragraph, fixed [#663](https://github.com/docsifyjs/docsify/issues/663) ([d35059d](https://github.com/docsifyjs/docsify/commit/d35059d))
|
- **compiler:** prevent render of html code in paragraph, fixed [#663](https://github.com/docsifyjs/docsify/issues/663) ([d35059d](https://github.com/docsifyjs/docsify/commit/d35059d))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* upgrade PrismJS, fixed [#534](https://github.com/docsifyjs/docsify/issues/534) ([4805cb5](https://github.com/docsifyjs/docsify/commit/4805cb5))
|
- upgrade PrismJS, fixed [#534](https://github.com/docsifyjs/docsify/issues/534) ([4805cb5](https://github.com/docsifyjs/docsify/commit/4805cb5))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.8.0"></a>
|
<a name="4.8.0"></a>
|
||||||
|
|
||||||
# [4.8.0](https://github.com/docsifyjs/docsify/compare/v4.7.1...v4.8.0) (2018-10-31)
|
# [4.8.0](https://github.com/docsifyjs/docsify/compare/v4.7.1...v4.8.0) (2018-10-31)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* Cache TOC for later usage in the case of cached file html ([#649](https://github.com/docsifyjs/docsify/issues/649)) ([9e86017](https://github.com/docsifyjs/docsify/commit/9e86017))
|
- Cache TOC for later usage in the case of cached file html ([#649](https://github.com/docsifyjs/docsify/issues/649)) ([9e86017](https://github.com/docsifyjs/docsify/commit/9e86017))
|
||||||
* improve external script plugin ([#632](https://github.com/docsifyjs/docsify/issues/632)) ([50c2434](https://github.com/docsifyjs/docsify/commit/50c2434))
|
- improve external script plugin ([#632](https://github.com/docsifyjs/docsify/issues/632)) ([50c2434](https://github.com/docsifyjs/docsify/commit/50c2434))
|
||||||
* missing variable declaration ([#660](https://github.com/docsifyjs/docsify/issues/660)) ([1ce37bd](https://github.com/docsifyjs/docsify/commit/1ce37bd))
|
- missing variable declaration ([#660](https://github.com/docsifyjs/docsify/issues/660)) ([1ce37bd](https://github.com/docsifyjs/docsify/commit/1ce37bd))
|
||||||
* Remove target for mailto links ([#652](https://github.com/docsifyjs/docsify/issues/652)) ([18f0f03](https://github.com/docsifyjs/docsify/commit/18f0f03))
|
- Remove target for mailto links ([#652](https://github.com/docsifyjs/docsify/issues/652)) ([18f0f03](https://github.com/docsifyjs/docsify/commit/18f0f03))
|
||||||
* Update getAllPath query selector ([#653](https://github.com/docsifyjs/docsify/issues/653)) ([f6f4e32](https://github.com/docsifyjs/docsify/commit/f6f4e32))
|
- Update getAllPath query selector ([#653](https://github.com/docsifyjs/docsify/issues/653)) ([f6f4e32](https://github.com/docsifyjs/docsify/commit/f6f4e32))
|
||||||
* Update vue.styl ([#634](https://github.com/docsifyjs/docsify/issues/634)) ([bf060be](https://github.com/docsifyjs/docsify/commit/bf060be))
|
- Update vue.styl ([#634](https://github.com/docsifyjs/docsify/issues/634)) ([bf060be](https://github.com/docsifyjs/docsify/commit/bf060be))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* Add docsify version to $window.docsify object ([#641](https://github.com/docsifyjs/docsify/issues/641)) ([94bc415](https://github.com/docsifyjs/docsify/commit/94bc415)), closes [#521](https://github.com/docsifyjs/docsify/issues/521)
|
- Add docsify version to $window.docsify object ([#641](https://github.com/docsifyjs/docsify/issues/641)) ([94bc415](https://github.com/docsifyjs/docsify/commit/94bc415)), closes [#521](https://github.com/docsifyjs/docsify/issues/521)
|
||||||
* **compiler:** support embedded mermaid ([#629](https://github.com/docsifyjs/docsify/issues/629)) ([42ea8af](https://github.com/docsifyjs/docsify/commit/42ea8af))
|
- **compiler:** support embedded mermaid ([#629](https://github.com/docsifyjs/docsify/issues/629)) ([42ea8af](https://github.com/docsifyjs/docsify/commit/42ea8af))
|
||||||
* Add hideOtherSidebarContent option ([#661](https://github.com/docsifyjs/docsify/issues/661)) ([4a23c4a](https://github.com/docsifyjs/docsify/commit/4a23c4a))
|
- Add hideOtherSidebarContent option ([#661](https://github.com/docsifyjs/docsify/issues/661)) ([4a23c4a](https://github.com/docsifyjs/docsify/commit/4a23c4a))
|
||||||
* Allow base64, external, and relative logo values ([#642](https://github.com/docsifyjs/docsify/issues/642)) ([0a0802a](https://github.com/docsifyjs/docsify/commit/0a0802a)), closes [#577](https://github.com/docsifyjs/docsify/issues/577)
|
- Allow base64, external, and relative logo values ([#642](https://github.com/docsifyjs/docsify/issues/642)) ([0a0802a](https://github.com/docsifyjs/docsify/commit/0a0802a)), closes [#577](https://github.com/docsifyjs/docsify/issues/577)
|
||||||
* upgrade marked to 0.5.x, fixed [#645](https://github.com/docsifyjs/docsify/issues/645), close [#644](https://github.com/docsifyjs/docsify/issues/644) ([#662](https://github.com/docsifyjs/docsify/issues/662)) ([a39b214](https://github.com/docsifyjs/docsify/commit/a39b214))
|
- upgrade marked to 0.5.x, fixed [#645](https://github.com/docsifyjs/docsify/issues/645), close [#644](https://github.com/docsifyjs/docsify/issues/644) ([#662](https://github.com/docsifyjs/docsify/issues/662)) ([a39b214](https://github.com/docsifyjs/docsify/commit/a39b214))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.7.1"></a>
|
<a name="4.7.1"></a>
|
||||||
|
|
||||||
## [4.7.1](https://github.com/docsifyjs/docsify/compare/v4.7.0...v4.7.1) (2018-08-30)
|
## [4.7.1](https://github.com/docsifyjs/docsify/compare/v4.7.0...v4.7.1) (2018-08-30)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.7.0"></a>
|
<a name="4.7.0"></a>
|
||||||
|
|
||||||
# [4.7.0](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.7.0) (2018-06-29)
|
# [4.7.0](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.7.0) (2018-06-29)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* alldow addition content in sidebar, fix [#518](https://github.com/QingWei-Li/docsify/issues/518), fix 539 ([#543](https://github.com/QingWei-Li/docsify/issues/543)) ([04b36b0](https://github.com/QingWei-Li/docsify/commit/04b36b0))
|
- alldow addition content in sidebar, fix [#518](https://github.com/QingWei-Li/docsify/issues/518), fix 539 ([#543](https://github.com/QingWei-Li/docsify/issues/543)) ([04b36b0](https://github.com/QingWei-Li/docsify/commit/04b36b0))
|
||||||
* async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
|
- async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
|
||||||
* loading embed files synchronously, fixed [#525](https://github.com/QingWei-Li/docsify/issues/525), fixed [#527](https://github.com/QingWei-Li/docsify/issues/527) ([#544](https://github.com/QingWei-Li/docsify/issues/544)) ([feea7f9](https://github.com/QingWei-Li/docsify/commit/feea7f9))
|
- loading embed files synchronously, fixed [#525](https://github.com/QingWei-Li/docsify/issues/525), fixed [#527](https://github.com/QingWei-Li/docsify/issues/527) ([#544](https://github.com/QingWei-Li/docsify/issues/544)) ([feea7f9](https://github.com/QingWei-Li/docsify/commit/feea7f9))
|
||||||
* path include chinese character cause hilight bug ([#556](https://github.com/QingWei-Li/docsify/issues/556)) ([a5f333a](https://github.com/QingWei-Li/docsify/commit/a5f333a))
|
- path include chinese character cause hilight bug ([#556](https://github.com/QingWei-Li/docsify/issues/556)) ([a5f333a](https://github.com/QingWei-Li/docsify/commit/a5f333a))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add logo option, [#264](https://github.com/QingWei-Li/docsify/issues/264) ([#541](https://github.com/QingWei-Li/docsify/issues/541)) ([ee72dd0](https://github.com/QingWei-Li/docsify/commit/ee72dd0))
|
- add logo option, [#264](https://github.com/QingWei-Li/docsify/issues/264) ([#541](https://github.com/QingWei-Li/docsify/issues/541)) ([ee72dd0](https://github.com/QingWei-Li/docsify/commit/ee72dd0))
|
||||||
* add unpkg field, close [#531](https://github.com/QingWei-Li/docsify/issues/531) ([#558](https://github.com/QingWei-Li/docsify/issues/558)) ([5c0de0a](https://github.com/QingWei-Li/docsify/commit/5c0de0a))
|
- add unpkg field, close [#531](https://github.com/QingWei-Li/docsify/issues/531) ([#558](https://github.com/QingWei-Li/docsify/issues/558)) ([5c0de0a](https://github.com/QingWei-Li/docsify/commit/5c0de0a))
|
||||||
* support image resizing, resolve [#508](https://github.com/QingWei-Li/docsify/issues/508) ([#545](https://github.com/QingWei-Li/docsify/issues/545)) ([3a7ad62](https://github.com/QingWei-Li/docsify/commit/3a7ad62))
|
- support image resizing, resolve [#508](https://github.com/QingWei-Li/docsify/issues/508) ([#545](https://github.com/QingWei-Li/docsify/issues/545)) ([3a7ad62](https://github.com/QingWei-Li/docsify/commit/3a7ad62))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.10"></a>
|
<a name="4.6.10"></a>
|
||||||
|
|
||||||
## [4.6.10](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.6.10) (2018-03-25)
|
## [4.6.10](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.6.10) (2018-03-25)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
|
- async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.9"></a>
|
<a name="4.6.9"></a>
|
||||||
|
|
||||||
## [4.6.9](https://github.com/QingWei-Li/docsify/compare/v4.6.8...v4.6.9) (2018-03-10)
|
## [4.6.9](https://github.com/QingWei-Li/docsify/compare/v4.6.8...v4.6.9) (2018-03-10)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* upgrade medium-zoom, fixed [#417](https://github.com/QingWei-Li/docsify/issues/417) ([6a3d69a](https://github.com/QingWei-Li/docsify/commit/6a3d69a))
|
- upgrade medium-zoom, fixed [#417](https://github.com/QingWei-Li/docsify/issues/417) ([6a3d69a](https://github.com/QingWei-Li/docsify/commit/6a3d69a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.8"></a>
|
<a name="4.6.8"></a>
|
||||||
|
|
||||||
## [4.6.8](https://github.com/QingWei-Li/docsify/compare/v4.6.7...v4.6.8) (2018-03-06)
|
## [4.6.8](https://github.com/QingWei-Li/docsify/compare/v4.6.7...v4.6.8) (2018-03-06)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* resolve path of image and embed files, fixed [#412](https://github.com/QingWei-Li/docsify/issues/412) ([bfd0d18](https://github.com/QingWei-Li/docsify/commit/bfd0d18))
|
- resolve path of image and embed files, fixed [#412](https://github.com/QingWei-Li/docsify/issues/412) ([bfd0d18](https://github.com/QingWei-Li/docsify/commit/bfd0d18))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.7"></a>
|
<a name="4.6.7"></a>
|
||||||
|
|
||||||
## [4.6.7](https://github.com/QingWei-Li/docsify/compare/v4.6.6...v4.6.7) (2018-03-03)
|
## [4.6.7](https://github.com/QingWei-Li/docsify/compare/v4.6.6...v4.6.7) (2018-03-03)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* layout css, fixed [#409](https://github.com/QingWei-Li/docsify/issues/409) ([aeb692e](https://github.com/QingWei-Li/docsify/commit/aeb692e))
|
- layout css, fixed [#409](https://github.com/QingWei-Li/docsify/issues/409) ([aeb692e](https://github.com/QingWei-Li/docsify/commit/aeb692e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.6"></a>
|
<a name="4.6.6"></a>
|
||||||
|
|
||||||
## [4.6.6](https://github.com/QingWei-Li/docsify/compare/v4.6.5...v4.6.6) (2018-03-03)
|
## [4.6.6](https://github.com/QingWei-Li/docsify/compare/v4.6.5...v4.6.6) (2018-03-03)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.5"></a>
|
<a name="4.6.5"></a>
|
||||||
|
|
||||||
## [4.6.5](https://github.com/QingWei-Li/docsify/compare/v4.6.4...v4.6.5) (2018-03-03)
|
## [4.6.5](https://github.com/QingWei-Li/docsify/compare/v4.6.4...v4.6.5) (2018-03-03)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **navbar:** Now Navbar isn't append to DOM when loadNavbar is falsy ([#407](https://github.com/QingWei-Li/docsify/issues/407)) ([0933445](https://github.com/QingWei-Li/docsify/commit/0933445))
|
- **navbar:** Now Navbar isn't append to DOM when loadNavbar is falsy ([#407](https://github.com/QingWei-Li/docsify/issues/407)) ([0933445](https://github.com/QingWei-Li/docsify/commit/0933445))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **config:** Add 404 page options. ([#406](https://github.com/QingWei-Li/docsify/issues/406)) ([9b3b445](https://github.com/QingWei-Li/docsify/commit/9b3b445))
|
- **config:** Add 404 page options. ([#406](https://github.com/QingWei-Li/docsify/issues/406)) ([9b3b445](https://github.com/QingWei-Li/docsify/commit/9b3b445))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.4"></a>
|
<a name="4.6.4"></a>
|
||||||
## [4.6.4](https://github.com/QingWei-Li/docsify/compare/v4.6.3...v4.6.4) (2018-03-01)
|
|
||||||
|
|
||||||
|
## [4.6.4](https://github.com/QingWei-Li/docsify/compare/v4.6.3...v4.6.4) (2018-03-01)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **render:** Disable markdown parsing when the file is an HTML ([#403](https://github.com/QingWei-Li/docsify/issues/403)) ([278a75e](https://github.com/QingWei-Li/docsify/commit/278a75e))
|
- **render:** Disable markdown parsing when the file is an HTML ([#403](https://github.com/QingWei-Li/docsify/issues/403)) ([278a75e](https://github.com/QingWei-Li/docsify/commit/278a75e))
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **fetch:** Add fallback languages configuration. ([#402](https://github.com/QingWei-Li/docsify/issues/402)) ([ecc0e04](https://github.com/QingWei-Li/docsify/commit/ecc0e04))
|
- **fetch:** Add fallback languages configuration. ([#402](https://github.com/QingWei-Li/docsify/issues/402)) ([ecc0e04](https://github.com/QingWei-Li/docsify/commit/ecc0e04))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.3"></a>
|
<a name="4.6.3"></a>
|
||||||
|
|
||||||
## [4.6.3](https://github.com/QingWei-Li/docsify/compare/v4.6.2...v4.6.3) (2018-02-15)
|
## [4.6.3](https://github.com/QingWei-Li/docsify/compare/v4.6.2...v4.6.3) (2018-02-15)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **hook:** beforeEach don\'t work, fixed [#393](https://github.com/QingWei-Li/docsify/issues/393) ([6a09059](https://github.com/QingWei-Li/docsify/commit/6a09059))
|
- **hook:** beforeEach don\'t work, fixed [#393](https://github.com/QingWei-Li/docsify/issues/393) ([6a09059](https://github.com/QingWei-Li/docsify/commit/6a09059))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.2"></a>
|
<a name="4.6.2"></a>
|
||||||
## [4.6.2](https://github.com/QingWei-Li/docsify/compare/v4.6.1...v4.6.2) (2018-02-14)
|
|
||||||
|
|
||||||
|
## [4.6.2](https://github.com/QingWei-Li/docsify/compare/v4.6.1...v4.6.2) (2018-02-14)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **embed:** broken in IE, fixed [#389](https://github.com/QingWei-Li/docsify/issues/389), fixed [#391](https://github.com/QingWei-Li/docsify/issues/391) ([45a7464](https://github.com/QingWei-Li/docsify/commit/45a7464))
|
- **embed:** broken in IE, fixed [#389](https://github.com/QingWei-Li/docsify/issues/389), fixed [#391](https://github.com/QingWei-Li/docsify/issues/391) ([45a7464](https://github.com/QingWei-Li/docsify/commit/45a7464))
|
||||||
* **embed:** init value ([890a7bf](https://github.com/QingWei-Li/docsify/commit/890a7bf))
|
- **embed:** init value ([890a7bf](https://github.com/QingWei-Li/docsify/commit/890a7bf))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.6.1"></a>
|
<a name="4.6.1"></a>
|
||||||
|
|
||||||
|
|
@ -166,8 +236,8 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **embed** compatible ssr ([dc0c3ce](https://github.com/QingWei-Li/docsify/commit/dc0c3ce))
|
- **embed** compatible ssr ([dc0c3ce](https://github.com/QingWei-Li/docsify/commit/dc0c3ce))
|
||||||
* **embed** async fetch embed files, fixed [#387](https://github.com/QingWei-Li/docsify/issues/387)
|
- **embed** async fetch embed files, fixed [#387](https://github.com/QingWei-Li/docsify/issues/387)
|
||||||
|
|
||||||
<a name="4.6.0"></a>
|
<a name="4.6.0"></a>
|
||||||
|
|
||||||
|
|
@ -175,26 +245,26 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **search:** custom clear button, fixed [#271](https://github.com/QingWei-Li/docsify/issues/271) ([864aa18](https://github.com/QingWei-Li/docsify/commit/864aa18))
|
- **search:** custom clear button, fixed [#271](https://github.com/QingWei-Li/docsify/issues/271) ([864aa18](https://github.com/QingWei-Li/docsify/commit/864aa18))
|
||||||
* **search:** escape special characters for search, fixed [#369](https://github.com/QingWei-Li/docsify/issues/369) ([9755439](https://github.com/QingWei-Li/docsify/commit/9755439))
|
- **search:** escape special characters for search, fixed [#369](https://github.com/QingWei-Li/docsify/issues/369) ([9755439](https://github.com/QingWei-Li/docsify/commit/9755439))
|
||||||
* build config ([342438f](https://github.com/QingWei-Li/docsify/commit/342438f))
|
- build config ([342438f](https://github.com/QingWei-Li/docsify/commit/342438f))
|
||||||
* button style for coverpage, fixed [#362](https://github.com/QingWei-Li/docsify/issues/362) ([85428ef](https://github.com/QingWei-Li/docsify/commit/85428ef))
|
- button style for coverpage, fixed [#362](https://github.com/QingWei-Li/docsify/issues/362) ([85428ef](https://github.com/QingWei-Li/docsify/commit/85428ef))
|
||||||
* dropdown scroll style, fixed [#346](https://github.com/QingWei-Li/docsify/issues/346) ([c4d83f2](https://github.com/QingWei-Li/docsify/commit/c4d83f2))
|
- dropdown scroll style, fixed [#346](https://github.com/QingWei-Li/docsify/issues/346) ([c4d83f2](https://github.com/QingWei-Li/docsify/commit/c4d83f2))
|
||||||
* highlight homepage link, fixed [#304](https://github.com/QingWei-Li/docsify/issues/304) ([f960c19](https://github.com/QingWei-Li/docsify/commit/f960c19))
|
- highlight homepage link, fixed [#304](https://github.com/QingWei-Li/docsify/issues/304) ([f960c19](https://github.com/QingWei-Li/docsify/commit/f960c19))
|
||||||
* homepage link ([e097f88](https://github.com/QingWei-Li/docsify/commit/e097f88))
|
- homepage link ([e097f88](https://github.com/QingWei-Li/docsify/commit/e097f88))
|
||||||
* onlyCover ([033be4f](https://github.com/QingWei-Li/docsify/commit/033be4f))
|
- onlyCover ([033be4f](https://github.com/QingWei-Li/docsify/commit/033be4f))
|
||||||
* ssr compatible embedd ([ebc10c4](https://github.com/QingWei-Li/docsify/commit/ebc10c4))
|
- ssr compatible embedd ([ebc10c4](https://github.com/QingWei-Li/docsify/commit/ebc10c4))
|
||||||
* ssr coverpage, fixed [#273](https://github.com/QingWei-Li/docsify/issues/273) ([9e824a4](https://github.com/QingWei-Li/docsify/commit/9e824a4))
|
- ssr coverpage, fixed [#273](https://github.com/QingWei-Li/docsify/issues/273) ([9e824a4](https://github.com/QingWei-Li/docsify/commit/9e824a4))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* click sidebar menu add collapse and expand, close [#294](https://github.com/QingWei-Li/docsify/issues/294) ([5e161a1](https://github.com/QingWei-Li/docsify/commit/5e161a1))
|
- click sidebar menu add collapse and expand, close [#294](https://github.com/QingWei-Li/docsify/issues/294) ([5e161a1](https://github.com/QingWei-Li/docsify/commit/5e161a1))
|
||||||
* **compiler:** support embedded file as code block, close [#134](https://github.com/QingWei-Li/docsify/issues/134) ([761ccc2](https://github.com/QingWei-Li/docsify/commit/761ccc2))
|
- **compiler:** support embedded file as code block, close [#134](https://github.com/QingWei-Li/docsify/issues/134) ([761ccc2](https://github.com/QingWei-Li/docsify/commit/761ccc2))
|
||||||
* **compiler:** support embedded markdown, html, video, etc files, close [#383](https://github.com/QingWei-Li/docsify/issues/383), close [#333](https://github.com/QingWei-Li/docsify/issues/333) ([524f52f](https://github.com/QingWei-Li/docsify/commit/524f52f))
|
- **compiler:** support embedded markdown, html, video, etc files, close [#383](https://github.com/QingWei-Li/docsify/issues/383), close [#333](https://github.com/QingWei-Li/docsify/issues/333) ([524f52f](https://github.com/QingWei-Li/docsify/commit/524f52f))
|
||||||
* **cover:** add onlyCover option, close [#382](https://github.com/QingWei-Li/docsify/issues/382) ([b265fdd](https://github.com/QingWei-Li/docsify/commit/b265fdd))
|
- **cover:** add onlyCover option, close [#382](https://github.com/QingWei-Li/docsify/issues/382) ([b265fdd](https://github.com/QingWei-Li/docsify/commit/b265fdd))
|
||||||
* **fetch:** add requestHeaders option, fixed [#336](https://github.com/QingWei-Li/docsify/issues/336) ([54ab4c9](https://github.com/QingWei-Li/docsify/commit/54ab4c9))
|
- **fetch:** add requestHeaders option, fixed [#336](https://github.com/QingWei-Li/docsify/issues/336) ([54ab4c9](https://github.com/QingWei-Li/docsify/commit/54ab4c9))
|
||||||
* **render:** add ext option for custom file extenstion, close [#340](https://github.com/QingWei-Li/docsify/issues/340) ([248aa72](https://github.com/QingWei-Li/docsify/commit/248aa72))
|
- **render:** add ext option for custom file extenstion, close [#340](https://github.com/QingWei-Li/docsify/issues/340) ([248aa72](https://github.com/QingWei-Li/docsify/commit/248aa72))
|
||||||
* **render:** mutilple coverpage, close [#315](https://github.com/QingWei-Li/docsify/issues/315) ([f68ddf5](https://github.com/QingWei-Li/docsify/commit/f68ddf5))
|
- **render:** mutilple coverpage, close [#315](https://github.com/QingWei-Li/docsify/issues/315) ([f68ddf5](https://github.com/QingWei-Li/docsify/commit/f68ddf5))
|
||||||
|
|
||||||
<a name="4.5.9"></a>
|
<a name="4.5.9"></a>
|
||||||
|
|
||||||
|
|
@ -202,7 +272,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* upgrade marked ([4157173](https://github.com/QingWei-Li/docsify/commit/4157173))
|
- upgrade marked ([4157173](https://github.com/QingWei-Li/docsify/commit/4157173))
|
||||||
|
|
||||||
<a name="4.5.8"></a>
|
<a name="4.5.8"></a>
|
||||||
|
|
||||||
|
|
@ -210,8 +280,8 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* cover style, fixed [#381](https://github.com/QingWei-Li/docsify/issues/381) ([368754e](https://github.com/QingWei-Li/docsify/commit/368754e))
|
- cover style, fixed [#381](https://github.com/QingWei-Li/docsify/issues/381) ([368754e](https://github.com/QingWei-Li/docsify/commit/368754e))
|
||||||
* updated deps ([#337](https://github.com/QingWei-Li/docsify/issues/337)) ([a12d393](https://github.com/QingWei-Li/docsify/commit/a12d393))
|
- updated deps ([#337](https://github.com/QingWei-Li/docsify/issues/337)) ([a12d393](https://github.com/QingWei-Li/docsify/commit/a12d393))
|
||||||
|
|
||||||
<a name="4.5.7"></a>
|
<a name="4.5.7"></a>
|
||||||
|
|
||||||
|
|
@ -219,7 +289,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add navigation plugin, closed [#180](https://github.com/QingWei-Li/docsify/issues/180) ([f78be4c](https://github.com/QingWei-Li/docsify/commit/f78be4c))
|
- add navigation plugin, closed [#180](https://github.com/QingWei-Li/docsify/issues/180) ([f78be4c](https://github.com/QingWei-Li/docsify/commit/f78be4c))
|
||||||
|
|
||||||
<a name="4.5.6"></a>
|
<a name="4.5.6"></a>
|
||||||
|
|
||||||
|
|
@ -227,7 +297,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **style:** increase the tap targets of menu button, fixed [#325](https://github.com/QingWei-Li/docsify/issues/325) ([888f217](https://github.com/QingWei-Li/docsify/commit/888f217))
|
- **style:** increase the tap targets of menu button, fixed [#325](https://github.com/QingWei-Li/docsify/issues/325) ([888f217](https://github.com/QingWei-Li/docsify/commit/888f217))
|
||||||
|
|
||||||
<a name="4.5.5"></a>
|
<a name="4.5.5"></a>
|
||||||
|
|
||||||
|
|
@ -235,7 +305,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* disqus plugin issue ([#318](https://github.com/QingWei-Li/docsify/issues/318)) ([041b33e](https://github.com/QingWei-Li/docsify/commit/041b33e)), closes [#317](https://github.com/QingWei-Li/docsify/issues/317)
|
- disqus plugin issue ([#318](https://github.com/QingWei-Li/docsify/issues/318)) ([041b33e](https://github.com/QingWei-Li/docsify/commit/041b33e)), closes [#317](https://github.com/QingWei-Li/docsify/issues/317)
|
||||||
|
|
||||||
<a name="4.5.4"></a>
|
<a name="4.5.4"></a>
|
||||||
|
|
||||||
|
|
@ -243,11 +313,11 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **compiler:** task lists style, fixed [#215](https://github.com/QingWei-Li/docsify/issues/215) ([e43ded4](https://github.com/QingWei-Li/docsify/commit/e43ded4))
|
- **compiler:** task lists style, fixed [#215](https://github.com/QingWei-Li/docsify/issues/215) ([e43ded4](https://github.com/QingWei-Li/docsify/commit/e43ded4))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
|
- add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
|
||||||
|
|
||||||
<a name="4.5.3"></a>
|
<a name="4.5.3"></a>
|
||||||
|
|
||||||
|
|
@ -255,7 +325,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
|
- add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
|
||||||
|
|
||||||
<a name="4.5.2"></a>
|
<a name="4.5.2"></a>
|
||||||
|
|
||||||
|
|
@ -263,7 +333,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* github task lists, close [#215](https://github.com/QingWei-Li/docsify/issues/215) ([#305](https://github.com/QingWei-Li/docsify/issues/305)) ([d486eef](https://github.com/QingWei-Li/docsify/commit/d486eef))
|
- github task lists, close [#215](https://github.com/QingWei-Li/docsify/issues/215) ([#305](https://github.com/QingWei-Li/docsify/issues/305)) ([d486eef](https://github.com/QingWei-Li/docsify/commit/d486eef))
|
||||||
|
|
||||||
<a name="4.5.1"></a>
|
<a name="4.5.1"></a>
|
||||||
|
|
||||||
|
|
@ -271,7 +341,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* fetch files with the query params, fixed [#303](https://github.com/QingWei-Li/docsify/issues/303) ([2a2ed96](https://github.com/QingWei-Li/docsify/commit/2a2ed96))
|
- fetch files with the query params, fixed [#303](https://github.com/QingWei-Li/docsify/issues/303) ([2a2ed96](https://github.com/QingWei-Li/docsify/commit/2a2ed96))
|
||||||
|
|
||||||
<a name="4.5.0"></a>
|
<a name="4.5.0"></a>
|
||||||
|
|
||||||
|
|
@ -279,7 +349,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add disqus plugin, closed [#123](https://github.com/QingWei-Li/docsify/issues/123) ([fd7d4e0](https://github.com/QingWei-Li/docsify/commit/fd7d4e0))
|
- add disqus plugin, closed [#123](https://github.com/QingWei-Li/docsify/issues/123) ([fd7d4e0](https://github.com/QingWei-Li/docsify/commit/fd7d4e0))
|
||||||
|
|
||||||
<a name="4.4.1"></a>
|
<a name="4.4.1"></a>
|
||||||
|
|
||||||
|
|
@ -287,8 +357,8 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* {docsify-ignore-all} and {docsify-ignore} bug ([#299](https://github.com/QingWei-Li/docsify/issues/299)) ([cc98f56](https://github.com/QingWei-Li/docsify/commit/cc98f56))
|
- {docsify-ignore-all} and {docsify-ignore} bug ([#299](https://github.com/QingWei-Li/docsify/issues/299)) ([cc98f56](https://github.com/QingWei-Li/docsify/commit/cc98f56))
|
||||||
* zoom image plugin issue, fixed [#187](https://github.com/QingWei-Li/docsify/issues/187) ([#300](https://github.com/QingWei-Li/docsify/issues/300)) ([fa772cf](https://github.com/QingWei-Li/docsify/commit/fa772cf))
|
- zoom image plugin issue, fixed [#187](https://github.com/QingWei-Li/docsify/issues/187) ([#300](https://github.com/QingWei-Li/docsify/issues/300)) ([fa772cf](https://github.com/QingWei-Li/docsify/commit/fa772cf))
|
||||||
|
|
||||||
<a name="4.4.0"></a>
|
<a name="4.4.0"></a>
|
||||||
|
|
||||||
|
|
@ -296,11 +366,11 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* sidebar style issue on firefox, fixed [#184](https://github.com/QingWei-Li/docsify/issues/184) ([#297](https://github.com/QingWei-Li/docsify/issues/297)) ([36bfc9d](https://github.com/QingWei-Li/docsify/commit/36bfc9d))
|
- sidebar style issue on firefox, fixed [#184](https://github.com/QingWei-Li/docsify/issues/184) ([#297](https://github.com/QingWei-Li/docsify/issues/297)) ([36bfc9d](https://github.com/QingWei-Li/docsify/commit/36bfc9d))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add helper for disabled link, fixed [#295](https://github.com/QingWei-Li/docsify/issues/295) ([#296](https://github.com/QingWei-Li/docsify/issues/296)) ([4ad96f3](https://github.com/QingWei-Li/docsify/commit/4ad96f3))
|
- add helper for disabled link, fixed [#295](https://github.com/QingWei-Li/docsify/issues/295) ([#296](https://github.com/QingWei-Li/docsify/issues/296)) ([4ad96f3](https://github.com/QingWei-Li/docsify/commit/4ad96f3))
|
||||||
|
|
||||||
<a name="4.3.15"></a>
|
<a name="4.3.15"></a>
|
||||||
|
|
||||||
|
|
@ -308,7 +378,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* scroll active sidebar ([a2b8eae](https://github.com/QingWei-Li/docsify/commit/a2b8eae))
|
- scroll active sidebar ([a2b8eae](https://github.com/QingWei-Li/docsify/commit/a2b8eae))
|
||||||
|
|
||||||
<a name="4.3.14"></a>
|
<a name="4.3.14"></a>
|
||||||
|
|
||||||
|
|
@ -316,7 +386,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* codesponsor style ([ab68268](https://github.com/QingWei-Li/docsify/commit/ab68268))
|
- codesponsor style ([ab68268](https://github.com/QingWei-Li/docsify/commit/ab68268))
|
||||||
|
|
||||||
<a name="4.3.13"></a>
|
<a name="4.3.13"></a>
|
||||||
|
|
||||||
|
|
@ -324,11 +394,11 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* duplicate results in search fixed [#257](https://github.com/QingWei-Li/docsify/issues/257) ([#284](https://github.com/QingWei-Li/docsify/issues/284)) ([3476f6f](https://github.com/QingWei-Li/docsify/commit/3476f6f))
|
- duplicate results in search fixed [#257](https://github.com/QingWei-Li/docsify/issues/257) ([#284](https://github.com/QingWei-Li/docsify/issues/284)) ([3476f6f](https://github.com/QingWei-Li/docsify/commit/3476f6f))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* make whole search result clickable ([#285](https://github.com/QingWei-Li/docsify/issues/285)) ([1b91227](https://github.com/QingWei-Li/docsify/commit/1b91227))
|
- make whole search result clickable ([#285](https://github.com/QingWei-Li/docsify/issues/285)) ([1b91227](https://github.com/QingWei-Li/docsify/commit/1b91227))
|
||||||
|
|
||||||
<a name="4.3.12"></a>
|
<a name="4.3.12"></a>
|
||||||
|
|
||||||
|
|
@ -336,7 +406,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* incorrect active link ([#281](https://github.com/QingWei-Li/docsify/issues/281)) ([a3ab379](https://github.com/QingWei-Li/docsify/commit/a3ab379))
|
- incorrect active link ([#281](https://github.com/QingWei-Li/docsify/issues/281)) ([a3ab379](https://github.com/QingWei-Li/docsify/commit/a3ab379))
|
||||||
|
|
||||||
<a name="4.3.11"></a>
|
<a name="4.3.11"></a>
|
||||||
|
|
||||||
|
|
@ -344,7 +414,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* broken links to same page heading, fix [#278](https://github.com/QingWei-Li/docsify/issues/278), fix [#279](https://github.com/QingWei-Li/docsify/issues/279) ([91d6337](https://github.com/QingWei-Li/docsify/commit/91d6337))
|
- broken links to same page heading, fix [#278](https://github.com/QingWei-Li/docsify/issues/278), fix [#279](https://github.com/QingWei-Li/docsify/issues/279) ([91d6337](https://github.com/QingWei-Li/docsify/commit/91d6337))
|
||||||
|
|
||||||
<a name="4.3.10"></a>
|
<a name="4.3.10"></a>
|
||||||
|
|
||||||
|
|
@ -352,7 +422,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* link render issue after page refreshing ([#276](https://github.com/QingWei-Li/docsify/issues/276)) ([abd885e](https://github.com/QingWei-Li/docsify/commit/abd885e))
|
- link render issue after page refreshing ([#276](https://github.com/QingWei-Li/docsify/issues/276)) ([abd885e](https://github.com/QingWei-Li/docsify/commit/abd885e))
|
||||||
|
|
||||||
<a name="4.3.9"></a>
|
<a name="4.3.9"></a>
|
||||||
|
|
||||||
|
|
@ -360,7 +430,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* scroll issue in IE ([#275](https://github.com/QingWei-Li/docsify/issues/275)) ([3e94cb6](https://github.com/QingWei-Li/docsify/commit/3e94cb6))
|
- scroll issue in IE ([#275](https://github.com/QingWei-Li/docsify/issues/275)) ([3e94cb6](https://github.com/QingWei-Li/docsify/commit/3e94cb6))
|
||||||
|
|
||||||
<a name="4.3.8"></a>
|
<a name="4.3.8"></a>
|
||||||
|
|
||||||
|
|
@ -368,7 +438,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **slugify:** GitHub compatible heading links, fixed [#272](https://github.com/QingWei-Li/docsify/issues/272) ([9b4e666](https://github.com/QingWei-Li/docsify/commit/9b4e666))
|
- **slugify:** GitHub compatible heading links, fixed [#272](https://github.com/QingWei-Li/docsify/issues/272) ([9b4e666](https://github.com/QingWei-Li/docsify/commit/9b4e666))
|
||||||
|
|
||||||
<a name="4.3.7"></a>
|
<a name="4.3.7"></a>
|
||||||
|
|
||||||
|
|
@ -376,7 +446,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **slugify:** GitHub compatible heading links, fixed [#267](https://github.com/QingWei-Li/docsify/issues/267) ([c195d2d](https://github.com/QingWei-Li/docsify/commit/c195d2d))
|
- **slugify:** GitHub compatible heading links, fixed [#267](https://github.com/QingWei-Li/docsify/issues/267) ([c195d2d](https://github.com/QingWei-Li/docsify/commit/c195d2d))
|
||||||
|
|
||||||
<a name="4.3.6"></a>
|
<a name="4.3.6"></a>
|
||||||
|
|
||||||
|
|
@ -384,7 +454,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* style for codesponsor plugin ([08afec7](https://github.com/QingWei-Li/docsify/commit/08afec7))
|
- style for codesponsor plugin ([08afec7](https://github.com/QingWei-Li/docsify/commit/08afec7))
|
||||||
|
|
||||||
<a name="4.3.5"></a>
|
<a name="4.3.5"></a>
|
||||||
|
|
||||||
|
|
@ -392,11 +462,11 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* missed symbol ([#254](https://github.com/QingWei-Li/docsify/issues/254)) ([6c702d3](https://github.com/QingWei-Li/docsify/commit/6c702d3))
|
- missed symbol ([#254](https://github.com/QingWei-Li/docsify/issues/254)) ([6c702d3](https://github.com/QingWei-Li/docsify/commit/6c702d3))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **plugin:** add codesponsor plugin ([46ac4c3](https://github.com/QingWei-Li/docsify/commit/46ac4c3))
|
- **plugin:** add codesponsor plugin ([46ac4c3](https://github.com/QingWei-Li/docsify/commit/46ac4c3))
|
||||||
|
|
||||||
<a name="4.3.4"></a>
|
<a name="4.3.4"></a>
|
||||||
|
|
||||||
|
|
@ -404,7 +474,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* scroll position issue, fixed [#234](https://github.com/QingWei-Li/docsify/issues/234) ([388ed3d](https://github.com/QingWei-Li/docsify/commit/388ed3d))
|
- scroll position issue, fixed [#234](https://github.com/QingWei-Li/docsify/issues/234) ([388ed3d](https://github.com/QingWei-Li/docsify/commit/388ed3d))
|
||||||
|
|
||||||
<a name="4.3.3"></a>
|
<a name="4.3.3"></a>
|
||||||
|
|
||||||
|
|
@ -412,11 +482,11 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **buble.css:** tweaks code block style, fixed [#249](https://github.com/QingWei-Li/docsify/issues/249) ([9d43051](https://github.com/QingWei-Li/docsify/commit/9d43051))
|
- **buble.css:** tweaks code block style, fixed [#249](https://github.com/QingWei-Li/docsify/issues/249) ([9d43051](https://github.com/QingWei-Li/docsify/commit/9d43051))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add doc for react and vue demo box plugin ([#247](https://github.com/QingWei-Li/docsify/issues/247)) ([f0aca19](https://github.com/QingWei-Li/docsify/commit/f0aca19))
|
- add doc for react and vue demo box plugin ([#247](https://github.com/QingWei-Li/docsify/issues/247)) ([f0aca19](https://github.com/QingWei-Li/docsify/commit/f0aca19))
|
||||||
|
|
||||||
<a name="4.3.2"></a>
|
<a name="4.3.2"></a>
|
||||||
|
|
||||||
|
|
@ -424,11 +494,11 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* sidebar highlight ([f82f419](https://github.com/QingWei-Li/docsify/commit/f82f419))
|
- sidebar highlight ([f82f419](https://github.com/QingWei-Li/docsify/commit/f82f419))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add Edit on github plugin (thanks [@njleonzhang](https://github.com/njleonzhang)) ([a0e1ea8](https://github.com/QingWei-Li/docsify/commit/a0e1ea8))
|
- add Edit on github plugin (thanks [@njleonzhang](https://github.com/njleonzhang)) ([a0e1ea8](https://github.com/QingWei-Li/docsify/commit/a0e1ea8))
|
||||||
|
|
||||||
<a name="4.3.1"></a>
|
<a name="4.3.1"></a>
|
||||||
|
|
||||||
|
|
@ -436,7 +506,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **markdown:** supports mermaid [#137](https://github.com/QingWei-Li/docsify/issues/137) ([f4800e0](https://github.com/QingWei-Li/docsify/commit/f4800e0))
|
- **markdown:** supports mermaid [#137](https://github.com/QingWei-Li/docsify/issues/137) ([f4800e0](https://github.com/QingWei-Li/docsify/commit/f4800e0))
|
||||||
|
|
||||||
<a name="4.3.0"></a>
|
<a name="4.3.0"></a>
|
||||||
|
|
||||||
|
|
@ -444,7 +514,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **markdown:** supports mermaid [#137](https://github.com/QingWei-Li/docsify/issues/137) ([f4800e0](https://github.com/QingWei-Li/docsify/commit/f4800e0))
|
- **markdown:** supports mermaid [#137](https://github.com/QingWei-Li/docsify/issues/137) ([f4800e0](https://github.com/QingWei-Li/docsify/commit/f4800e0))
|
||||||
|
|
||||||
<a name="4.2.9"></a>
|
<a name="4.2.9"></a>
|
||||||
|
|
||||||
|
|
@ -452,7 +522,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* ensure document ready before init Docsify [#233](https://github.com/QingWei-Li/docsify/issues/233)
|
- ensure document ready before init Docsify [#233](https://github.com/QingWei-Li/docsify/issues/233)
|
||||||
|
|
||||||
<a name="4.2.8"></a>
|
<a name="4.2.8"></a>
|
||||||
|
|
||||||
|
|
@ -460,7 +530,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **compiler:** support for setting target attribute for link, fixed [#230](https://github.com/QingWei-Li/docsify/issues/230) ([7f270f9](https://github.com/QingWei-Li/docsify/commit/7f270f9))
|
- **compiler:** support for setting target attribute for link, fixed [#230](https://github.com/QingWei-Li/docsify/issues/230) ([7f270f9](https://github.com/QingWei-Li/docsify/commit/7f270f9))
|
||||||
|
|
||||||
<a name="4.2.7"></a>
|
<a name="4.2.7"></a>
|
||||||
|
|
||||||
|
|
@ -468,8 +538,8 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **release:** release shell ([628e211](https://github.com/QingWei-Li/docsify/commit/628e211))
|
- **release:** release shell ([628e211](https://github.com/QingWei-Li/docsify/commit/628e211))
|
||||||
* **style:** nowrap => pre-wrap, fixed [#228](https://github.com/QingWei-Li/docsify/issues/228) ([a88252c](https://github.com/QingWei-Li/docsify/commit/a88252c))
|
- **style:** nowrap => pre-wrap, fixed [#228](https://github.com/QingWei-Li/docsify/issues/228) ([a88252c](https://github.com/QingWei-Li/docsify/commit/a88252c))
|
||||||
|
|
||||||
<a name="4.2.6"></a>
|
<a name="4.2.6"></a>
|
||||||
|
|
||||||
|
|
@ -477,8 +547,8 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **css:** hide the nav when the content has not yet been loaded ([1fa1619](https://github.com/QingWei-Li/docsify/commit/1fa1619))
|
- **css:** hide the nav when the content has not yet been loaded ([1fa1619](https://github.com/QingWei-Li/docsify/commit/1fa1619))
|
||||||
* **release:** release shell ([628e211](https://github.com/QingWei-Li/docsify/commit/628e211))
|
- **release:** release shell ([628e211](https://github.com/QingWei-Li/docsify/commit/628e211))
|
||||||
|
|
||||||
<a name="4.2.4"></a>
|
<a name="4.2.4"></a>
|
||||||
|
|
||||||
|
|
@ -486,7 +556,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **render:** Remove getRootNode to be compatible with the lower version of Chrome, fixed [#225](https://github.com/QingWei-Li/docsify/issues/225) ([b8dd346](https://github.com/QingWei-Li/docsify/commit/b8dd346))
|
- **render:** Remove getRootNode to be compatible with the lower version of Chrome, fixed [#225](https://github.com/QingWei-Li/docsify/issues/225) ([b8dd346](https://github.com/QingWei-Li/docsify/commit/b8dd346))
|
||||||
|
|
||||||
<a name="4.2.3"></a>
|
<a name="4.2.3"></a>
|
||||||
|
|
||||||
|
|
@ -494,7 +564,7 @@
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **search:** Supports the max depth of the search headline, fixed [#223](https://github.com/QingWei-Li/docsify/issues/223), resolve [#129](https://github.com/QingWei-Li/docsify/issues/129) ([b7b589b](https://github.com/QingWei-Li/docsify/commit/b7b589b))
|
- **search:** Supports the max depth of the search headline, fixed [#223](https://github.com/QingWei-Li/docsify/issues/223), resolve [#129](https://github.com/QingWei-Li/docsify/issues/129) ([b7b589b](https://github.com/QingWei-Li/docsify/commit/b7b589b))
|
||||||
|
|
||||||
<a name="4.2.2"></a>
|
<a name="4.2.2"></a>
|
||||||
|
|
||||||
|
|
@ -502,14 +572,14 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* style rerender due to setting themeColor ([17ff3d1](https://github.com/QingWei-Li/docsify/commit/17ff3d1))
|
- style rerender due to setting themeColor ([17ff3d1](https://github.com/QingWei-Li/docsify/commit/17ff3d1))
|
||||||
|
|
||||||
<a name="4.2.1"></a>
|
<a name="4.2.1"></a>
|
||||||
|
|
||||||
## [4.2.1](https://github.com/QingWei-Li/docsify/compare/v4.2.0...v4.2.1) (2017-07-19)
|
## [4.2.1](https://github.com/QingWei-Li/docsify/compare/v4.2.0...v4.2.1) (2017-07-19)
|
||||||
|
|
||||||
* give the navbar some line-height (#216)
|
- give the navbar some line-height (#216)
|
||||||
* Remove unnecessary moduleName option from rollup config for plugins (#209)
|
- Remove unnecessary moduleName option from rollup config for plugins (#209)
|
||||||
|
|
||||||
<a name="4.2.0"></a>
|
<a name="4.2.0"></a>
|
||||||
|
|
||||||
|
|
@ -517,12 +587,12 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* not found page ([9af8559](https://github.com/QingWei-Li/docsify/commit/9af8559))
|
- not found page ([9af8559](https://github.com/QingWei-Li/docsify/commit/9af8559))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* alias option supports regexp, resolve [#183](https://github.com/QingWei-Li/docsify/issues/183) ([c4aa22c](https://github.com/QingWei-Li/docsify/commit/c4aa22c))
|
- alias option supports regexp, resolve [#183](https://github.com/QingWei-Li/docsify/issues/183) ([c4aa22c](https://github.com/QingWei-Li/docsify/commit/c4aa22c))
|
||||||
* ignore to compiled link, fixed [#203](https://github.com/QingWei-Li/docsify/issues/203) ([#204](https://github.com/QingWei-Li/docsify/issues/204)) ([2e00f4c](https://github.com/QingWei-Li/docsify/commit/2e00f4c))
|
- ignore to compiled link, fixed [#203](https://github.com/QingWei-Li/docsify/issues/203) ([#204](https://github.com/QingWei-Li/docsify/issues/204)) ([2e00f4c](https://github.com/QingWei-Li/docsify/commit/2e00f4c))
|
||||||
|
|
||||||
<a name="4.1.14"></a>
|
<a name="4.1.14"></a>
|
||||||
|
|
||||||
|
|
@ -530,11 +600,11 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* get file path, fixed jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070 ([e8117e5](https://github.com/QingWei-Li/docsify/commit/e8117e5)), closes [jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070](https://github.com/jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13/issues/commitcomment-22427070)
|
- get file path, fixed jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070 ([e8117e5](https://github.com/QingWei-Li/docsify/commit/e8117e5)), closes [jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070](https://github.com/jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13/issues/commitcomment-22427070)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add context attribute, fixed [#191](https://github.com/QingWei-Li/docsify/issues/191) ([ce0e9ac](https://github.com/QingWei-Li/docsify/commit/ce0e9ac))
|
- add context attribute, fixed [#191](https://github.com/QingWei-Li/docsify/issues/191) ([ce0e9ac](https://github.com/QingWei-Li/docsify/commit/ce0e9ac))
|
||||||
|
|
||||||
<a name="4.1.13"></a>
|
<a name="4.1.13"></a>
|
||||||
|
|
||||||
|
|
@ -546,7 +616,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **render:** subtitle in side bar shows undefined, fixed [#182](https://github.com/QingWei-Li/docsify/issues/182) ([d087d57](https://github.com/QingWei-Li/docsify/commit/d087d57))
|
- **render:** subtitle in side bar shows undefined, fixed [#182](https://github.com/QingWei-Li/docsify/issues/182) ([d087d57](https://github.com/QingWei-Li/docsify/commit/d087d57))
|
||||||
|
|
||||||
<a name="4.1.11"></a>
|
<a name="4.1.11"></a>
|
||||||
|
|
||||||
|
|
@ -554,8 +624,8 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **compiler:** force reset toc when rendering sidebar fixed [#181](https://github.com/QingWei-Li/docsify/issues/181) ([ccf4c7c](https://github.com/QingWei-Li/docsify/commit/ccf4c7c))
|
- **compiler:** force reset toc when rendering sidebar fixed [#181](https://github.com/QingWei-Li/docsify/issues/181) ([ccf4c7c](https://github.com/QingWei-Li/docsify/commit/ccf4c7c))
|
||||||
* **render:** autoHeader does not work ([1304d2e](https://github.com/QingWei-Li/docsify/commit/1304d2e))
|
- **render:** autoHeader does not work ([1304d2e](https://github.com/QingWei-Li/docsify/commit/1304d2e))
|
||||||
|
|
||||||
<a name="4.1.10"></a>
|
<a name="4.1.10"></a>
|
||||||
|
|
||||||
|
|
@ -563,7 +633,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **hash:** hash routing crashes when url has querystring ([6d48ce1](https://github.com/QingWei-Li/docsify/commit/6d48ce1))
|
- **hash:** hash routing crashes when url has querystring ([6d48ce1](https://github.com/QingWei-Li/docsify/commit/6d48ce1))
|
||||||
|
|
||||||
<a name="4.1.9"></a>
|
<a name="4.1.9"></a>
|
||||||
|
|
||||||
|
|
@ -571,9 +641,9 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* can't render toc on first load ([d9b487e](https://github.com/QingWei-Li/docsify/commit/d9b487e))
|
- can't render toc on first load ([d9b487e](https://github.com/QingWei-Li/docsify/commit/d9b487e))
|
||||||
* **lifecycle:** continue to handle data ([955d3d5](https://github.com/QingWei-Li/docsify/commit/955d3d5))
|
- **lifecycle:** continue to handle data ([955d3d5](https://github.com/QingWei-Li/docsify/commit/955d3d5))
|
||||||
* **render:** broken name link, fixed [#167](https://github.com/QingWei-Li/docsify/issues/167) ([91b66a5](https://github.com/QingWei-Li/docsify/commit/91b66a5))
|
- **render:** broken name link, fixed [#167](https://github.com/QingWei-Li/docsify/issues/167) ([91b66a5](https://github.com/QingWei-Li/docsify/commit/91b66a5))
|
||||||
|
|
||||||
<a name="4.1.8"></a>
|
<a name="4.1.8"></a>
|
||||||
|
|
||||||
|
|
@ -581,13 +651,13 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* auto replace version ([22b50f0](https://github.com/QingWei-Li/docsify/commit/22b50f0))
|
- auto replace version ([22b50f0](https://github.com/QingWei-Li/docsify/commit/22b50f0))
|
||||||
* update edit button demo ([ec887c1](https://github.com/QingWei-Li/docsify/commit/ec887c1))
|
- update edit button demo ([ec887c1](https://github.com/QingWei-Li/docsify/commit/ec887c1))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add edit button demo ([a64cee1](https://github.com/QingWei-Li/docsify/commit/a64cee1))
|
- add edit button demo ([a64cee1](https://github.com/QingWei-Li/docsify/commit/a64cee1))
|
||||||
* add edit button demo, close [#162](https://github.com/QingWei-Li/docsify/issues/162) ([036fdac](https://github.com/QingWei-Li/docsify/commit/036fdac))
|
- add edit button demo, close [#162](https://github.com/QingWei-Li/docsify/issues/162) ([036fdac](https://github.com/QingWei-Li/docsify/commit/036fdac))
|
||||||
|
|
||||||
<a name="4.1.7"></a>
|
<a name="4.1.7"></a>
|
||||||
|
|
||||||
|
|
@ -595,7 +665,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **ssr:** clean files ([0014895](https://github.com/QingWei-Li/docsify/commit/0014895))
|
- **ssr:** clean files ([0014895](https://github.com/QingWei-Li/docsify/commit/0014895))
|
||||||
|
|
||||||
<a name="4.1.6"></a>
|
<a name="4.1.6"></a>
|
||||||
|
|
||||||
|
|
@ -603,7 +673,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **ssr:** add debug ([6b9e092](https://github.com/QingWei-Li/docsify/commit/6b9e092))
|
- **ssr:** add debug ([6b9e092](https://github.com/QingWei-Li/docsify/commit/6b9e092))
|
||||||
|
|
||||||
<a name="4.1.5"></a>
|
<a name="4.1.5"></a>
|
||||||
|
|
||||||
|
|
@ -611,7 +681,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **ssr:** missing package ([6db8c9e](https://github.com/QingWei-Li/docsify/commit/6db8c9e))
|
- **ssr:** missing package ([6db8c9e](https://github.com/QingWei-Li/docsify/commit/6db8c9e))
|
||||||
|
|
||||||
<a name="4.1.4"></a>
|
<a name="4.1.4"></a>
|
||||||
|
|
||||||
|
|
@ -619,7 +689,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **ssr:** file path ([79a83bc](https://github.com/QingWei-Li/docsify/commit/79a83bc))
|
- **ssr:** file path ([79a83bc](https://github.com/QingWei-Li/docsify/commit/79a83bc))
|
||||||
|
|
||||||
<a name="4.1.3"></a>
|
<a name="4.1.3"></a>
|
||||||
|
|
||||||
|
|
@ -627,7 +697,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* update babel config ([9825db4](https://github.com/QingWei-Li/docsify/commit/9825db4))
|
- update babel config ([9825db4](https://github.com/QingWei-Li/docsify/commit/9825db4))
|
||||||
|
|
||||||
<a name="4.1.2"></a>
|
<a name="4.1.2"></a>
|
||||||
|
|
||||||
|
|
@ -635,7 +705,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* update babel config ([80dba19](https://github.com/QingWei-Li/docsify/commit/80dba19))
|
- update babel config ([80dba19](https://github.com/QingWei-Li/docsify/commit/80dba19))
|
||||||
|
|
||||||
<a name="4.1.1"></a>
|
<a name="4.1.1"></a>
|
||||||
|
|
||||||
|
|
@ -643,8 +713,8 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* build for ssr package ([4cb20a5](https://github.com/QingWei-Li/docsify/commit/4cb20a5))
|
- build for ssr package ([4cb20a5](https://github.com/QingWei-Li/docsify/commit/4cb20a5))
|
||||||
* remove history mode ([0e74e6c](https://github.com/QingWei-Li/docsify/commit/0e74e6c))
|
- remove history mode ([0e74e6c](https://github.com/QingWei-Li/docsify/commit/0e74e6c))
|
||||||
|
|
||||||
<a name="4.1.0"></a>
|
<a name="4.1.0"></a>
|
||||||
|
|
||||||
|
|
@ -656,7 +726,7 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* basePath for history mode ([fc1cd3f](https://github.com/QingWei-Li/docsify/commit/fc1cd3f))
|
- basePath for history mode ([fc1cd3f](https://github.com/QingWei-Li/docsify/commit/fc1cd3f))
|
||||||
|
|
||||||
<a name="4.0.1"></a>
|
<a name="4.0.1"></a>
|
||||||
|
|
||||||
|
|
@ -664,8 +734,8 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **ssr:** remove context ([4626157](https://github.com/QingWei-Li/docsify/commit/4626157))
|
- **ssr:** remove context ([4626157](https://github.com/QingWei-Li/docsify/commit/4626157))
|
||||||
* lint ([b764b6e](https://github.com/QingWei-Li/docsify/commit/b764b6e))
|
- lint ([b764b6e](https://github.com/QingWei-Li/docsify/commit/b764b6e))
|
||||||
|
|
||||||
<a name="4.0.0"></a>
|
<a name="4.0.0"></a>
|
||||||
|
|
||||||
|
|
@ -673,11 +743,11 @@
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **render:** init event in ssr ([eba1c98](https://github.com/QingWei-Li/docsify/commit/eba1c98))
|
- **render:** init event in ssr ([eba1c98](https://github.com/QingWei-Li/docsify/commit/eba1c98))
|
||||||
* lint ([1f4514d](https://github.com/QingWei-Li/docsify/commit/1f4514d))
|
- lint ([1f4514d](https://github.com/QingWei-Li/docsify/commit/1f4514d))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* finish ssr ([3444884](https://github.com/QingWei-Li/docsify/commit/3444884))
|
- finish ssr ([3444884](https://github.com/QingWei-Li/docsify/commit/3444884))
|
||||||
* init ocsify-server-renderer ([6dea685](https://github.com/QingWei-Li/docsify/commit/6dea685))
|
- init ocsify-server-renderer ([6dea685](https://github.com/QingWei-Li/docsify/commit/6dea685))
|
||||||
* support history mode ([f095eb8](https://github.com/QingWei-Li/docsify/commit/f095eb8))
|
- support history mode ([f095eb8](https://github.com/QingWei-Li/docsify/commit/f095eb8))
|
||||||
|
|
|
||||||
13
README.md
13
README.md
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
|
- [`develop` branch preview](https://docsifyjs.netlify.com/)
|
||||||
- [Documentation](https://docsify.js.org)
|
- [Documentation](https://docsify.js.org)
|
||||||
- [CLI](https://github.com/docsifyjs/docsify-cli)
|
- [CLI](https://github.com/docsifyjs/docsify-cli)
|
||||||
- CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify)
|
- CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify)
|
||||||
|
|
@ -36,23 +37,25 @@
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- No statically built html files
|
- No statically built html files
|
||||||
- Simple and lightweight (~19kB gzipped)
|
- Simple and lightweight (~21kB gzipped)
|
||||||
- Smart full-text search plugin
|
- Smart full-text search plugin
|
||||||
- Multiple themes
|
- Multiple themes
|
||||||
- Useful plugin API
|
- Useful plugin API
|
||||||
- Compatible with IE10+
|
- Compatible with IE11
|
||||||
- Support SSR ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
- Support SSR ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
||||||
- Support embedded files
|
- Support embedded files
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
Look at [this tutorial](https://docsify.js.org/#/quickstart) or [online demo](https://jsfiddle.net/7ztb8qsr/1/).
|
Look at [this tutorial](https://docsify.js.org/#/quickstart)
|
||||||
|
|
||||||
|
[](https://codesandbox.io/s/307qqv236)
|
||||||
|
|
||||||
## Showcase
|
## Showcase
|
||||||
|
|
||||||
These projects are using docsify to generate their sites. Pull requests welcome :blush:
|
These projects are using docsify to generate their sites. Pull requests welcome :blush:
|
||||||
|
|
||||||
Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify)
|
Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify#showcase)
|
||||||
|
|
||||||
## Similar projects
|
## Similar projects
|
||||||
|
|
||||||
|
|
@ -103,6 +106,6 @@ This project exists thanks to all the people who contribute. [[Contribute](CONTR
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
[MIT](LICENSE)
|
||||||
|
|
||||||
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fdocsifyjs%2Fdocsify?ref=badge_large)
|
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fdocsifyjs%2Fdocsify?ref=badge_large)
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ const buildAllPlugin = function () {
|
||||||
var plugins = [
|
var plugins = [
|
||||||
{name: 'search', input: 'search/index.js'},
|
{name: 'search', input: 'search/index.js'},
|
||||||
{name: 'ga', input: 'ga.js'},
|
{name: 'ga', input: 'ga.js'},
|
||||||
|
{name: 'matomo', input: 'matomo.js'},
|
||||||
{name: 'emoji', input: 'emoji.js'},
|
{name: 'emoji', input: 'emoji.js'},
|
||||||
{name: 'external-script', input: 'external-script.js'},
|
{name: 'external-script', input: 'external-script.js'},
|
||||||
{name: 'front-matter', input: 'front-matter/index.js'},
|
{name: 'front-matter', input: 'front-matter/index.js'},
|
||||||
|
|
|
||||||
1
build/release.sh
Normal file → Executable file
1
build/release.sh
Normal file → Executable file
|
|
@ -29,7 +29,6 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
|
||||||
# commit
|
# commit
|
||||||
git add -A
|
git add -A
|
||||||
git add -f lib/ -A
|
|
||||||
git commit -m "[build] $VERSION $RELEASE_TAG"
|
git commit -m "[build] $VERSION $RELEASE_TAG"
|
||||||
npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG"
|
npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,17 +11,17 @@ See the [Quick start](quickstart.md) guide for more details.
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- No statically built html files
|
- No statically built html files
|
||||||
- Simple and lightweight (~19kB gzipped)
|
- Simple and lightweight (~21kB gzipped)
|
||||||
- Smart full-text search plugin
|
- Smart full-text search plugin
|
||||||
- Multiple themes
|
- Multiple themes
|
||||||
- Useful plugin API
|
- Useful plugin API
|
||||||
- Emoji support
|
- Emoji support
|
||||||
- Compatible with IE10+
|
- Compatible with IE11
|
||||||
- Support server-side rendering ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
- Support server-side rendering ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
Check out the [Showcase](https://github.com/docsifyjs/docsify/#showcase) to see docsify in use.
|
Check out the [Showcase](https://github.com/docsifyjs/awesome-docsify#showcase) to see docsify in use.
|
||||||
|
|
||||||
## Donate
|
## Donate
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||

|

|
||||||
|
|
||||||
# docsify <small>4.8.1</small>
|
# docsify <small>4.9.4</small>
|
||||||
|
|
||||||
> A magical documentation site generator.
|
> A magical documentation site generator.
|
||||||
|
|
||||||
* Simple and lightweight (~19kB gzipped)
|
- Simple and lightweight (~21kB gzipped)
|
||||||
* No statically built html files
|
- No statically built html files
|
||||||
* Multiple themes
|
- Multiple themes
|
||||||
|
|
||||||
[GitHub](https://github.com/docsifyjs/docsify/)
|
[GitHub](https://github.com/docsifyjs/docsify/)
|
||||||
[Getting Started](#docsify)
|
[Getting Started](#docsify)
|
||||||
|
|
|
||||||
16
docs/_media/example.js
Normal file
16
docs/_media/example.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import fetch from 'fetch'
|
||||||
|
|
||||||
|
const URL = 'https://example.com'
|
||||||
|
const PORT = 8080
|
||||||
|
|
||||||
|
/// [demo]
|
||||||
|
const result = fetch(`${URL}:${PORT}`)
|
||||||
|
.then(function(response) {
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(function(myJson) {
|
||||||
|
console.log(JSON.stringify(myJson));
|
||||||
|
});
|
||||||
|
/// [demo]
|
||||||
|
|
||||||
|
result.then(console.log).catch(console.error)
|
||||||
|
|
@ -150,6 +150,46 @@ window.$docsify = {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## relativePath
|
||||||
|
|
||||||
|
- Type: `Boolean`
|
||||||
|
- Default: `false`
|
||||||
|
|
||||||
|
If **true** links are relative to the current context.
|
||||||
|
|
||||||
|
For example, the directory structure is as follows:
|
||||||
|
|
||||||
|
```text
|
||||||
|
.
|
||||||
|
└── docs
|
||||||
|
├── README.md
|
||||||
|
├── guide.md
|
||||||
|
└── zh-cn
|
||||||
|
├── README.md
|
||||||
|
├── guide.md
|
||||||
|
└── config
|
||||||
|
└── example.md
|
||||||
|
```
|
||||||
|
|
||||||
|
With relative path **enabled** and current URL `http://domain.com/zh-cn/README`, given links will resolve to:
|
||||||
|
|
||||||
|
```text
|
||||||
|
guide.md => http://domain.com/zh-cn/guide
|
||||||
|
config/example.md => http://domain.com/zh-cn/config/example
|
||||||
|
../README.md => http://domain.com/README
|
||||||
|
/README.md => http://domain.com/README
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
window.$docsify = {
|
||||||
|
// Relative path enabled
|
||||||
|
relativePath: true,
|
||||||
|
|
||||||
|
// Relative path disabled (default value)
|
||||||
|
relativePath: false
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
## coverpage
|
## coverpage
|
||||||
|
|
||||||
- Type: `Boolean|String|String[]|Object`
|
- Type: `Boolean|String|String[]|Object`
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ Set `coverpage` to **true**, and create a `_coverpage.md`:
|
||||||
|
|
||||||
> A magical documentation site generator.
|
> A magical documentation site generator.
|
||||||
|
|
||||||
* Simple and lightweight (~19kB gzipped)
|
- Simple and lightweight (~21kB gzipped)
|
||||||
* No statically built html files
|
- No statically built html files
|
||||||
* Multiple themes
|
- Multiple themes
|
||||||
|
|
||||||
[GitHub](https://github.com/docsifyjs/docsify/)
|
[GitHub](https://github.com/docsifyjs/docsify/)
|
||||||
[Get Started](#docsify)
|
[Get Started](#docsify)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ It is recommended that you save your files to the `./docs` subfolder of the `mas
|
||||||

|

|
||||||
|
|
||||||
!> You can also save files in the root directory and select `master branch`.
|
!> You can also save files in the root directory and select `master branch`.
|
||||||
You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch
|
You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch)
|
||||||
|
|
||||||
## GitLab Pages
|
## GitLab Pages
|
||||||
|
|
||||||
|
|
@ -87,3 +87,45 @@ When using the HTML5 router, you need to set up redirect rules that redirect all
|
||||||
```sh
|
```sh
|
||||||
/* /index.html 200
|
/* /index.html 200
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## AWS Amplify
|
||||||
|
|
||||||
|
1. Set the routerMode in the Docsify project `index.html` to *history* mode.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script>
|
||||||
|
window.$docsify = {
|
||||||
|
loadSidebar: true,
|
||||||
|
routerMode: 'history'
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Login to your [AWS Console](https://aws.amazon.com).
|
||||||
|
3. Go to the [AWS Amplify Dashboard](https://aws.amazon.com/amplify).
|
||||||
|
4. Choose the **Deploy** route to setup your project.
|
||||||
|
5. When prompted, keep the build settings empty if you're serving your docs within the root directory. If you're serving your docs from a different directory, customise your amplify.yml
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: 0.1
|
||||||
|
frontend:
|
||||||
|
phases:
|
||||||
|
build:
|
||||||
|
commands:
|
||||||
|
- echo "Nothing to build"
|
||||||
|
artifacts:
|
||||||
|
baseDirectory: /docs
|
||||||
|
files:
|
||||||
|
- '**/*'
|
||||||
|
cache:
|
||||||
|
paths: []
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Add the following Redirect rules in their displayed order.
|
||||||
|
|
||||||
|
| Source address | Target address | Type |
|
||||||
|
|----------------|----------------|---------------|
|
||||||
|
| /<*>.md | /<*>.md | 200 (Rewrite) |
|
||||||
|
| /<*> | /index.html | 200 (Rewrite) |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,21 @@ You will get it
|
||||||
|
|
||||||
[filename](_media/example.md ':include :type=code')
|
[filename](_media/example.md ':include :type=code')
|
||||||
|
|
||||||
|
## Embedded code fragments
|
||||||
|
Sometimes you don't want to embed a whole file. Maybe because you need just a few lines but you want to compile and test the file in CI.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
[filename](_media/example.js ':include :type=code :fragment=demo')
|
||||||
|
```
|
||||||
|
|
||||||
|
In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment).
|
||||||
|
Alternatively you can use `### [demo]`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
[filename](_media/example.js ':include :type=code :fragment=demo')
|
||||||
|
|
||||||
|
|
||||||
## Tag attribute
|
## Tag attribute
|
||||||
|
|
||||||
If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags.
|
If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags.
|
||||||
|
|
|
||||||
|
|
@ -88,9 +88,58 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
|
||||||

|

|
||||||
|
|
||||||
<!-- Support percentage -->
|
<!-- Support percentage -->
|
||||||
|
|
||||||

|

|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
|
## Customise ID for headings
|
||||||
|
|
||||||
|
```md
|
||||||
|
### 你好,世界! :id=hello-world
|
||||||
|
```
|
||||||
|
|
||||||
|
## 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>
|
||||||
|
|
||||||
|
Or markdown content can be wrapped in html tag.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
<div style='color: red'>
|
||||||
|
|
||||||
|
- listitem
|
||||||
|
- listitem
|
||||||
|
- listitem
|
||||||
|
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
<div style='color: red'>
|
||||||
|
|
||||||
|
- Abc
|
||||||
|
- Abc
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@
|
||||||
maxLevel: 4,
|
maxLevel: 4,
|
||||||
subMaxLevel: 2,
|
subMaxLevel: 2,
|
||||||
ga: 'UA-106147152-1',
|
ga: 'UA-106147152-1',
|
||||||
|
matomo: {
|
||||||
|
host: '//matomo.thunderwave.de',
|
||||||
|
id: 6
|
||||||
|
},
|
||||||
name: 'docsify',
|
name: 'docsify',
|
||||||
search: {
|
search: {
|
||||||
noData: {
|
noData: {
|
||||||
|
|
@ -84,6 +88,7 @@
|
||||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||||
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
||||||
<script src="//unpkg.com/docsify/lib/plugins/ga.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/plugins/ga.min.js"></script>
|
||||||
|
<script src="//unpkg.com/docsify/lib/plugins/matomo.min.js"></script>
|
||||||
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
||||||
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
|
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
|
||||||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ window.$docsify = {
|
||||||
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
|
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
|
||||||
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||||
|
|
||||||
|
var num = 0;
|
||||||
mermaid.initialize({ startOnLoad: false });
|
mermaid.initialize({ startOnLoad: false });
|
||||||
|
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
|
|
@ -44,7 +45,7 @@ window.$docsify = {
|
||||||
code: function(code, lang) {
|
code: function(code, lang) {
|
||||||
if (lang === "mermaid") {
|
if (lang === "mermaid") {
|
||||||
return (
|
return (
|
||||||
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
|
'<div class="mermaid">' + mermaid.render('mermaid-svg-' + num++, code) + "</div>"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return this.origin.code.apply(this, arguments);
|
return this.origin.code.apply(this, arguments);
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,16 @@ You can specify `alias` to avoid unnecessary fallback.
|
||||||
|
|
||||||
!> You can create a `README.md` file in a subdirectory to use it as the landing page for the route.
|
!> You can create a `README.md` file in a subdirectory to use it as the landing page for the route.
|
||||||
|
|
||||||
|
## Set Page Titles from Sidebar Selection
|
||||||
|
|
||||||
|
A page's `title` tag is generated from the _selected_ sidebar item name. For better SEO, you can customize the title by specifying a string after the filename.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
<!-- docs/_sidebar.md -->
|
||||||
|
* [Home](/)
|
||||||
|
* [Guide](guide.md "The greatest guide in the world")
|
||||||
|
```
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.
|
Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,10 @@ By default, the hyperlink on the current page is recognized and the content is s
|
||||||
depth: 2,
|
depth: 2,
|
||||||
|
|
||||||
hideOtherSidebarContent: false, // whether or not to hide other sidebar content
|
hideOtherSidebarContent: false, // whether or not to hide other sidebar content
|
||||||
|
|
||||||
|
// To avoid search index collision
|
||||||
|
// between multiple websites under the same domain
|
||||||
|
namespace: 'website-1',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -95,7 +99,7 @@ Medium's image zoom. Based on [medium-zoom](https://github.com/francoischalifour
|
||||||
Exclude the special image
|
Exclude the special image
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||

|

|
||||||
```
|
```
|
||||||
|
|
||||||
## Edit on github
|
## Edit on github
|
||||||
|
|
@ -184,6 +188,10 @@ window.$docsify = {
|
||||||
|
|
||||||
A docsify.js plugin for displaying tabbed content from markdown.
|
A docsify.js plugin for displaying tabbed content from markdown.
|
||||||
|
|
||||||
* [Documentation & Demos](https://jhildenbiddle.github.io/docsify-tabs)
|
- [Documentation & Demos](https://jhildenbiddle.github.io/docsify-tabs)
|
||||||
|
|
||||||
Provided by [@jhildenbiddle](https://github.com/jhildenbiddle/docsify-tabs).
|
Provided by [@jhildenbiddle](https://github.com/jhildenbiddle/docsify-tabs).
|
||||||
|
|
||||||
|
## More plugins
|
||||||
|
|
||||||
|
See [awesome-docsify](awesome?id=plugins)
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ var readFileSync = require('fs').readFileSync
|
||||||
|
|
||||||
// init
|
// init
|
||||||
var renderer = new Renderer({
|
var renderer = new Renderer({
|
||||||
template: readFileSync('./docs/index.template.html', 'utf-8').,
|
template: readFileSync('./docs/index.template.html', 'utf-8'),
|
||||||
config: {
|
config: {
|
||||||
name: 'docsify',
|
name: 'docsify',
|
||||||
repo: 'docsifyjs/docsify'
|
repo: 'docsifyjs/docsify'
|
||||||
|
|
|
||||||
|
|
@ -6,41 +6,41 @@ A plugin is simply a function that takes `hook` as an argument. The hook support
|
||||||
|
|
||||||
```js
|
```js
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
plugins: [
|
plugins: [
|
||||||
function (hook, vm) {
|
function(hook, vm) {
|
||||||
hook.init(function() {
|
hook.init(function() {
|
||||||
// Called when the script starts running, only trigger once, no arguments,
|
// Called when the script starts running, only trigger once, no arguments,
|
||||||
})
|
});
|
||||||
|
|
||||||
hook.beforeEach(function(content) {
|
hook.beforeEach(function(content) {
|
||||||
// Invoked each time before parsing the Markdown file.
|
// Invoked each time before parsing the Markdown file.
|
||||||
// ...
|
// ...
|
||||||
return content
|
return content;
|
||||||
})
|
});
|
||||||
|
|
||||||
hook.afterEach(function(html, next) {
|
hook.afterEach(function(html, next) {
|
||||||
// Invoked each time after the Markdown file is parsed.
|
// Invoked each time after the Markdown file is parsed.
|
||||||
// beforeEach and afterEach support asynchronous。
|
// beforeEach and afterEach support asynchronous。
|
||||||
// ...
|
// ...
|
||||||
// call `next(html)` when task is done.
|
// call `next(html)` when task is done.
|
||||||
next(html)
|
next(html);
|
||||||
})
|
});
|
||||||
|
|
||||||
hook.doneEach(function() {
|
hook.doneEach(function() {
|
||||||
// Invoked each time after the data is fully loaded, no arguments,
|
// Invoked each time after the data is fully loaded, no arguments,
|
||||||
// ...
|
// ...
|
||||||
})
|
});
|
||||||
|
|
||||||
hook.mounted(function() {
|
hook.mounted(function() {
|
||||||
// Called after initial completion. Only trigger once, no arguments.
|
// Called after initial completion. Only trigger once, no arguments.
|
||||||
})
|
});
|
||||||
|
|
||||||
hook.ready(function() {
|
hook.ready(function() {
|
||||||
// Called after initial completion, no arguments.
|
// Called after initial completion, no arguments.
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
!> You can get internal methods through `window.Docsify`. Get the current instance through the second argument.
|
!> You can get internal methods through `window.Docsify`. Get the current instance through the second argument.
|
||||||
|
|
@ -54,21 +54,21 @@ Add footer component in each pages.
|
||||||
```js
|
```js
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
plugins: [
|
plugins: [
|
||||||
function (hook) {
|
function(hook) {
|
||||||
var footer = [
|
var footer = [
|
||||||
'<hr/>',
|
'<hr/>',
|
||||||
'<footer>',
|
'<footer>',
|
||||||
'<span><a href="https://github.com/QingWei-Li">cinwell</a> ©2017.</span>',
|
'<span><a href="https://github.com/QingWei-Li">cinwell</a> ©2017.</span>',
|
||||||
'<span>Proudly published with <a href="https://github.com/docsifyjs/docsify" target="_blank">docsify</a>.</span>',
|
'<span>Proudly published with <a href="https://github.com/docsifyjs/docsify" target="_blank">docsify</a>.</span>',
|
||||||
'</footer>'
|
'</footer>'
|
||||||
].join('')
|
].join('');
|
||||||
|
|
||||||
hook.afterEach(function (html) {
|
hook.afterEach(function(html) {
|
||||||
return html + footer
|
return html + footer;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
### Edit Button
|
### Edit Button
|
||||||
|
|
@ -77,17 +77,35 @@ window.$docsify = {
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
plugins: [
|
plugins: [
|
||||||
function(hook, vm) {
|
function(hook, vm) {
|
||||||
hook.beforeEach(function (html) {
|
hook.beforeEach(function(html) {
|
||||||
var url = 'https://github.com/docsifyjs/docsify/blob/master/docs' + vm.route.file
|
var url =
|
||||||
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
|
'https://github.com/docsifyjs/docsify/blob/master/docs/' +
|
||||||
|
vm.route.file;
|
||||||
|
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n';
|
||||||
|
|
||||||
return editHtml
|
return (
|
||||||
+ html
|
editHtml +
|
||||||
+ '\n----\n'
|
html +
|
||||||
+ 'Last modified {docsify-updated} '
|
'\n----\n' +
|
||||||
+ editHtml
|
'Last modified {docsify-updated} ' +
|
||||||
})
|
editHtml
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Tips
|
||||||
|
|
||||||
|
### Get docsify version
|
||||||
|
|
||||||
|
```
|
||||||
|
console.log(window.Docsify.version)
|
||||||
|
```
|
||||||
|
|
||||||
|
Current version: <span id='tip-version'>loading</span>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('tip-version').innerText = Docsify.version
|
||||||
|
</script>
|
||||||
|
|
|
||||||
40
index.html
40
index.html
|
|
@ -21,48 +21,64 @@
|
||||||
<script>
|
<script>
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
alias: {
|
alias: {
|
||||||
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG',
|
'.*?/awesome': 'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
|
||||||
|
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
|
||||||
'/.*/_navbar.md': '/_navbar.md',
|
'/.*/_navbar.md': '/_navbar.md',
|
||||||
'/zh-cn/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
|
'/zh-cn/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
|
||||||
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
|
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
|
||||||
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
|
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
|
||||||
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
|
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
|
||||||
},
|
},
|
||||||
notFoundPage: '_404.html',
|
|
||||||
auto2top: true,
|
auto2top: true,
|
||||||
basePath: '/docs/',
|
basePath: '/docs/',
|
||||||
executeScript: true,
|
|
||||||
loadNavbar: true,
|
|
||||||
loadSidebar: true,
|
|
||||||
coverpage: true,
|
coverpage: true,
|
||||||
name: 'docsify',
|
executeScript: true,
|
||||||
subMaxLevel: 2,
|
loadSidebar: true,
|
||||||
|
loadNavbar: true,
|
||||||
mergeNavbar: true,
|
mergeNavbar: true,
|
||||||
|
maxLevel: 4,
|
||||||
|
subMaxLevel: 2,
|
||||||
|
name: 'docsify',
|
||||||
|
search: {
|
||||||
|
noData: {
|
||||||
|
'/de-de/': 'Keine Ergebnisse!',
|
||||||
|
'/zh-cn/': '没有结果!',
|
||||||
|
'/': 'No results!'
|
||||||
|
},
|
||||||
|
paths: 'auto',
|
||||||
|
placeholder: {
|
||||||
|
'/de-de/': 'Suche',
|
||||||
|
'/zh-cn/': '搜索',
|
||||||
|
'/': 'Search'
|
||||||
|
}
|
||||||
|
},
|
||||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||||
plugins: [
|
plugins: [
|
||||||
function (hook, vm) {
|
function (hook, vm) {
|
||||||
hook.beforeEach(function (html) {
|
hook.beforeEach(function (html) {
|
||||||
var url
|
|
||||||
if (/githubusercontent\.com/.test(vm.route.file)) {
|
if (/githubusercontent\.com/.test(vm.route.file)) {
|
||||||
url = vm.route.file
|
url = vm.route.file
|
||||||
.replace('raw.githubusercontent.com', 'github.com')
|
.replace('raw.githubusercontent.com', 'github.com')
|
||||||
.replace(/\/master/, '/blob/master')
|
.replace(/\/master/, '/blob/master')
|
||||||
} else {
|
} else {
|
||||||
url = 'https://github.com/docsifyjs/docsify/blob/master/' + vm.route.file
|
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
|
||||||
}
|
}
|
||||||
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||||
|
|
||||||
return editHtml
|
return editHtml
|
||||||
+ html
|
+ html
|
||||||
+ '\n\n----\n\n'
|
+ '\n\n----\n\n'
|
||||||
+ 'Last modified {docsify-updated} '
|
+ '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
|
||||||
+ editHtml
|
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="/lib/docsify.js"></script>
|
<script src="/lib/docsify.js"></script>
|
||||||
|
<script src="/lib/plugins/search.js"></script>
|
||||||
|
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
||||||
|
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
|
||||||
|
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
4962
lib/docsify.js
4962
lib/docsify.js
File diff suppressed because it is too large
Load diff
1
lib/docsify.min.js
vendored
1
lib/docsify.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,54 +0,0 @@
|
||||||
(function () {
|
|
||||||
var fixedPath = location.href.replace('/-/', '/#/');
|
|
||||||
if (fixedPath !== location.href) {
|
|
||||||
location.href = fixedPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
function install(hook, vm) {
|
|
||||||
var dom = Docsify.dom;
|
|
||||||
var disqus = vm.config.disqus;
|
|
||||||
if (!disqus) {
|
|
||||||
throw Error('$docsify.disqus is required')
|
|
||||||
}
|
|
||||||
|
|
||||||
hook.init(function (_) {
|
|
||||||
var script = dom.create('script');
|
|
||||||
|
|
||||||
script.async = true;
|
|
||||||
script.src = "https://" + disqus + ".disqus.com/embed.js";
|
|
||||||
script.setAttribute('data-timestamp', Number(new Date()));
|
|
||||||
dom.appendTo(dom.body, script);
|
|
||||||
});
|
|
||||||
|
|
||||||
hook.mounted(function (_) {
|
|
||||||
var div = dom.create('div');
|
|
||||||
div.id = 'disqus_thread';
|
|
||||||
var main = dom.getNode('#main');
|
|
||||||
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
|
|
||||||
dom.appendTo(dom.find('.content'), div);
|
|
||||||
|
|
||||||
// eslint-disable-next-line
|
|
||||||
window.disqus_config = function() {
|
|
||||||
this.page.url = location.origin + '/-' + vm.route.path;
|
|
||||||
this.page.identifier = vm.route.path;
|
|
||||||
this.page.title = document.title;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
hook.doneEach(function (_) {
|
|
||||||
if (typeof window.DISQUS !== 'undefined') {
|
|
||||||
window.DISQUS.reset({
|
|
||||||
reload: true,
|
|
||||||
config: function () {
|
|
||||||
this.page.url = location.origin + '/-' + vm.route.path;
|
|
||||||
this.page.identifier = vm.route.path;
|
|
||||||
this.page.title = document.title;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
|
||||||
|
|
||||||
}());
|
|
||||||
1
lib/plugins/disqus.min.js
vendored
1
lib/plugins/disqus.min.js
vendored
|
|
@ -1 +0,0 @@
|
||||||
!function(){var i=location.href.replace("/-/","/#/");i!==location.href&&(location.href=i),$docsify.plugins=[].concat(function(i,o){var n=Docsify.dom,e=o.config.disqus;if(!e)throw Error("$docsify.disqus is required");i.init(function(i){var t=n.create("script");t.async=!0,t.src="https://"+e+".disqus.com/embed.js",t.setAttribute("data-timestamp",Number(new Date)),n.appendTo(n.body,t)}),i.mounted(function(i){var t=n.create("div");t.id="disqus_thread";var e=n.getNode("#main");t.style="width: "+e.clientWidth+"px; margin: 0 auto 20px;",n.appendTo(n.find(".content"),t),window.disqus_config=function(){this.page.url=location.origin+"/-"+o.route.path,this.page.identifier=o.route.path,this.page.title=document.title}}),i.doneEach(function(i){void 0!==window.DISQUS&&window.DISQUS.reset({reload:!0,config:function(){this.page.url=location.origin+"/-"+o.route.path,this.page.identifier=o.route.path,this.page.title=document.title}})})},$docsify.plugins)}();
|
|
||||||
|
|
@ -1,903 +0,0 @@
|
||||||
(function () {
|
|
||||||
var AllGithubEmoji = [
|
|
||||||
'+1',
|
|
||||||
'100',
|
|
||||||
'1234',
|
|
||||||
'8ball',
|
|
||||||
'a',
|
|
||||||
'ab',
|
|
||||||
'abc',
|
|
||||||
'abcd',
|
|
||||||
'accept',
|
|
||||||
'aerial_tramway',
|
|
||||||
'airplane',
|
|
||||||
'alarm_clock',
|
|
||||||
'alien',
|
|
||||||
'ambulance',
|
|
||||||
'anchor',
|
|
||||||
'angel',
|
|
||||||
'anger',
|
|
||||||
'angry',
|
|
||||||
'anguished',
|
|
||||||
'ant',
|
|
||||||
'apple',
|
|
||||||
'aquarius',
|
|
||||||
'aries',
|
|
||||||
'arrow_backward',
|
|
||||||
'arrow_double_down',
|
|
||||||
'arrow_double_up',
|
|
||||||
'arrow_down',
|
|
||||||
'arrow_down_small',
|
|
||||||
'arrow_forward',
|
|
||||||
'arrow_heading_down',
|
|
||||||
'arrow_heading_up',
|
|
||||||
'arrow_left',
|
|
||||||
'arrow_lower_left',
|
|
||||||
'arrow_lower_right',
|
|
||||||
'arrow_right',
|
|
||||||
'arrow_right_hook',
|
|
||||||
'arrow_up',
|
|
||||||
'arrow_up_down',
|
|
||||||
'arrow_up_small',
|
|
||||||
'arrow_upper_left',
|
|
||||||
'arrow_upper_right',
|
|
||||||
'arrows_clockwise',
|
|
||||||
'arrows_counterclockwise',
|
|
||||||
'art',
|
|
||||||
'articulated_lorry',
|
|
||||||
'astonished',
|
|
||||||
'athletic_shoe',
|
|
||||||
'atm',
|
|
||||||
'b',
|
|
||||||
'baby',
|
|
||||||
'baby_bottle',
|
|
||||||
'baby_chick',
|
|
||||||
'baby_symbol',
|
|
||||||
'back',
|
|
||||||
'baggage_claim',
|
|
||||||
'balloon',
|
|
||||||
'ballot_box_with_check',
|
|
||||||
'bamboo',
|
|
||||||
'banana',
|
|
||||||
'bangbang',
|
|
||||||
'bank',
|
|
||||||
'bar_chart',
|
|
||||||
'barber',
|
|
||||||
'baseball',
|
|
||||||
'basketball',
|
|
||||||
'bath',
|
|
||||||
'bathtub',
|
|
||||||
'battery',
|
|
||||||
'bear',
|
|
||||||
'bee',
|
|
||||||
'beer',
|
|
||||||
'beers',
|
|
||||||
'beetle',
|
|
||||||
'beginner',
|
|
||||||
'bell',
|
|
||||||
'bento',
|
|
||||||
'bicyclist',
|
|
||||||
'bike',
|
|
||||||
'bikini',
|
|
||||||
'bird',
|
|
||||||
'birthday',
|
|
||||||
'black_circle',
|
|
||||||
'black_joker',
|
|
||||||
'black_large_square',
|
|
||||||
'black_medium_small_square',
|
|
||||||
'black_medium_square',
|
|
||||||
'black_nib',
|
|
||||||
'black_small_square',
|
|
||||||
'black_square_button',
|
|
||||||
'blossom',
|
|
||||||
'blowfish',
|
|
||||||
'blue_book',
|
|
||||||
'blue_car',
|
|
||||||
'blue_heart',
|
|
||||||
'blush',
|
|
||||||
'boar',
|
|
||||||
'boat',
|
|
||||||
'bomb',
|
|
||||||
'book',
|
|
||||||
'bookmark',
|
|
||||||
'bookmark_tabs',
|
|
||||||
'books',
|
|
||||||
'boom',
|
|
||||||
'boot',
|
|
||||||
'bouquet',
|
|
||||||
'bow',
|
|
||||||
'bowling',
|
|
||||||
'bowtie',
|
|
||||||
'boy',
|
|
||||||
'bread',
|
|
||||||
'bride_with_veil',
|
|
||||||
'bridge_at_night',
|
|
||||||
'briefcase',
|
|
||||||
'broken_heart',
|
|
||||||
'bug',
|
|
||||||
'bulb',
|
|
||||||
'bullettrain_front',
|
|
||||||
'bullettrain_side',
|
|
||||||
'bus',
|
|
||||||
'busstop',
|
|
||||||
'bust_in_silhouette',
|
|
||||||
'busts_in_silhouette',
|
|
||||||
'cactus',
|
|
||||||
'cake',
|
|
||||||
'calendar',
|
|
||||||
'calling',
|
|
||||||
'camel',
|
|
||||||
'camera',
|
|
||||||
'cancer',
|
|
||||||
'candy',
|
|
||||||
'capital_abcd',
|
|
||||||
'capricorn',
|
|
||||||
'car',
|
|
||||||
'card_index',
|
|
||||||
'carousel_horse',
|
|
||||||
'cat',
|
|
||||||
'cat2',
|
|
||||||
'cd',
|
|
||||||
'chart',
|
|
||||||
'chart_with_downwards_trend',
|
|
||||||
'chart_with_upwards_trend',
|
|
||||||
'checkered_flag',
|
|
||||||
'cherries',
|
|
||||||
'cherry_blossom',
|
|
||||||
'chestnut',
|
|
||||||
'chicken',
|
|
||||||
'children_crossing',
|
|
||||||
'chocolate_bar',
|
|
||||||
'christmas_tree',
|
|
||||||
'church',
|
|
||||||
'cinema',
|
|
||||||
'circus_tent',
|
|
||||||
'city_sunrise',
|
|
||||||
'city_sunset',
|
|
||||||
'cl',
|
|
||||||
'clap',
|
|
||||||
'clapper',
|
|
||||||
'clipboard',
|
|
||||||
'clock1',
|
|
||||||
'clock10',
|
|
||||||
'clock1030',
|
|
||||||
'clock11',
|
|
||||||
'clock1130',
|
|
||||||
'clock12',
|
|
||||||
'clock1230',
|
|
||||||
'clock130',
|
|
||||||
'clock2',
|
|
||||||
'clock230',
|
|
||||||
'clock3',
|
|
||||||
'clock330',
|
|
||||||
'clock4',
|
|
||||||
'clock430',
|
|
||||||
'clock5',
|
|
||||||
'clock530',
|
|
||||||
'clock6',
|
|
||||||
'clock630',
|
|
||||||
'clock7',
|
|
||||||
'clock730',
|
|
||||||
'clock8',
|
|
||||||
'clock830',
|
|
||||||
'clock9',
|
|
||||||
'clock930',
|
|
||||||
'closed_book',
|
|
||||||
'closed_lock_with_key',
|
|
||||||
'closed_umbrella',
|
|
||||||
'cloud',
|
|
||||||
'clubs',
|
|
||||||
'cn',
|
|
||||||
'cocktail',
|
|
||||||
'coffee',
|
|
||||||
'cold_sweat',
|
|
||||||
'collision',
|
|
||||||
'computer',
|
|
||||||
'confetti_ball',
|
|
||||||
'confounded',
|
|
||||||
'confused',
|
|
||||||
'congratulations',
|
|
||||||
'construction',
|
|
||||||
'construction_worker',
|
|
||||||
'convenience_store',
|
|
||||||
'cookie',
|
|
||||||
'cool',
|
|
||||||
'cop',
|
|
||||||
'copyright',
|
|
||||||
'corn',
|
|
||||||
'couple',
|
|
||||||
'couple_with_heart',
|
|
||||||
'couplekiss',
|
|
||||||
'cow',
|
|
||||||
'cow2',
|
|
||||||
'credit_card',
|
|
||||||
'crescent_moon',
|
|
||||||
'crocodile',
|
|
||||||
'crossed_flags',
|
|
||||||
'crown',
|
|
||||||
'cry',
|
|
||||||
'crying_cat_face',
|
|
||||||
'crystal_ball',
|
|
||||||
'cupid',
|
|
||||||
'curly_loop',
|
|
||||||
'currency_exchange',
|
|
||||||
'curry',
|
|
||||||
'custard',
|
|
||||||
'customs',
|
|
||||||
'cyclone',
|
|
||||||
'dancer',
|
|
||||||
'dancers',
|
|
||||||
'dango',
|
|
||||||
'dart',
|
|
||||||
'dash',
|
|
||||||
'date',
|
|
||||||
'de',
|
|
||||||
'deciduous_tree',
|
|
||||||
'department_store',
|
|
||||||
'diamond_shape_with_a_dot_inside',
|
|
||||||
'diamonds',
|
|
||||||
'disappointed',
|
|
||||||
'disappointed_relieved',
|
|
||||||
'dizzy',
|
|
||||||
'dizzy_face',
|
|
||||||
'do_not_litter',
|
|
||||||
'dog',
|
|
||||||
'dog2',
|
|
||||||
'dollar',
|
|
||||||
'dolls',
|
|
||||||
'dolphin',
|
|
||||||
'door',
|
|
||||||
'doughnut',
|
|
||||||
'dragon',
|
|
||||||
'dragon_face',
|
|
||||||
'dress',
|
|
||||||
'dromedary_camel',
|
|
||||||
'droplet',
|
|
||||||
'dvd',
|
|
||||||
'e-mail',
|
|
||||||
'ear',
|
|
||||||
'ear_of_rice',
|
|
||||||
'earth_africa',
|
|
||||||
'earth_americas',
|
|
||||||
'earth_asia',
|
|
||||||
'egg',
|
|
||||||
'eggplant',
|
|
||||||
'eight',
|
|
||||||
'eight_pointed_black_star',
|
|
||||||
'eight_spoked_asterisk',
|
|
||||||
'electric_plug',
|
|
||||||
'elephant',
|
|
||||||
'email',
|
|
||||||
'end',
|
|
||||||
'envelope',
|
|
||||||
'envelope_with_arrow',
|
|
||||||
'es',
|
|
||||||
'euro',
|
|
||||||
'european_castle',
|
|
||||||
'european_post_office',
|
|
||||||
'evergreen_tree',
|
|
||||||
'exclamation',
|
|
||||||
'expressionless',
|
|
||||||
'eyeglasses',
|
|
||||||
'eyes',
|
|
||||||
'facepunch',
|
|
||||||
'factory',
|
|
||||||
'fallen_leaf',
|
|
||||||
'family',
|
|
||||||
'fast_forward',
|
|
||||||
'fax',
|
|
||||||
'fearful',
|
|
||||||
'feelsgood',
|
|
||||||
'feet',
|
|
||||||
'ferris_wheel',
|
|
||||||
'file_folder',
|
|
||||||
'finnadie',
|
|
||||||
'fire',
|
|
||||||
'fire_engine',
|
|
||||||
'fireworks',
|
|
||||||
'first_quarter_moon',
|
|
||||||
'first_quarter_moon_with_face',
|
|
||||||
'fish',
|
|
||||||
'fish_cake',
|
|
||||||
'fishing_pole_and_fish',
|
|
||||||
'fist',
|
|
||||||
'five',
|
|
||||||
'flags',
|
|
||||||
'flashlight',
|
|
||||||
'flipper',
|
|
||||||
'floppy_disk',
|
|
||||||
'flower_playing_cards',
|
|
||||||
'flushed',
|
|
||||||
'foggy',
|
|
||||||
'football',
|
|
||||||
'footprints',
|
|
||||||
'fork_and_knife',
|
|
||||||
'fountain',
|
|
||||||
'four',
|
|
||||||
'four_leaf_clover',
|
|
||||||
'fr',
|
|
||||||
'free',
|
|
||||||
'fried_shrimp',
|
|
||||||
'fries',
|
|
||||||
'frog',
|
|
||||||
'frowning',
|
|
||||||
'fu',
|
|
||||||
'fuelpump',
|
|
||||||
'full_moon',
|
|
||||||
'full_moon_with_face',
|
|
||||||
'game_die',
|
|
||||||
'gb',
|
|
||||||
'gem',
|
|
||||||
'gemini',
|
|
||||||
'ghost',
|
|
||||||
'gift',
|
|
||||||
'gift_heart',
|
|
||||||
'girl',
|
|
||||||
'globe_with_meridians',
|
|
||||||
'goat',
|
|
||||||
'goberserk',
|
|
||||||
'godmode',
|
|
||||||
'golf',
|
|
||||||
'grapes',
|
|
||||||
'green_apple',
|
|
||||||
'green_book',
|
|
||||||
'green_heart',
|
|
||||||
'grey_exclamation',
|
|
||||||
'grey_question',
|
|
||||||
'grimacing',
|
|
||||||
'grin',
|
|
||||||
'grinning',
|
|
||||||
'guardsman',
|
|
||||||
'guitar',
|
|
||||||
'gun',
|
|
||||||
'haircut',
|
|
||||||
'hamburger',
|
|
||||||
'hammer',
|
|
||||||
'hamster',
|
|
||||||
'hand',
|
|
||||||
'handbag',
|
|
||||||
'hankey',
|
|
||||||
'hash',
|
|
||||||
'hatched_chick',
|
|
||||||
'hatching_chick',
|
|
||||||
'headphones',
|
|
||||||
'hear_no_evil',
|
|
||||||
'heart',
|
|
||||||
'heart_decoration',
|
|
||||||
'heart_eyes',
|
|
||||||
'heart_eyes_cat',
|
|
||||||
'heartbeat',
|
|
||||||
'heartpulse',
|
|
||||||
'hearts',
|
|
||||||
'heavy_check_mark',
|
|
||||||
'heavy_division_sign',
|
|
||||||
'heavy_dollar_sign',
|
|
||||||
'heavy_exclamation_mark',
|
|
||||||
'heavy_minus_sign',
|
|
||||||
'heavy_multiplication_x',
|
|
||||||
'heavy_plus_sign',
|
|
||||||
'helicopter',
|
|
||||||
'herb',
|
|
||||||
'hibiscus',
|
|
||||||
'high_brightness',
|
|
||||||
'high_heel',
|
|
||||||
'hocho',
|
|
||||||
'honey_pot',
|
|
||||||
'honeybee',
|
|
||||||
'horse',
|
|
||||||
'horse_racing',
|
|
||||||
'hospital',
|
|
||||||
'hotel',
|
|
||||||
'hotsprings',
|
|
||||||
'hourglass',
|
|
||||||
'hourglass_flowing_sand',
|
|
||||||
'house',
|
|
||||||
'house_with_garden',
|
|
||||||
'hurtrealbad',
|
|
||||||
'hushed',
|
|
||||||
'ice_cream',
|
|
||||||
'icecream',
|
|
||||||
'id',
|
|
||||||
'ideograph_advantage',
|
|
||||||
'imp',
|
|
||||||
'inbox_tray',
|
|
||||||
'incoming_envelope',
|
|
||||||
'information_desk_person',
|
|
||||||
'information_source',
|
|
||||||
'innocent',
|
|
||||||
'interrobang',
|
|
||||||
'iphone',
|
|
||||||
'it',
|
|
||||||
'izakaya_lantern',
|
|
||||||
'jack_o_lantern',
|
|
||||||
'japan',
|
|
||||||
'japanese_castle',
|
|
||||||
'japanese_goblin',
|
|
||||||
'japanese_ogre',
|
|
||||||
'jeans',
|
|
||||||
'joy',
|
|
||||||
'joy_cat',
|
|
||||||
'jp',
|
|
||||||
'key',
|
|
||||||
'keycap_ten',
|
|
||||||
'kimono',
|
|
||||||
'kiss',
|
|
||||||
'kissing',
|
|
||||||
'kissing_cat',
|
|
||||||
'kissing_closed_eyes',
|
|
||||||
'kissing_heart',
|
|
||||||
'kissing_smiling_eyes',
|
|
||||||
'koala',
|
|
||||||
'koko',
|
|
||||||
'kr',
|
|
||||||
'lantern',
|
|
||||||
'large_blue_circle',
|
|
||||||
'large_blue_diamond',
|
|
||||||
'large_orange_diamond',
|
|
||||||
'last_quarter_moon',
|
|
||||||
'last_quarter_moon_with_face',
|
|
||||||
'laughing',
|
|
||||||
'leaves',
|
|
||||||
'ledger',
|
|
||||||
'left_luggage',
|
|
||||||
'left_right_arrow',
|
|
||||||
'leftwards_arrow_with_hook',
|
|
||||||
'lemon',
|
|
||||||
'leo',
|
|
||||||
'leopard',
|
|
||||||
'libra',
|
|
||||||
'light_rail',
|
|
||||||
'link',
|
|
||||||
'lips',
|
|
||||||
'lipstick',
|
|
||||||
'lock',
|
|
||||||
'lock_with_ink_pen',
|
|
||||||
'lollipop',
|
|
||||||
'loop',
|
|
||||||
'loud_sound',
|
|
||||||
'loudspeaker',
|
|
||||||
'love_hotel',
|
|
||||||
'love_letter',
|
|
||||||
'low_brightness',
|
|
||||||
'm',
|
|
||||||
'mag',
|
|
||||||
'mag_right',
|
|
||||||
'mahjong',
|
|
||||||
'mailbox',
|
|
||||||
'mailbox_closed',
|
|
||||||
'mailbox_with_mail',
|
|
||||||
'mailbox_with_no_mail',
|
|
||||||
'man',
|
|
||||||
'man_with_gua_pi_mao',
|
|
||||||
'man_with_turban',
|
|
||||||
'mans_shoe',
|
|
||||||
'maple_leaf',
|
|
||||||
'mask',
|
|
||||||
'massage',
|
|
||||||
'meat_on_bone',
|
|
||||||
'mega',
|
|
||||||
'melon',
|
|
||||||
'memo',
|
|
||||||
'mens',
|
|
||||||
'metal',
|
|
||||||
'metro',
|
|
||||||
'microphone',
|
|
||||||
'microscope',
|
|
||||||
'milky_way',
|
|
||||||
'minibus',
|
|
||||||
'minidisc',
|
|
||||||
'mobile_phone_off',
|
|
||||||
'money_with_wings',
|
|
||||||
'moneybag',
|
|
||||||
'monkey',
|
|
||||||
'monkey_face',
|
|
||||||
'monorail',
|
|
||||||
'moon',
|
|
||||||
'mortar_board',
|
|
||||||
'mount_fuji',
|
|
||||||
'mountain_bicyclist',
|
|
||||||
'mountain_cableway',
|
|
||||||
'mountain_railway',
|
|
||||||
'mouse',
|
|
||||||
'mouse2',
|
|
||||||
'movie_camera',
|
|
||||||
'moyai',
|
|
||||||
'muscle',
|
|
||||||
'mushroom',
|
|
||||||
'musical_keyboard',
|
|
||||||
'musical_note',
|
|
||||||
'musical_score',
|
|
||||||
'mute',
|
|
||||||
'nail_care',
|
|
||||||
'name_badge',
|
|
||||||
'neckbeard',
|
|
||||||
'necktie',
|
|
||||||
'negative_squared_cross_mark',
|
|
||||||
'neutral_face',
|
|
||||||
'new',
|
|
||||||
'new_moon',
|
|
||||||
'new_moon_with_face',
|
|
||||||
'newspaper',
|
|
||||||
'ng',
|
|
||||||
'night_with_stars',
|
|
||||||
'nine',
|
|
||||||
'no_bell',
|
|
||||||
'no_bicycles',
|
|
||||||
'no_entry',
|
|
||||||
'no_entry_sign',
|
|
||||||
'no_good',
|
|
||||||
'no_mobile_phones',
|
|
||||||
'no_mouth',
|
|
||||||
'no_pedestrians',
|
|
||||||
'no_smoking',
|
|
||||||
'non-potable_water',
|
|
||||||
'nose',
|
|
||||||
'notebook',
|
|
||||||
'notebook_with_decorative_cover',
|
|
||||||
'notes',
|
|
||||||
'nut_and_bolt',
|
|
||||||
'o',
|
|
||||||
'o2',
|
|
||||||
'ocean',
|
|
||||||
'octocat',
|
|
||||||
'octopus',
|
|
||||||
'oden',
|
|
||||||
'office',
|
|
||||||
'ok',
|
|
||||||
'ok_hand',
|
|
||||||
'ok_woman',
|
|
||||||
'older_man',
|
|
||||||
'older_woman',
|
|
||||||
'on',
|
|
||||||
'oncoming_automobile',
|
|
||||||
'oncoming_bus',
|
|
||||||
'oncoming_police_car',
|
|
||||||
'oncoming_taxi',
|
|
||||||
'one',
|
|
||||||
'open_book',
|
|
||||||
'open_file_folder',
|
|
||||||
'open_hands',
|
|
||||||
'open_mouth',
|
|
||||||
'ophiuchus',
|
|
||||||
'orange_book',
|
|
||||||
'outbox_tray',
|
|
||||||
'ox',
|
|
||||||
'package',
|
|
||||||
'page_facing_up',
|
|
||||||
'page_with_curl',
|
|
||||||
'pager',
|
|
||||||
'palm_tree',
|
|
||||||
'panda_face',
|
|
||||||
'paperclip',
|
|
||||||
'parking',
|
|
||||||
'part_alternation_mark',
|
|
||||||
'partly_sunny',
|
|
||||||
'passport_control',
|
|
||||||
'paw_prints',
|
|
||||||
'peach',
|
|
||||||
'pear',
|
|
||||||
'pencil',
|
|
||||||
'pencil2',
|
|
||||||
'penguin',
|
|
||||||
'pensive',
|
|
||||||
'performing_arts',
|
|
||||||
'persevere',
|
|
||||||
'person_frowning',
|
|
||||||
'person_with_blond_hair',
|
|
||||||
'person_with_pouting_face',
|
|
||||||
'phone',
|
|
||||||
'pig',
|
|
||||||
'pig2',
|
|
||||||
'pig_nose',
|
|
||||||
'pill',
|
|
||||||
'pineapple',
|
|
||||||
'pisces',
|
|
||||||
'pizza',
|
|
||||||
'point_down',
|
|
||||||
'point_left',
|
|
||||||
'point_right',
|
|
||||||
'point_up',
|
|
||||||
'point_up_2',
|
|
||||||
'police_car',
|
|
||||||
'poodle',
|
|
||||||
'poop',
|
|
||||||
'post_office',
|
|
||||||
'postal_horn',
|
|
||||||
'postbox',
|
|
||||||
'potable_water',
|
|
||||||
'pouch',
|
|
||||||
'poultry_leg',
|
|
||||||
'pound',
|
|
||||||
'pouting_cat',
|
|
||||||
'pray',
|
|
||||||
'princess',
|
|
||||||
'punch',
|
|
||||||
'purple_heart',
|
|
||||||
'purse',
|
|
||||||
'pushpin',
|
|
||||||
'put_litter_in_its_place',
|
|
||||||
'question',
|
|
||||||
'rabbit',
|
|
||||||
'rabbit2',
|
|
||||||
'racehorse',
|
|
||||||
'radio',
|
|
||||||
'radio_button',
|
|
||||||
'rage',
|
|
||||||
'rage1',
|
|
||||||
'rage2',
|
|
||||||
'rage3',
|
|
||||||
'rage4',
|
|
||||||
'railway_car',
|
|
||||||
'rainbow',
|
|
||||||
'raised_hand',
|
|
||||||
'raised_hands',
|
|
||||||
'raising_hand',
|
|
||||||
'ram',
|
|
||||||
'ramen',
|
|
||||||
'rat',
|
|
||||||
'recycle',
|
|
||||||
'red_car',
|
|
||||||
'red_circle',
|
|
||||||
'registered',
|
|
||||||
'relaxed',
|
|
||||||
'relieved',
|
|
||||||
'repeat',
|
|
||||||
'repeat_one',
|
|
||||||
'restroom',
|
|
||||||
'revolving_hearts',
|
|
||||||
'rewind',
|
|
||||||
'ribbon',
|
|
||||||
'rice',
|
|
||||||
'rice_ball',
|
|
||||||
'rice_cracker',
|
|
||||||
'rice_scene',
|
|
||||||
'ring',
|
|
||||||
'rocket',
|
|
||||||
'roller_coaster',
|
|
||||||
'rooster',
|
|
||||||
'rose',
|
|
||||||
'rotating_light',
|
|
||||||
'round_pushpin',
|
|
||||||
'rowboat',
|
|
||||||
'ru',
|
|
||||||
'rugby_football',
|
|
||||||
'runner',
|
|
||||||
'running',
|
|
||||||
'running_shirt_with_sash',
|
|
||||||
'sa',
|
|
||||||
'sagittarius',
|
|
||||||
'sailboat',
|
|
||||||
'sake',
|
|
||||||
'sandal',
|
|
||||||
'santa',
|
|
||||||
'satellite',
|
|
||||||
'satisfied',
|
|
||||||
'saxophone',
|
|
||||||
'school',
|
|
||||||
'school_satchel',
|
|
||||||
'scissors',
|
|
||||||
'scorpius',
|
|
||||||
'scream',
|
|
||||||
'scream_cat',
|
|
||||||
'scroll',
|
|
||||||
'seat',
|
|
||||||
'secret',
|
|
||||||
'see_no_evil',
|
|
||||||
'seedling',
|
|
||||||
'seven',
|
|
||||||
'shaved_ice',
|
|
||||||
'sheep',
|
|
||||||
'shell',
|
|
||||||
'ship',
|
|
||||||
'shipit',
|
|
||||||
'shirt',
|
|
||||||
'shit',
|
|
||||||
'shoe',
|
|
||||||
'shower',
|
|
||||||
'signal_strength',
|
|
||||||
'six',
|
|
||||||
'six_pointed_star',
|
|
||||||
'ski',
|
|
||||||
'skull',
|
|
||||||
'sleeping',
|
|
||||||
'sleepy',
|
|
||||||
'slot_machine',
|
|
||||||
'small_blue_diamond',
|
|
||||||
'small_orange_diamond',
|
|
||||||
'small_red_triangle',
|
|
||||||
'small_red_triangle_down',
|
|
||||||
'smile',
|
|
||||||
'smile_cat',
|
|
||||||
'smiley',
|
|
||||||
'smiley_cat',
|
|
||||||
'smiling_imp',
|
|
||||||
'smirk',
|
|
||||||
'smirk_cat',
|
|
||||||
'smoking',
|
|
||||||
'snail',
|
|
||||||
'snake',
|
|
||||||
'snowboarder',
|
|
||||||
'snowflake',
|
|
||||||
'snowman',
|
|
||||||
'sob',
|
|
||||||
'soccer',
|
|
||||||
'soon',
|
|
||||||
'sos',
|
|
||||||
'sound',
|
|
||||||
'space_invader',
|
|
||||||
'spades',
|
|
||||||
'spaghetti',
|
|
||||||
'sparkle',
|
|
||||||
'sparkler',
|
|
||||||
'sparkles',
|
|
||||||
'sparkling_heart',
|
|
||||||
'speak_no_evil',
|
|
||||||
'speaker',
|
|
||||||
'speech_balloon',
|
|
||||||
'speedboat',
|
|
||||||
'squirrel',
|
|
||||||
'star',
|
|
||||||
'star2',
|
|
||||||
'stars',
|
|
||||||
'station',
|
|
||||||
'statue_of_liberty',
|
|
||||||
'steam_locomotive',
|
|
||||||
'stew',
|
|
||||||
'straight_ruler',
|
|
||||||
'strawberry',
|
|
||||||
'stuck_out_tongue',
|
|
||||||
'stuck_out_tongue_closed_eyes',
|
|
||||||
'stuck_out_tongue_winking_eye',
|
|
||||||
'sun_with_face',
|
|
||||||
'sunflower',
|
|
||||||
'sunglasses',
|
|
||||||
'sunny',
|
|
||||||
'sunrise',
|
|
||||||
'sunrise_over_mountains',
|
|
||||||
'surfer',
|
|
||||||
'sushi',
|
|
||||||
'suspect',
|
|
||||||
'suspension_railway',
|
|
||||||
'sweat',
|
|
||||||
'sweat_drops',
|
|
||||||
'sweat_smile',
|
|
||||||
'sweet_potato',
|
|
||||||
'swimmer',
|
|
||||||
'symbols',
|
|
||||||
'syringe',
|
|
||||||
'tada',
|
|
||||||
'tanabata_tree',
|
|
||||||
'tangerine',
|
|
||||||
'taurus',
|
|
||||||
'taxi',
|
|
||||||
'tea',
|
|
||||||
'telephone',
|
|
||||||
'telephone_receiver',
|
|
||||||
'telescope',
|
|
||||||
'tennis',
|
|
||||||
'tent',
|
|
||||||
'thought_balloon',
|
|
||||||
'three',
|
|
||||||
'thumbsdown',
|
|
||||||
'thumbsup',
|
|
||||||
'ticket',
|
|
||||||
'tiger',
|
|
||||||
'tiger2',
|
|
||||||
'tired_face',
|
|
||||||
'tm',
|
|
||||||
'toilet',
|
|
||||||
'tokyo_tower',
|
|
||||||
'tomato',
|
|
||||||
'tongue',
|
|
||||||
'top',
|
|
||||||
'tophat',
|
|
||||||
'tractor',
|
|
||||||
'traffic_light',
|
|
||||||
'train',
|
|
||||||
'train2',
|
|
||||||
'tram',
|
|
||||||
'triangular_flag_on_post',
|
|
||||||
'triangular_ruler',
|
|
||||||
'trident',
|
|
||||||
'triumph',
|
|
||||||
'trolleybus',
|
|
||||||
'trollface',
|
|
||||||
'trophy',
|
|
||||||
'tropical_drink',
|
|
||||||
'tropical_fish',
|
|
||||||
'truck',
|
|
||||||
'trumpet',
|
|
||||||
'tshirt',
|
|
||||||
'tulip',
|
|
||||||
'turtle',
|
|
||||||
'tv',
|
|
||||||
'twisted_rightwards_arrows',
|
|
||||||
'two',
|
|
||||||
'two_hearts',
|
|
||||||
'two_men_holding_hands',
|
|
||||||
'two_women_holding_hands',
|
|
||||||
'u5272',
|
|
||||||
'u5408',
|
|
||||||
'u55b6',
|
|
||||||
'u6307',
|
|
||||||
'u6708',
|
|
||||||
'u6709',
|
|
||||||
'u6e80',
|
|
||||||
'u7121',
|
|
||||||
'u7533',
|
|
||||||
'u7981',
|
|
||||||
'u7a7a',
|
|
||||||
'uk',
|
|
||||||
'umbrella',
|
|
||||||
'unamused',
|
|
||||||
'underage',
|
|
||||||
'unlock',
|
|
||||||
'up',
|
|
||||||
'us',
|
|
||||||
'v',
|
|
||||||
'vertical_traffic_light',
|
|
||||||
'vhs',
|
|
||||||
'vibration_mode',
|
|
||||||
'video_camera',
|
|
||||||
'video_game',
|
|
||||||
'violin',
|
|
||||||
'virgo',
|
|
||||||
'volcano',
|
|
||||||
'vs',
|
|
||||||
'walking',
|
|
||||||
'waning_crescent_moon',
|
|
||||||
'waning_gibbous_moon',
|
|
||||||
'warning',
|
|
||||||
'watch',
|
|
||||||
'water_buffalo',
|
|
||||||
'watermelon',
|
|
||||||
'wave',
|
|
||||||
'wavy_dash',
|
|
||||||
'waxing_crescent_moon',
|
|
||||||
'waxing_gibbous_moon',
|
|
||||||
'wc',
|
|
||||||
'weary',
|
|
||||||
'wedding',
|
|
||||||
'whale',
|
|
||||||
'whale2',
|
|
||||||
'wheelchair',
|
|
||||||
'white_check_mark',
|
|
||||||
'white_circle',
|
|
||||||
'white_flower',
|
|
||||||
'white_large_square',
|
|
||||||
'white_medium_small_square',
|
|
||||||
'white_medium_square',
|
|
||||||
'white_small_square',
|
|
||||||
'white_square_button',
|
|
||||||
'wind_chime',
|
|
||||||
'wine_glass',
|
|
||||||
'wink',
|
|
||||||
'wolf',
|
|
||||||
'woman',
|
|
||||||
'womans_clothes',
|
|
||||||
'womans_hat',
|
|
||||||
'womens',
|
|
||||||
'worried',
|
|
||||||
'wrench',
|
|
||||||
'x',
|
|
||||||
'yellow_heart',
|
|
||||||
'yen',
|
|
||||||
'yum',
|
|
||||||
'zap',
|
|
||||||
'zero',
|
|
||||||
'zzz'
|
|
||||||
];
|
|
||||||
|
|
||||||
// Emoji from All-Github-Emoji-Icons
|
|
||||||
// https://github.com/scotch-io/All-Github-Emoji-Icons
|
|
||||||
window.emojify = function (match, $1) {
|
|
||||||
return AllGithubEmoji.indexOf($1) === -1 ?
|
|
||||||
match :
|
|
||||||
'<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/' +
|
|
||||||
$1 +
|
|
||||||
'.png" alt="' +
|
|
||||||
$1 +
|
|
||||||
'" />'
|
|
||||||
};
|
|
||||||
|
|
||||||
}());
|
|
||||||
1
lib/plugins/emoji.min.js
vendored
1
lib/plugins/emoji.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,28 +0,0 @@
|
||||||
(function () {
|
|
||||||
function handleExternalScript() {
|
|
||||||
var container = Docsify.dom.getNode('#main');
|
|
||||||
var scripts = Docsify.dom.findAll(container, 'script');
|
|
||||||
|
|
||||||
for (var i = scripts.length; i--;) {
|
|
||||||
var script = scripts[i];
|
|
||||||
|
|
||||||
if (script && script.src) {
|
|
||||||
var newScript = document.createElement('script');
|
|
||||||
|
|
||||||
Array.prototype.slice.call(script.attributes).forEach(function (attribute) {
|
|
||||||
newScript[attribute.name] = attribute.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
script.parentNode.insertBefore(newScript, script);
|
|
||||||
script.parentNode.removeChild(script);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var install = function (hook) {
|
|
||||||
hook.doneEach(handleExternalScript);
|
|
||||||
};
|
|
||||||
|
|
||||||
window.$docsify.plugins = [].concat(install, window.$docsify.plugins);
|
|
||||||
|
|
||||||
}());
|
|
||||||
1
lib/plugins/external-script.min.js
vendored
1
lib/plugins/external-script.min.js
vendored
|
|
@ -1 +0,0 @@
|
||||||
!function(){function e(){for(var o=Docsify.dom.getNode("#main"),e=Docsify.dom.findAll(o,"script"),n=e.length;n--;){var i=e[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(o){t[o.name]=o.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}window.$docsify.plugins=[].concat(function(o){o.doneEach(e)},window.$docsify.plugins)}();
|
|
||||||
|
|
@ -1,496 +0,0 @@
|
||||||
(function () {
|
|
||||||
/**
|
|
||||||
* Fork https://github.com/egoist/docute/blob/master/src/utils/yaml.js
|
|
||||||
*/
|
|
||||||
/* eslint-disable */
|
|
||||||
/*
|
|
||||||
YAML parser for Javascript
|
|
||||||
Author: Diogo Costa
|
|
||||||
This program is released under the MIT License as follows:
|
|
||||||
Copyright (c) 2011 Diogo Costa (costa.h4evr@gmail.com)
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name YAML
|
|
||||||
* @namespace
|
|
||||||
*/
|
|
||||||
|
|
||||||
var errors = [];
|
|
||||||
var reference_blocks = [];
|
|
||||||
var processing_time = 0;
|
|
||||||
var regex$1 = {
|
|
||||||
regLevel: new RegExp('^([\\s\\-]+)'),
|
|
||||||
invalidLine: new RegExp('^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$'),
|
|
||||||
dashesString: new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'),
|
|
||||||
quotesString: new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"),
|
|
||||||
float: new RegExp('^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$'),
|
|
||||||
integer: new RegExp('^[+-]?[0-9]+$'),
|
|
||||||
array: new RegExp('\\[\\s*(.*)\\s*\\]'),
|
|
||||||
map: new RegExp('\\{\\s*(.*)\\s*\\}'),
|
|
||||||
key_value: new RegExp('([a-z0-9_-][ a-z0-9_-]*):( .+)', 'i'),
|
|
||||||
single_key_value: new RegExp('^([a-z0-9_-][ a-z0-9_-]*):( .+?)$', 'i'),
|
|
||||||
key: new RegExp('([a-z0-9_-][ a-z0-9_-]+):( .+)?', 'i'),
|
|
||||||
item: new RegExp('^-\\s+'),
|
|
||||||
trim: new RegExp('^\\s+|\\s+$'),
|
|
||||||
comment: new RegExp('([^\\\'\\"#]+([\\\'\\"][^\\\'\\"]*[\\\'\\"])*)*(#.*)?')
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class A block of lines of a given level.
|
|
||||||
* @param {int} lvl The block's level.
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
function Block(lvl) {
|
|
||||||
return {
|
|
||||||
/* The block's parent */
|
|
||||||
parent: null,
|
|
||||||
/* Number of children */
|
|
||||||
length: 0,
|
|
||||||
/* Block's level */
|
|
||||||
level: lvl,
|
|
||||||
/* Lines of code to process */
|
|
||||||
lines: [],
|
|
||||||
/* Blocks with greater level */
|
|
||||||
children: [],
|
|
||||||
/* Add a block to the children collection */
|
|
||||||
addChild: function(obj) {
|
|
||||||
this.children.push(obj);
|
|
||||||
obj.parent = this;
|
|
||||||
++this.length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function parser$1(str) {
|
|
||||||
var regLevel = regex$1['regLevel'];
|
|
||||||
var invalidLine = regex$1['invalidLine'];
|
|
||||||
var lines = str.split('\n');
|
|
||||||
var m;
|
|
||||||
var level = 0,
|
|
||||||
curLevel = 0;
|
|
||||||
|
|
||||||
var blocks = [];
|
|
||||||
|
|
||||||
var result = new Block(-1);
|
|
||||||
var currentBlock = new Block(0);
|
|
||||||
result.addChild(currentBlock);
|
|
||||||
var levels = [];
|
|
||||||
var line = '';
|
|
||||||
|
|
||||||
blocks.push(currentBlock);
|
|
||||||
levels.push(level);
|
|
||||||
|
|
||||||
for (var i = 0, len = lines.length; i < len; ++i) {
|
|
||||||
line = lines[i];
|
|
||||||
|
|
||||||
if (line.match(invalidLine)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((m = regLevel.exec(line))) {
|
|
||||||
level = m[1].length;
|
|
||||||
} else { level = 0; }
|
|
||||||
|
|
||||||
if (level > curLevel) {
|
|
||||||
var oldBlock = currentBlock;
|
|
||||||
currentBlock = new Block(level);
|
|
||||||
oldBlock.addChild(currentBlock);
|
|
||||||
blocks.push(currentBlock);
|
|
||||||
levels.push(level);
|
|
||||||
} else if (level < curLevel) {
|
|
||||||
var added = false;
|
|
||||||
|
|
||||||
var k = levels.length - 1;
|
|
||||||
for (; k >= 0; --k) {
|
|
||||||
if (levels[k] == level) {
|
|
||||||
currentBlock = new Block(level);
|
|
||||||
blocks.push(currentBlock);
|
|
||||||
levels.push(level);
|
|
||||||
if (blocks[k].parent != null) { blocks[k].parent.addChild(currentBlock); }
|
|
||||||
added = true;
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!added) {
|
|
||||||
errors.push('Error: Invalid indentation at line ' + i + ': ' + line);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
currentBlock.lines.push(line.replace(regex$1['trim'], ''));
|
|
||||||
curLevel = level;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
function processValue(val) {
|
|
||||||
val = val.replace(regex$1['trim'], '');
|
|
||||||
var m = null;
|
|
||||||
|
|
||||||
if (val == 'true') {
|
|
||||||
return true
|
|
||||||
} else if (val == 'false') {
|
|
||||||
return false
|
|
||||||
} else if (val == '.NaN') {
|
|
||||||
return Number.NaN
|
|
||||||
} else if (val == 'null') {
|
|
||||||
return null
|
|
||||||
} else if (val == '.inf') {
|
|
||||||
return Number.POSITIVE_INFINITY
|
|
||||||
} else if (val == '-.inf') {
|
|
||||||
return Number.NEGATIVE_INFINITY
|
|
||||||
} else if ((m = val.match(regex$1['dashesString']))) {
|
|
||||||
return m[1]
|
|
||||||
} else if ((m = val.match(regex$1['quotesString']))) {
|
|
||||||
return m[1]
|
|
||||||
} else if ((m = val.match(regex$1['float']))) {
|
|
||||||
return parseFloat(m[0])
|
|
||||||
} else if ((m = val.match(regex$1['integer']))) {
|
|
||||||
return parseInt(m[0])
|
|
||||||
} else if (!isNaN((m = Date.parse(val)))) {
|
|
||||||
return new Date(m)
|
|
||||||
} else if ((m = val.match(regex$1['single_key_value']))) {
|
|
||||||
var res = {};
|
|
||||||
res[m[1]] = processValue(m[2]);
|
|
||||||
return res
|
|
||||||
} else if ((m = val.match(regex$1['array']))) {
|
|
||||||
var count = 0,
|
|
||||||
c = ' ';
|
|
||||||
var res = [];
|
|
||||||
var content = '';
|
|
||||||
var str = false;
|
|
||||||
for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) {
|
|
||||||
c = m[1][j];
|
|
||||||
if (c == "'" || c == '"') {
|
|
||||||
if (str === false) {
|
|
||||||
str = c;
|
|
||||||
content += c;
|
|
||||||
continue
|
|
||||||
} else if ((c == "'" && str == "'") || (c == '"' && str == '"')) {
|
|
||||||
str = false;
|
|
||||||
content += c;
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else if (str === false && (c == '[' || c == '{')) {
|
|
||||||
++count;
|
|
||||||
} else if (str === false && (c == ']' || c == '}')) {
|
|
||||||
--count;
|
|
||||||
} else if (str === false && count == 0 && c == ',') {
|
|
||||||
res.push(processValue(content));
|
|
||||||
content = '';
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
content += c;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (content.length > 0) { res.push(processValue(content)); }
|
|
||||||
return res
|
|
||||||
} else if ((m = val.match(regex$1['map']))) {
|
|
||||||
var count = 0,
|
|
||||||
c = ' ';
|
|
||||||
var res = [];
|
|
||||||
var content = '';
|
|
||||||
var str = false;
|
|
||||||
for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) {
|
|
||||||
c = m[1][j];
|
|
||||||
if (c == "'" || c == '"') {
|
|
||||||
if (str === false) {
|
|
||||||
str = c;
|
|
||||||
content += c;
|
|
||||||
continue
|
|
||||||
} else if ((c == "'" && str == "'") || (c == '"' && str == '"')) {
|
|
||||||
str = false;
|
|
||||||
content += c;
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else if (str === false && (c == '[' || c == '{')) {
|
|
||||||
++count;
|
|
||||||
} else if (str === false && (c == ']' || c == '}')) {
|
|
||||||
--count;
|
|
||||||
} else if (str === false && count == 0 && c == ',') {
|
|
||||||
res.push(content);
|
|
||||||
content = '';
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
content += c;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (content.length > 0) { res.push(content); }
|
|
||||||
|
|
||||||
var newRes = {};
|
|
||||||
for (var j = 0, lenJ = res.length; j < lenJ; ++j) {
|
|
||||||
if ((m = res[j].match(regex$1['key_value']))) {
|
|
||||||
newRes[m[1]] = processValue(m[2]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return newRes
|
|
||||||
} else { return val }
|
|
||||||
}
|
|
||||||
|
|
||||||
function processFoldedBlock(block) {
|
|
||||||
var lines = block.lines;
|
|
||||||
var children = block.children;
|
|
||||||
var str = lines.join(' ');
|
|
||||||
var chunks = [str];
|
|
||||||
for (var i = 0, len = children.length; i < len; ++i) {
|
|
||||||
chunks.push(processFoldedBlock(children[i]));
|
|
||||||
}
|
|
||||||
return chunks.join('\n')
|
|
||||||
}
|
|
||||||
|
|
||||||
function processLiteralBlock(block) {
|
|
||||||
var lines = block.lines;
|
|
||||||
var children = block.children;
|
|
||||||
var str = lines.join('\n');
|
|
||||||
for (var i = 0, len = children.length; i < len; ++i) {
|
|
||||||
str += processLiteralBlock(children[i]);
|
|
||||||
}
|
|
||||||
return str
|
|
||||||
}
|
|
||||||
|
|
||||||
function processBlock(blocks) {
|
|
||||||
var m = null;
|
|
||||||
var res = {};
|
|
||||||
var lines = null;
|
|
||||||
var children = null;
|
|
||||||
var currentObj = null;
|
|
||||||
|
|
||||||
var level = -1;
|
|
||||||
|
|
||||||
var processedBlocks = [];
|
|
||||||
|
|
||||||
var isMap = true;
|
|
||||||
|
|
||||||
for (var j = 0, lenJ = blocks.length; j < lenJ; ++j) {
|
|
||||||
if (level != -1 && level != blocks[j].level) { continue }
|
|
||||||
|
|
||||||
processedBlocks.push(j);
|
|
||||||
|
|
||||||
level = blocks[j].level;
|
|
||||||
lines = blocks[j].lines;
|
|
||||||
children = blocks[j].children;
|
|
||||||
currentObj = null;
|
|
||||||
|
|
||||||
for (var i = 0, len = lines.length; i < len; ++i) {
|
|
||||||
var line = lines[i];
|
|
||||||
|
|
||||||
if ((m = line.match(regex$1['key']))) {
|
|
||||||
var key = m[1];
|
|
||||||
|
|
||||||
if (key[0] == '-') {
|
|
||||||
key = key.replace(regex$1['item'], '');
|
|
||||||
if (isMap) {
|
|
||||||
isMap = false;
|
|
||||||
if (typeof res.length === 'undefined') {
|
|
||||||
res = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (currentObj != null) { res.push(currentObj); }
|
|
||||||
currentObj = {};
|
|
||||||
isMap = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof m[2] != 'undefined') {
|
|
||||||
var value = m[2].replace(regex$1['trim'], '');
|
|
||||||
if (value[0] == '&') {
|
|
||||||
var nb = processBlock(children);
|
|
||||||
if (currentObj != null) { currentObj[key] = nb; }
|
|
||||||
else { res[key] = nb; }
|
|
||||||
reference_blocks[value.substr(1)] = nb;
|
|
||||||
} else if (value[0] == '|') {
|
|
||||||
if (currentObj != null)
|
|
||||||
{ currentObj[key] = processLiteralBlock(children.shift()); }
|
|
||||||
else { res[key] = processLiteralBlock(children.shift()); }
|
|
||||||
} else if (value[0] == '*') {
|
|
||||||
var v = value.substr(1);
|
|
||||||
var no = {};
|
|
||||||
|
|
||||||
if (typeof reference_blocks[v] == 'undefined') {
|
|
||||||
errors.push("Reference '" + v + "' not found!");
|
|
||||||
} else {
|
|
||||||
for (var k in reference_blocks[v]) {
|
|
||||||
no[k] = reference_blocks[v][k];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentObj != null) { currentObj[key] = no; }
|
|
||||||
else { res[key] = no; }
|
|
||||||
}
|
|
||||||
} else if (value[0] == '>') {
|
|
||||||
if (currentObj != null)
|
|
||||||
{ currentObj[key] = processFoldedBlock(children.shift()); }
|
|
||||||
else { res[key] = processFoldedBlock(children.shift()); }
|
|
||||||
} else {
|
|
||||||
if (currentObj != null) { currentObj[key] = processValue(value); }
|
|
||||||
else { res[key] = processValue(value); }
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (currentObj != null) { currentObj[key] = processBlock(children); }
|
|
||||||
else { res[key] = processBlock(children); }
|
|
||||||
}
|
|
||||||
} else if (line.match(/^-\s*$/)) {
|
|
||||||
if (isMap) {
|
|
||||||
isMap = false;
|
|
||||||
if (typeof res.length === 'undefined') {
|
|
||||||
res = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (currentObj != null) { res.push(currentObj); }
|
|
||||||
currentObj = {};
|
|
||||||
isMap = true;
|
|
||||||
continue
|
|
||||||
} else if ((m = line.match(/^-\s*(.*)/))) {
|
|
||||||
if (currentObj != null) { currentObj.push(processValue(m[1])); }
|
|
||||||
else {
|
|
||||||
if (isMap) {
|
|
||||||
isMap = false;
|
|
||||||
if (typeof res.length === 'undefined') {
|
|
||||||
res = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.push(processValue(m[1]));
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentObj != null) {
|
|
||||||
if (isMap) {
|
|
||||||
isMap = false;
|
|
||||||
if (typeof res.length === 'undefined') {
|
|
||||||
res = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.push(currentObj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var j = processedBlocks.length - 1; j >= 0; --j) {
|
|
||||||
blocks.splice.call(blocks, processedBlocks[j], 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
function semanticAnalysis(blocks) {
|
|
||||||
var res = processBlock(blocks.children);
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
function preProcess(src) {
|
|
||||||
var m;
|
|
||||||
var lines = src.split('\n');
|
|
||||||
|
|
||||||
var r = regex$1['comment'];
|
|
||||||
|
|
||||||
for (var i in lines) {
|
|
||||||
if ((m = lines[i].match(r))) {
|
|
||||||
/* var cmt = "";
|
|
||||||
if(typeof m[3] != "undefined")
|
|
||||||
lines[i] = m[1];
|
|
||||||
else if(typeof m[3] != "undefined")
|
|
||||||
lines[i] = m[3];
|
|
||||||
else
|
|
||||||
lines[i] = "";
|
|
||||||
*/
|
|
||||||
if (typeof m[3] !== 'undefined') {
|
|
||||||
lines[i] = m[0].substr(0, m[0].length - m[3].length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return lines.join('\n')
|
|
||||||
}
|
|
||||||
|
|
||||||
function load(str) {
|
|
||||||
errors = [];
|
|
||||||
reference_blocks = [];
|
|
||||||
processing_time = new Date().getTime();
|
|
||||||
var pre = preProcess(str);
|
|
||||||
var doc = parser$1(pre);
|
|
||||||
var res = semanticAnalysis(doc);
|
|
||||||
processing_time = new Date().getTime() - processing_time;
|
|
||||||
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fork https://github.com/egoist/docute/blob/master/src/utils/front-matter.js
|
|
||||||
*/
|
|
||||||
/* eslint-disable */
|
|
||||||
var optionalByteOrderMark = '\\ufeff?';
|
|
||||||
var pattern =
|
|
||||||
'^(' +
|
|
||||||
optionalByteOrderMark +
|
|
||||||
'(= yaml =|---)' +
|
|
||||||
'$([\\s\\S]*?)' +
|
|
||||||
'(?:\\2|\\.\\.\\.)' +
|
|
||||||
'$' +
|
|
||||||
'' +
|
|
||||||
'(?:\\n)?)';
|
|
||||||
// NOTE: If this pattern uses the 'g' flag the `regex` variable definition will
|
|
||||||
// need to be moved down into the functions that use it.
|
|
||||||
var regex = new RegExp(pattern, 'm');
|
|
||||||
|
|
||||||
function extractor(string) {
|
|
||||||
string = string || '';
|
|
||||||
|
|
||||||
var lines = string.split(/(\r?\n)/);
|
|
||||||
if (lines[0] && /= yaml =|---/.test(lines[0])) {
|
|
||||||
return parse(string)
|
|
||||||
} else {
|
|
||||||
return { attributes: {}, body: string }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function parse(string) {
|
|
||||||
var match = regex.exec(string);
|
|
||||||
|
|
||||||
if (!match) {
|
|
||||||
return {
|
|
||||||
attributes: {},
|
|
||||||
body: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var yaml = match[match.length - 1].replace(/^\s+|\s+$/g, '');
|
|
||||||
var attributes = load(yaml) || {};
|
|
||||||
var body = string.replace(match[0], '');
|
|
||||||
|
|
||||||
return { attributes: attributes, body: body, frontmatter: yaml }
|
|
||||||
}
|
|
||||||
|
|
||||||
var install = function (hook, vm) {
|
|
||||||
hook.beforeEach(function (content) {
|
|
||||||
var ref = extractor(content);
|
|
||||||
var attributes = ref.attributes;
|
|
||||||
var body = ref.body;
|
|
||||||
|
|
||||||
vm.frontmatter = attributes;
|
|
||||||
|
|
||||||
return body
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
|
||||||
|
|
||||||
}());
|
|
||||||
1
lib/plugins/front-matter.min.js
vendored
1
lib/plugins/front-matter.min.js
vendored
|
|
@ -1 +0,0 @@
|
||||||
!function(){var b=[],y=[],t=0,R={regLevel:new RegExp("^([\\s\\-]+)"),invalidLine:new RegExp("^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$"),dashesString:new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'),quotesString:new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"),float:new RegExp("^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$"),integer:new RegExp("^[+-]?[0-9]+$"),array:new RegExp("\\[\\s*(.*)\\s*\\]"),map:new RegExp("\\{\\s*(.*)\\s*\\}"),key_value:new RegExp("([a-z0-9_-][ a-z0-9_-]*):( .+)","i"),single_key_value:new RegExp("^([a-z0-9_-][ a-z0-9_-]*):( .+?)$","i"),key:new RegExp("([a-z0-9_-][ a-z0-9_-]+):( .+)?","i"),item:new RegExp("^-\\s+"),trim:new RegExp("^\\s+|\\s+$"),comment:new RegExp("([^\\'\\\"#]+([\\'\\\"][^\\'\\\"]*[\\'\\\"])*)*(#.*)?")};function m(e){return{parent:null,length:0,level:e,lines:[],children:[],addChild:function(e){this.children.push(e),++(e.parent=this).length}}}function N(e){var n=null;if("true"==(e=e.replace(R.trim,"")))return!0;if("false"==e)return!1;if(".NaN"==e)return Number.NaN;if("null"==e)return null;if(".inf"==e)return Number.POSITIVE_INFINITY;if("-.inf"==e)return Number.NEGATIVE_INFINITY;if(n=e.match(R.dashesString))return n[1];if(n=e.match(R.quotesString))return n[1];if(n=e.match(R.float))return parseFloat(n[0]);if(n=e.match(R.integer))return parseInt(n[0]);if(isNaN(n=Date.parse(e))){if(n=e.match(R.single_key_value))return(i={})[n[1]]=N(n[2]),i;if(n=e.match(R.array)){for(var t=0,r=" ",i=[],l="",u=!1,a=0,s=n[1].length;a<s;++a){if("'"==(r=n[1][a])||'"'==r){if(!1===u){l+=u=r;continue}if("'"==r&&"'"==u||'"'==r&&'"'==u){u=!1,l+=r;continue}}else if(!1!==u||"["!=r&&"{"!=r)if(!1!==u||"]"!=r&&"}"!=r){if(!1===u&&0==t&&","==r){i.push(N(l)),l="";continue}}else--t;else++t;l+=r}return 0<l.length&&i.push(N(l)),i}if(n=e.match(R.map)){for(t=0,r=" ",i=[],l="",u=!1,a=0,s=n[1].length;a<s;++a){if("'"==(r=n[1][a])||'"'==r){if(!1===u){l+=u=r;continue}if("'"==r&&"'"==u||'"'==r&&'"'==u){u=!1,l+=r;continue}}else if(!1!==u||"["!=r&&"{"!=r)if(!1!==u||"]"!=r&&"}"!=r){if(!1===u&&0==t&&","==r){i.push(l),l="";continue}}else--t;else++t;l+=r}0<l.length&&i.push(l);var f={};for(a=0,s=i.length;a<s;++a)(n=i[a].match(R.key_value))&&(f[n[1]]=N(n[2]));return f}return e}return new Date(n)}function _(e){for(var n=e.lines,t=e.children,r=[n.join(" ")],i=0,l=t.length;i<l;++i)r.push(_(t[i]));return r.join("\n")}function $(e){for(var n=e.lines,t=e.children,r=n.join("\n"),i=0,l=t.length;i<l;++i)r+=$(t[i]);return r}function r(e){return function e(n){for(var t=null,r={},i=null,l=null,u=null,a=-1,s=[],f=!0,h=0,o=n.length;h<o;++h)if(-1==a||a==n[h].level){s.push(h),a=n[h].level,i=n[h].lines,l=n[h].children,u=null;for(var c=0,p=i.length;c<p;++c){var g=i[c];if(t=g.match(R.key)){var v=t[1];if("-"==v[0]&&(v=v.replace(R.item,""),f&&(f=!1,void 0===r.length&&(r=[])),null!=u&&r.push(u),u={},f=!0),void 0!==t[2]){var d=t[2].replace(R.trim,"");if("&"==d[0]){var m=e(l);null!=u?u[v]=m:r[v]=m,y[d.substr(1)]=m}else if("|"==d[0])null!=u?u[v]=$(l.shift()):r[v]=$(l.shift());else if("*"==d[0]){var w=d.substr(1),E={};if(void 0===y[w])b.push("Reference '"+w+"' not found!");else{for(var x in y[w])E[x]=y[w][x];null!=u?u[v]=E:r[v]=E}}else">"==d[0]?null!=u?u[v]=_(l.shift()):r[v]=_(l.shift()):null!=u?u[v]=N(d):r[v]=N(d)}else null!=u?u[v]=e(l):r[v]=e(l)}else{if(g.match(/^-\s*$/)){f&&(f=!1,void 0===r.length&&(r=[])),null!=u&&r.push(u),u={},f=!0;continue}if(t=g.match(/^-\s*(.*)/)){null!=u?u.push(N(t[1])):(f&&(f=!1,void 0===r.length&&(r=[])),r.push(N(t[1])));continue}}}null!=u&&(f&&(f=!1,void 0===r.length&&(r=[])),r.push(u))}for(h=s.length-1;0<=h;--h)n.splice.call(n,s[h],1);return r}(e.children)}function l(e){b=[],y=[],t=(new Date).getTime();var n=r(function(e){var n,t=R.regLevel,r=R.invalidLine,i=e.split("\n"),l=0,u=0,a=[],s=new m(-1),f=new m(0);s.addChild(f);var h=[],o="";a.push(f),h.push(l);for(var c=0,p=i.length;c<p;++c)if(!(o=i[c]).match(r)){if(u<(l=(n=t.exec(o))?n[1].length:0)){var g=f;f=new m(l),g.addChild(f),a.push(f),h.push(l)}else if(l<u){for(var v=!1,d=h.length-1;0<=d;--d)if(h[d]==l){f=new m(l),a.push(f),h.push(l),null!=a[d].parent&&a[d].parent.addChild(f),v=!0;break}if(!v)return void b.push("Error: Invalid indentation at line "+c+": "+o)}f.lines.push(o.replace(R.trim,"")),u=l}return s}(function(e){var n,t=e.split("\n"),r=R.comment;for(var i in t)(n=t[i].match(r))&&void 0!==n[3]&&(t[i]=n[0].substr(0,n[0].length-n[3].length));return t.join("\n")}(e)));return t=(new Date).getTime()-t,n}var u=new RegExp("^(\\ufeff?(= yaml =|---)$([\\s\\S]*?)(?:\\2|\\.\\.\\.)$(?:\\n)?)","m");function a(e){var n=(e=e||"").split(/(\r?\n)/);return n[0]&&/= yaml =|---/.test(n[0])?function(e){var n=u.exec(e);if(!n)return{attributes:{},body:e};var t=n[n.length-1].replace(/^\s+|\s+$/g,""),r=l(t)||{},i=e.replace(n[0],"");return{attributes:r,body:i,frontmatter:t}}(e):{attributes:{},body:e}}$docsify.plugins=[].concat(function(e,i){e.beforeEach(function(e){var n=a(e),t=n.attributes,r=n.body;return i.frontmatter=t,r})},$docsify.plugins)}();
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
(function () {
|
|
||||||
// From https://github.com/egoist/vue-ga/blob/master/src/index.js
|
|
||||||
function appendScript() {
|
|
||||||
var script = document.createElement('script');
|
|
||||||
script.async = true;
|
|
||||||
script.src = 'https://www.google-analytics.com/analytics.js';
|
|
||||||
document.body.appendChild(script);
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(id) {
|
|
||||||
appendScript();
|
|
||||||
window.ga =
|
|
||||||
window.ga ||
|
|
||||||
function () {
|
|
||||||
(window.ga.q = window.ga.q || []).push(arguments);
|
|
||||||
};
|
|
||||||
window.ga.l = Number(new Date());
|
|
||||||
window.ga('create', id, 'auto');
|
|
||||||
}
|
|
||||||
|
|
||||||
function collect() {
|
|
||||||
if (!window.ga) {
|
|
||||||
init($docsify.ga);
|
|
||||||
}
|
|
||||||
|
|
||||||
window.ga('set', 'page', location.hash);
|
|
||||||
window.ga('send', 'pageview');
|
|
||||||
}
|
|
||||||
|
|
||||||
var install = function (hook) {
|
|
||||||
if (!$docsify.ga) {
|
|
||||||
console.error('[Docsify] ga is required.');
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
hook.beforeEach(collect);
|
|
||||||
};
|
|
||||||
|
|
||||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
|
||||||
|
|
||||||
}());
|
|
||||||
1
lib/plugins/ga.min.js
vendored
1
lib/plugins/ga.min.js
vendored
|
|
@ -1 +0,0 @@
|
||||||
!function(){function n(n){var o;(o=document.createElement("script")).async=!0,o.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(o),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",n,"auto")}function o(){window.ga||n($docsify.ga),window.ga("set","page",location.hash),window.ga("send","pageview")}$docsify.plugins=[].concat(function(n){$docsify.ga?n.beforeEach(o):console.error("[Docsify] ga is required.")},$docsify.plugins)}();
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
(function () {
|
|
||||||
function install(hook) {
|
|
||||||
var dom = Docsify.dom;
|
|
||||||
|
|
||||||
hook.mounted(function (_) {
|
|
||||||
var div = dom.create('div');
|
|
||||||
div.id = 'gitalk-container';
|
|
||||||
var main = dom.getNode('#main');
|
|
||||||
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
|
|
||||||
dom.appendTo(dom.find('.content'), div);
|
|
||||||
var script = dom.create('script');
|
|
||||||
var content = "gitalk.render('gitalk-container')";
|
|
||||||
script.textContent = content;
|
|
||||||
dom.appendTo(dom.body, script);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
|
||||||
|
|
||||||
}());
|
|
||||||
1
lib/plugins/gitalk.min.js
vendored
1
lib/plugins/gitalk.min.js
vendored
|
|
@ -1 +0,0 @@
|
||||||
$docsify.plugins=[].concat(function(t){var a=Docsify.dom;t.mounted(function(t){var n=a.create("div");n.id="gitalk-container";var i=a.getNode("#main");n.style="width: "+i.clientWidth+"px; margin: 0 auto 20px;",a.appendTo(a.find(".content"),n);var e=a.create("script");e.textContent="gitalk.render('gitalk-container')",a.appendTo(a.body,e)})},$docsify.plugins);
|
|
||||||
|
|
@ -1,346 +0,0 @@
|
||||||
(function () {
|
|
||||||
var INDEXS = {};
|
|
||||||
|
|
||||||
function escapeHtml(string) {
|
|
||||||
var entityMap = {
|
|
||||||
'&': '&',
|
|
||||||
'<': '<',
|
|
||||||
'>': '>',
|
|
||||||
'"': '"',
|
|
||||||
'\'': ''',
|
|
||||||
'/': '/'
|
|
||||||
};
|
|
||||||
|
|
||||||
return String(string).replace(/[&<>"'/]/g, function (s) { return entityMap[s]; })
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAllPaths(router) {
|
|
||||||
var paths = [];
|
|
||||||
|
|
||||||
document.querySelectorAll('.sidebar-nav a:not(.section-link):not([data-nosearch])').forEach(function (node) {
|
|
||||||
var href = node.href;
|
|
||||||
var originHref = node.getAttribute('href');
|
|
||||||
var path = router.parse(href).path;
|
|
||||||
|
|
||||||
if (
|
|
||||||
path &&
|
|
||||||
paths.indexOf(path) === -1 &&
|
|
||||||
!Docsify.util.isAbsolutePath(originHref)
|
|
||||||
) {
|
|
||||||
paths.push(path);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return paths
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveData(maxAge) {
|
|
||||||
localStorage.setItem('docsify.search.expires', Date.now() + maxAge);
|
|
||||||
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS));
|
|
||||||
}
|
|
||||||
|
|
||||||
function genIndex(path, content, router, depth) {
|
|
||||||
if ( content === void 0 ) content = '';
|
|
||||||
|
|
||||||
var tokens = window.marked.lexer(content);
|
|
||||||
var slugify = window.Docsify.slugify;
|
|
||||||
var index = {};
|
|
||||||
var slug;
|
|
||||||
|
|
||||||
tokens.forEach(function (token) {
|
|
||||||
if (token.type === 'heading' && token.depth <= depth) {
|
|
||||||
slug = router.toURL(path, {id: slugify(token.text)});
|
|
||||||
index[slug] = {slug: slug, title: token.text, body: ''};
|
|
||||||
} else {
|
|
||||||
if (!slug) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!index[slug]) {
|
|
||||||
index[slug] = {slug: slug, title: '', body: ''};
|
|
||||||
} else if (index[slug].body) {
|
|
||||||
index[slug].body += '\n' + (token.text || '');
|
|
||||||
} else {
|
|
||||||
index[slug].body = token.text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
slugify.clear();
|
|
||||||
return index
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {String} query
|
|
||||||
* @returns {Array}
|
|
||||||
*/
|
|
||||||
function search(query) {
|
|
||||||
var matchingResults = [];
|
|
||||||
var data = [];
|
|
||||||
Object.keys(INDEXS).forEach(function (key) {
|
|
||||||
data = data.concat(Object.keys(INDEXS[key]).map(function (page) { return INDEXS[key][page]; }));
|
|
||||||
});
|
|
||||||
|
|
||||||
query = query.trim();
|
|
||||||
var keywords = query.split(/[\s\-,\\/]+/);
|
|
||||||
if (keywords.length !== 1) {
|
|
||||||
keywords = [].concat(query, keywords);
|
|
||||||
}
|
|
||||||
|
|
||||||
var loop = function ( i ) {
|
|
||||||
var post = data[i];
|
|
||||||
var isMatch = false;
|
|
||||||
var resultStr = '';
|
|
||||||
var postTitle = post.title && post.title.trim();
|
|
||||||
var postContent = post.body && post.body.trim();
|
|
||||||
var postUrl = post.slug || '';
|
|
||||||
|
|
||||||
if (postTitle && postContent) {
|
|
||||||
keywords.forEach(function (keyword) {
|
|
||||||
// From https://github.com/sindresorhus/escape-string-regexp
|
|
||||||
var regEx = new RegExp(
|
|
||||||
keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'),
|
|
||||||
'gi'
|
|
||||||
);
|
|
||||||
var indexTitle = -1;
|
|
||||||
var indexContent = -1;
|
|
||||||
|
|
||||||
indexTitle = postTitle && postTitle.search(regEx);
|
|
||||||
indexContent = postContent && postContent.search(regEx);
|
|
||||||
|
|
||||||
if (indexTitle < 0 && indexContent < 0) {
|
|
||||||
isMatch = false;
|
|
||||||
} else {
|
|
||||||
isMatch = true;
|
|
||||||
if (indexContent < 0) {
|
|
||||||
indexContent = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
var start = 0;
|
|
||||||
var end = 0;
|
|
||||||
|
|
||||||
start = indexContent < 11 ? 0 : indexContent - 10;
|
|
||||||
end = start === 0 ? 70 : indexContent + keyword.length + 60;
|
|
||||||
|
|
||||||
if (end > postContent.length) {
|
|
||||||
end = postContent.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
var matchContent =
|
|
||||||
'...' +
|
|
||||||
escapeHtml(postContent)
|
|
||||||
.substring(start, end)
|
|
||||||
.replace(regEx, ("<em class=\"search-keyword\">" + keyword + "</em>")) +
|
|
||||||
'...';
|
|
||||||
|
|
||||||
resultStr += matchContent;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (isMatch) {
|
|
||||||
var matchingPost = {
|
|
||||||
title: escapeHtml(postTitle),
|
|
||||||
content: resultStr,
|
|
||||||
url: postUrl
|
|
||||||
};
|
|
||||||
|
|
||||||
matchingResults.push(matchingPost);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var i = 0; i < data.length; i++) loop( i );
|
|
||||||
|
|
||||||
return matchingResults
|
|
||||||
}
|
|
||||||
|
|
||||||
function init$1(config, vm) {
|
|
||||||
var isAuto = config.paths === 'auto';
|
|
||||||
var isExpired = localStorage.getItem('docsify.search.expires') < Date.now();
|
|
||||||
|
|
||||||
INDEXS = JSON.parse(localStorage.getItem('docsify.search.index'));
|
|
||||||
|
|
||||||
if (isExpired) {
|
|
||||||
INDEXS = {};
|
|
||||||
} else if (!isAuto) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var paths = isAuto ? getAllPaths(vm.router) : config.paths;
|
|
||||||
var len = paths.length;
|
|
||||||
var count = 0;
|
|
||||||
|
|
||||||
paths.forEach(function (path) {
|
|
||||||
if (INDEXS[path]) {
|
|
||||||
return count++
|
|
||||||
}
|
|
||||||
|
|
||||||
Docsify
|
|
||||||
.get(vm.router.getFile(path), false, vm.config.requestHeaders)
|
|
||||||
.then(function (result) {
|
|
||||||
INDEXS[path] = genIndex(path, result, vm.router, config.depth);
|
|
||||||
len === ++count && saveData(config.maxAge);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var NO_DATA_TEXT = '';
|
|
||||||
var options;
|
|
||||||
|
|
||||||
function style() {
|
|
||||||
var code = "\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}\n\n.app-name.hide, .sidebar-nav.hide {\n display: none;\n}";
|
|
||||||
|
|
||||||
Docsify.dom.style(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
function tpl(defaultValue) {
|
|
||||||
if ( defaultValue === void 0 ) defaultValue = '';
|
|
||||||
|
|
||||||
var html =
|
|
||||||
"<div class=\"input-wrap\">\n <input type=\"search\" value=\"" + defaultValue + "\" />\n <div class=\"clear-button\">\n <svg width=\"26\" height=\"24\">\n <circle cx=\"12\" cy=\"12\" r=\"11\" fill=\"#ccc\" />\n <path stroke=\"white\" stroke-width=\"2\" d=\"M8.25,8.25,15.75,15.75\" />\n <path stroke=\"white\" stroke-width=\"2\"d=\"M8.25,15.75,15.75,8.25\" />\n </svg>\n </div>\n </div>\n <div class=\"results-panel\"></div>\n </div>";
|
|
||||||
var el = Docsify.dom.create('div', html);
|
|
||||||
var aside = Docsify.dom.find('aside');
|
|
||||||
|
|
||||||
Docsify.dom.toggleClass(el, 'search');
|
|
||||||
Docsify.dom.before(aside, el);
|
|
||||||
}
|
|
||||||
|
|
||||||
function doSearch(value) {
|
|
||||||
var $search = Docsify.dom.find('div.search');
|
|
||||||
var $panel = Docsify.dom.find($search, '.results-panel');
|
|
||||||
var $clearBtn = Docsify.dom.find($search, '.clear-button');
|
|
||||||
var $sidebarNav = Docsify.dom.find('.sidebar-nav');
|
|
||||||
var $appName = Docsify.dom.find('.app-name');
|
|
||||||
|
|
||||||
if (!value) {
|
|
||||||
$panel.classList.remove('show');
|
|
||||||
$clearBtn.classList.remove('show');
|
|
||||||
$panel.innerHTML = '';
|
|
||||||
|
|
||||||
if (options.hideOtherSidebarContent) {
|
|
||||||
$sidebarNav.classList.remove('hide');
|
|
||||||
$appName.classList.remove('hide');
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var matchs = search(value);
|
|
||||||
|
|
||||||
var html = '';
|
|
||||||
matchs.forEach(function (post) {
|
|
||||||
html += "<div class=\"matching-post\">\n<a href=\"" + (post.url) + "\">\n<h2>" + (post.title) + "</h2>\n<p>" + (post.content) + "</p>\n</a>\n</div>";
|
|
||||||
});
|
|
||||||
|
|
||||||
$panel.classList.add('show');
|
|
||||||
$clearBtn.classList.add('show');
|
|
||||||
$panel.innerHTML = html || ("<p class=\"empty\">" + NO_DATA_TEXT + "</p>");
|
|
||||||
if (options.hideOtherSidebarContent) {
|
|
||||||
$sidebarNav.classList.add('hide');
|
|
||||||
$appName.classList.add('hide');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function bindEvents() {
|
|
||||||
var $search = Docsify.dom.find('div.search');
|
|
||||||
var $input = Docsify.dom.find($search, 'input');
|
|
||||||
var $inputWrap = Docsify.dom.find($search, '.input-wrap');
|
|
||||||
|
|
||||||
var timeId;
|
|
||||||
// Prevent to Fold sidebar
|
|
||||||
Docsify.dom.on(
|
|
||||||
$search,
|
|
||||||
'click',
|
|
||||||
function (e) { return e.target.tagName !== 'A' && e.stopPropagation(); }
|
|
||||||
);
|
|
||||||
Docsify.dom.on($input, 'input', function (e) {
|
|
||||||
clearTimeout(timeId);
|
|
||||||
timeId = setTimeout(function (_) { return doSearch(e.target.value.trim()); }, 100);
|
|
||||||
});
|
|
||||||
Docsify.dom.on($inputWrap, 'click', function (e) {
|
|
||||||
// Click input outside
|
|
||||||
if (e.target.tagName !== 'INPUT') {
|
|
||||||
$input.value = '';
|
|
||||||
doSearch();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function updatePlaceholder(text, path) {
|
|
||||||
var $input = Docsify.dom.getNode('.search input[type="search"]');
|
|
||||||
|
|
||||||
if (!$input) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (typeof text === 'string') {
|
|
||||||
$input.placeholder = text;
|
|
||||||
} else {
|
|
||||||
var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0];
|
|
||||||
$input.placeholder = text[match];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateNoData(text, path) {
|
|
||||||
if (typeof text === 'string') {
|
|
||||||
NO_DATA_TEXT = text;
|
|
||||||
} else {
|
|
||||||
var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0];
|
|
||||||
NO_DATA_TEXT = text[match];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateOptions(opts) {
|
|
||||||
options = opts;
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(opts, vm) {
|
|
||||||
var keywords = vm.router.parse().query.s;
|
|
||||||
|
|
||||||
updateOptions(opts);
|
|
||||||
style();
|
|
||||||
tpl(keywords);
|
|
||||||
bindEvents();
|
|
||||||
keywords && setTimeout(function (_) { return doSearch(keywords); }, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
function update(opts, vm) {
|
|
||||||
updateOptions(opts);
|
|
||||||
updatePlaceholder(opts.placeholder, vm.route.path);
|
|
||||||
updateNoData(opts.noData, vm.route.path);
|
|
||||||
}
|
|
||||||
|
|
||||||
var CONFIG = {
|
|
||||||
placeholder: 'Type to search',
|
|
||||||
noData: 'No Results!',
|
|
||||||
paths: 'auto',
|
|
||||||
depth: 2,
|
|
||||||
maxAge: 86400000, // 1 day
|
|
||||||
hideOtherSidebarContent: false
|
|
||||||
};
|
|
||||||
|
|
||||||
var install = function (hook, vm) {
|
|
||||||
var util = Docsify.util;
|
|
||||||
var opts = vm.config.search || CONFIG;
|
|
||||||
|
|
||||||
if (Array.isArray(opts)) {
|
|
||||||
CONFIG.paths = opts;
|
|
||||||
} else if (typeof opts === 'object') {
|
|
||||||
CONFIG.paths = Array.isArray(opts.paths) ? opts.paths : 'auto';
|
|
||||||
CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : CONFIG.maxAge;
|
|
||||||
CONFIG.placeholder = opts.placeholder || CONFIG.placeholder;
|
|
||||||
CONFIG.noData = opts.noData || CONFIG.noData;
|
|
||||||
CONFIG.depth = opts.depth || CONFIG.depth;
|
|
||||||
CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
var isAuto = CONFIG.paths === 'auto';
|
|
||||||
|
|
||||||
hook.mounted(function (_) {
|
|
||||||
init(CONFIG, vm);
|
|
||||||
!isAuto && init$1(CONFIG, vm);
|
|
||||||
});
|
|
||||||
hook.doneEach(function (_) {
|
|
||||||
update(CONFIG, vm);
|
|
||||||
isAuto && init$1(CONFIG, vm);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
|
||||||
|
|
||||||
}());
|
|
||||||
1
lib/plugins/search.min.js
vendored
1
lib/plugins/search.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
lib/plugins/zoom-image.min.js
vendored
1
lib/plugins/zoom-image.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1158
package-lock.json
generated
1158
package-lock.json
generated
File diff suppressed because it is too large
Load diff
16
package.json
16
package.json
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docsify",
|
"name": "docsify",
|
||||||
"version": "4.8.1",
|
"version": "4.9.4",
|
||||||
"description": "A magical documentation generator.",
|
"description": "A magical documentation generator.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "qingwei-li",
|
"name": "qingwei-li",
|
||||||
|
|
@ -27,16 +27,16 @@
|
||||||
"dev": "run-p serve watch:*",
|
"dev": "run-p serve watch:*",
|
||||||
"dev:ssr": "run-p serve:ssr watch:*",
|
"dev:ssr": "run-p serve:ssr watch:*",
|
||||||
"lint": "eslint {src,packages} --fix",
|
"lint": "eslint {src,packages} --fix",
|
||||||
"test": "run-p lint",
|
"test": "mocha test/*/**",
|
||||||
"css": "stylus src/themes/*.styl -u autoprefixer-stylus",
|
"css": "stylus src/themes/*.styl -u autoprefixer-stylus",
|
||||||
"watch:css": "run-p 'css -- -o themes -w'",
|
"watch:css": "run-p 'css -- -o themes -w'",
|
||||||
"watch:js": "node build/build.js",
|
"watch:js": "node build/build.js",
|
||||||
"build:css:min": "mkdir lib/themes && run-p 'css -- -o lib/themes' && node build/mincss.js",
|
"build:css:min": "mkdir lib/themes && run-p 'css -- -o lib/themes' && node build/mincss.js",
|
||||||
"build:css": "mkdir themes && run-p 'css -- -o themes'",
|
"build:css": "mkdir -p themes && run-p 'css -- -o themes'",
|
||||||
"build:js": "cross-env NODE_ENV=production node build/build.js",
|
"build:js": "cross-env NODE_ENV=production node build/build.js",
|
||||||
"build:ssr": "node build/ssr.js",
|
"build:ssr": "node build/ssr.js",
|
||||||
"build:cover": "node build/cover.js",
|
"build:cover": "node build/cover.js",
|
||||||
"build": "rimraf lib themes && run-s build:js build:css build:css:min build:ssr build:cover",
|
"build": "rimraf lib themes/* && run-s build:js build:css build:css:min build:ssr build:cover",
|
||||||
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
|
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
|
||||||
"pub": "sh build/release.sh",
|
"pub": "sh build/release.sh",
|
||||||
"postinstall": "opencollective postinstall"
|
"postinstall": "opencollective postinstall"
|
||||||
|
|
@ -51,15 +51,19 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer-stylus": "^0.14.0",
|
"autoprefixer-stylus": "^0.14.0",
|
||||||
|
"chai": "^4.2.0",
|
||||||
"chokidar": "^2.0.2",
|
"chokidar": "^2.0.2",
|
||||||
"conventional-changelog-cli": "^1.3.5",
|
"conventional-changelog-cli": "^1.3.5",
|
||||||
"cross-env": "^5.1.3",
|
"cross-env": "^5.1.3",
|
||||||
"cssnano": "^3.10.0",
|
"cssnano": "^3.10.0",
|
||||||
"eslint": "^4.14.0",
|
"eslint": "^4.14.0",
|
||||||
"eslint-config-xo-space": "^0.18.0",
|
"eslint-config-xo-space": "^0.18.0",
|
||||||
|
"esm": "^3.1.4",
|
||||||
|
"jsdom": "^13.2.0",
|
||||||
"lerna": "^2.5.1",
|
"lerna": "^2.5.1",
|
||||||
"live-server": "^1.2.0",
|
"live-server": "^1.2.1",
|
||||||
"npm-run-all": "^4.1.2",
|
"mocha": "^5.2.0",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
"rimraf": "^2.6.2",
|
"rimraf": "^2.6.2",
|
||||||
"rollup": "^0.53.3",
|
"rollup": "^0.53.3",
|
||||||
"rollup-plugin-async": "^1.2.0",
|
"rollup-plugin-async": "^1.2.0",
|
||||||
|
|
|
||||||
|
|
@ -37,5 +37,5 @@
|
||||||
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": "4.8.1"
|
"version": "4.9.4"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docsify-server-renderer",
|
"name": "docsify-server-renderer",
|
||||||
"version": "4.8.1",
|
"version": "4.9.4",
|
||||||
"description": "docsify server renderer",
|
"description": "docsify server renderer",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "qingwei-li",
|
"name": "qingwei-li",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ export default function () {
|
||||||
formatUpdated: '',
|
formatUpdated: '',
|
||||||
externalLinkTarget: '_blank',
|
externalLinkTarget: '_blank',
|
||||||
routerMode: 'hash',
|
routerMode: 'hash',
|
||||||
noCompileLinks: []
|
noCompileLinks: [],
|
||||||
|
relativePath: false
|
||||||
},
|
},
|
||||||
window.$docsify
|
window.$docsify
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,10 @@ export function scrollActiveSidebar(router) {
|
||||||
coverHeight = cover ? cover.offsetHeight : 0
|
coverHeight = cover ? cover.offsetHeight : 0
|
||||||
|
|
||||||
const sidebar = dom.getNode('.sidebar')
|
const sidebar = dom.getNode('.sidebar')
|
||||||
const lis = dom.findAll(sidebar, 'li')
|
let lis = []
|
||||||
|
if (sidebar != null) {
|
||||||
|
lis = dom.findAll(sidebar, 'li')
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0, len = lis.length; i < len; i += 1) {
|
for (let i = 0, len = lis.length; i < len; i += 1) {
|
||||||
const li = lis[i]
|
const li = lis[i]
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ export function btn(el) {
|
||||||
const toggle = _ => dom.body.classList.toggle('close')
|
const toggle = _ => dom.body.classList.toggle('close')
|
||||||
|
|
||||||
el = dom.getNode(el)
|
el = dom.getNode(el)
|
||||||
|
if (el == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
dom.on(el, 'click', e => {
|
dom.on(el, 'click', e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
toggle()
|
toggle()
|
||||||
|
|
@ -24,7 +27,9 @@ export function btn(el) {
|
||||||
|
|
||||||
export function collapse(el) {
|
export function collapse(el) {
|
||||||
el = dom.getNode(el)
|
el = dom.getNode(el)
|
||||||
|
if (el == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
dom.on(el, 'click', ({target}) => {
|
dom.on(el, 'click', ({target}) => {
|
||||||
if (
|
if (
|
||||||
target.nodeName === 'A' &&
|
target.nodeName === 'A' &&
|
||||||
|
|
@ -60,8 +65,10 @@ export function sticky() {
|
||||||
*/
|
*/
|
||||||
export function getAndActive(router, el, isParent, autoTitle) {
|
export function getAndActive(router, el, isParent, autoTitle) {
|
||||||
el = dom.getNode(el)
|
el = dom.getNode(el)
|
||||||
|
let links = []
|
||||||
const links = dom.findAll(el, 'a')
|
if (el != null) {
|
||||||
|
links = dom.findAll(el, 'a')
|
||||||
|
}
|
||||||
const hash = decodeURI(router.toURL(router.getCurrentPath()))
|
const hash = decodeURI(router.toURL(router.getCurrentPath()))
|
||||||
let target
|
let target
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,13 @@ import marked from 'marked'
|
||||||
import prism from 'prismjs'
|
import prism from 'prismjs'
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
window.Docsify = {util, dom, get, slugify}
|
window.Docsify = {
|
||||||
|
util,
|
||||||
|
dom,
|
||||||
|
get,
|
||||||
|
slugify,
|
||||||
|
version: '__VERSION__'
|
||||||
|
}
|
||||||
window.DocsifyCompiler = Compiler
|
window.DocsifyCompiler = Compiler
|
||||||
window.marked = marked
|
window.marked = marked
|
||||||
window.Prism = prism
|
window.Prism = prism
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,6 @@ eventMixin(proto)
|
||||||
*/
|
*/
|
||||||
initGlobalAPI()
|
initGlobalAPI()
|
||||||
|
|
||||||
/**
|
|
||||||
* Version
|
|
||||||
*/
|
|
||||||
Docsify.version = '__VERSION__'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run Docsify
|
* Run Docsify
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@ import {emojify} from './emojify'
|
||||||
import {isAbsolutePath, getPath, getParentPath} from '../router/util'
|
import {isAbsolutePath, getPath, getParentPath} from '../router/util'
|
||||||
import {isFn, merge, cached, isPrimitive} from '../util/core'
|
import {isFn, merge, cached, isPrimitive} from '../util/core'
|
||||||
|
|
||||||
|
// See https://github.com/PrismJS/prism/pull/1367
|
||||||
|
import 'prismjs/components/prism-markup-templating'
|
||||||
|
|
||||||
const cachedLinks = {}
|
const cachedLinks = {}
|
||||||
|
|
||||||
export function getAndRemoveConfig(str = '') {
|
export function getAndRemoveConfig(str = '') {
|
||||||
|
|
@ -16,7 +19,7 @@ export function getAndRemoveConfig(str = '') {
|
||||||
str = str
|
str = str
|
||||||
.replace(/^'/, '')
|
.replace(/^'/, '')
|
||||||
.replace(/'$/, '')
|
.replace(/'$/, '')
|
||||||
.replace(/:([\w-]+)=?([\w-]+)?/g, (m, key, value) => {
|
.replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g, (m, key, value) => {
|
||||||
config[key] = (value && value.replace(/"/g, '')) || true
|
config[key] = (value && value.replace(/"/g, '')) || true
|
||||||
return ''
|
return ''
|
||||||
})
|
})
|
||||||
|
|
@ -161,6 +164,7 @@ export class Compiler {
|
||||||
embed = compileMedia[type].call(this, href, title)
|
embed = compileMedia[type].call(this, href, title)
|
||||||
embed.type = type
|
embed.type = type
|
||||||
}
|
}
|
||||||
|
embed.fragment = config.fragment
|
||||||
|
|
||||||
return embed
|
return embed
|
||||||
}
|
}
|
||||||
|
|
@ -190,26 +194,27 @@ export class Compiler {
|
||||||
* @link https://github.com/markedjs/marked#overriding-renderer-methods
|
* @link https://github.com/markedjs/marked#overriding-renderer-methods
|
||||||
*/
|
*/
|
||||||
origin.heading = renderer.heading = function (text, level) {
|
origin.heading = renderer.heading = function (text, level) {
|
||||||
const nextToc = {level, title: text}
|
let {str, config} = getAndRemoveConfig(text)
|
||||||
|
const nextToc = {level, title: str}
|
||||||
|
|
||||||
if (/{docsify-ignore}/g.test(text)) {
|
if (/{docsify-ignore}/g.test(str)) {
|
||||||
text = text.replace('{docsify-ignore}', '')
|
str = str.replace('{docsify-ignore}', '')
|
||||||
nextToc.title = text
|
nextToc.title = str
|
||||||
nextToc.ignoreSubHeading = true
|
nextToc.ignoreSubHeading = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/{docsify-ignore-all}/g.test(text)) {
|
if (/{docsify-ignore-all}/g.test(str)) {
|
||||||
text = text.replace('{docsify-ignore-all}', '')
|
str = str.replace('{docsify-ignore-all}', '')
|
||||||
nextToc.title = text
|
nextToc.title = str
|
||||||
nextToc.ignoreAllSubs = true
|
nextToc.ignoreAllSubs = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const slug = slugify(text)
|
const slug = slugify(config.id || str)
|
||||||
const url = router.toURL(router.getCurrentPath(), {id: slug})
|
const url = router.toURL(router.getCurrentPath(), {id: slug})
|
||||||
nextToc.slug = url
|
nextToc.slug = url
|
||||||
_self.toc.push(nextToc)
|
_self.toc.push(nextToc)
|
||||||
|
|
||||||
return `<h${level} id="${slug}"><a href="${url}" data-id="${slug}" class="anchor"><span>${text}</span></a></h${level}>`
|
return `<h${level} id="${slug}"><a href="${url}" data-id="${slug}" class="anchor"><span>${str}</span></a></h${level}>`
|
||||||
}
|
}
|
||||||
// Highlight code
|
// Highlight code
|
||||||
origin.code = renderer.code = function (code, lang = '') {
|
origin.code = renderer.code = function (code, lang = '') {
|
||||||
|
|
@ -237,7 +242,7 @@ export class Compiler {
|
||||||
}
|
}
|
||||||
href = router.toURL(href, null, router.getCurrentPath())
|
href = router.toURL(href, null, router.getCurrentPath())
|
||||||
} else {
|
} else {
|
||||||
attrs += href.startsWith('mailto:') ? '' : ` target="${linkTarget}"`
|
attrs += href.indexOf('mailto:') === 0 ? '' : ` target="${linkTarget}"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.target) {
|
if (config.target) {
|
||||||
|
|
@ -261,8 +266,6 @@ export class Compiler {
|
||||||
result = helperTpl('tip', text)
|
result = helperTpl('tip', text)
|
||||||
} else if (/^\?>/.test(text)) {
|
} else if (/^\?>/.test(text)) {
|
||||||
result = helperTpl('warn', text)
|
result = helperTpl('warn', text)
|
||||||
} else if (/^</.test(text)) {
|
|
||||||
return text
|
|
||||||
} else {
|
} else {
|
||||||
result = `<p>${text}</p>`
|
result = `<p>${text}</p>`
|
||||||
}
|
}
|
||||||
|
|
@ -299,6 +302,23 @@ export class Compiler {
|
||||||
|
|
||||||
return `<img src="${url}"data-origin="${href}" alt="${text}"${attrs}>`
|
return `<img src="${url}"data-origin="${href}" alt="${text}"${attrs}>`
|
||||||
}
|
}
|
||||||
|
origin.list = renderer.list = function (body, ordered, start) {
|
||||||
|
const isTaskList = /<li class="task-list-item">/.test(body.split('class="task-list"')[0])
|
||||||
|
const isStartReq = start && start > 1
|
||||||
|
const tag = ordered ? 'ol' : 'ul'
|
||||||
|
const tagAttrs = [
|
||||||
|
(isTaskList ? 'class="task-list"' : ''),
|
||||||
|
(isStartReq ? `start="${start}"` : '')
|
||||||
|
].join(' ').trim()
|
||||||
|
|
||||||
|
return `<${tag} ${tagAttrs}>${body}</${tag}>`
|
||||||
|
}
|
||||||
|
origin.listitem = renderer.listitem = function (text) {
|
||||||
|
const isTaskItem = /^(<input.*type="checkbox"[^>]*>)/.test(text)
|
||||||
|
const html = isTaskItem ? `<li class="task-list-item"><label>${text}</label></li>` : `<li>${text}</li>`
|
||||||
|
|
||||||
|
return html
|
||||||
|
}
|
||||||
|
|
||||||
renderer.origin = origin
|
renderer.origin = origin
|
||||||
|
|
||||||
|
|
@ -309,13 +329,25 @@ export class Compiler {
|
||||||
* Compile sidebar
|
* Compile sidebar
|
||||||
*/
|
*/
|
||||||
sidebar(text, level) {
|
sidebar(text, level) {
|
||||||
|
const {toc} = this
|
||||||
const currentPath = this.router.getCurrentPath()
|
const currentPath = this.router.getCurrentPath()
|
||||||
let html = ''
|
let html = ''
|
||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
html = this.compile(text)
|
html = this.compile(text)
|
||||||
} else {
|
} else {
|
||||||
const tree = this.cacheTree[currentPath] || genTree(this.toc, level)
|
for (let i = 0; i < toc.length; i++) {
|
||||||
|
if (toc[i].ignoreSubHeading) {
|
||||||
|
const deletedHeaderLevel = toc[i].level
|
||||||
|
toc.splice(i, 1)
|
||||||
|
// Remove headers who are under current header
|
||||||
|
for (let j = i; deletedHeaderLevel < toc[j].level && j < toc.length; j++) {
|
||||||
|
toc.splice(j, 1) && j-- && i++
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const tree = this.cacheTree[currentPath] || genTree(toc, level)
|
||||||
html = treeTpl(tree, '<ul>{inner}</ul>')
|
html = treeTpl(tree, '<ul>{inner}</ul>')
|
||||||
this.cacheTree[currentPath] = tree
|
this.cacheTree[currentPath] = tree
|
||||||
}
|
}
|
||||||
|
|
@ -340,7 +372,6 @@ export class Compiler {
|
||||||
for (let i = 0; i < toc.length; i++) {
|
for (let i = 0; i < toc.length; i++) {
|
||||||
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--
|
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--
|
||||||
}
|
}
|
||||||
|
|
||||||
const tree = cacheTree[currentPath] || genTree(toc, level)
|
const tree = cacheTree[currentPath] || genTree(toc, level)
|
||||||
|
|
||||||
cacheTree[currentPath] = tree
|
cacheTree[currentPath] = tree
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,11 @@ function walkFetchEmbed({embedTokens, compile, fetch}, cb) {
|
||||||
if (token.embed.type === 'markdown') {
|
if (token.embed.type === 'markdown') {
|
||||||
embedToken = compile.lexer(text)
|
embedToken = compile.lexer(text)
|
||||||
} else if (token.embed.type === 'code') {
|
} else if (token.embed.type === 'code') {
|
||||||
|
if (token.embed.fragment) {
|
||||||
|
const fragment = token.embed.fragment
|
||||||
|
const pattern = new RegExp(`(?:###|\\/\\/\\/)\\s*\\[${fragment}\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\[${fragment}\\]`)
|
||||||
|
text = ((text.match(pattern) || [])[1] || '').trim()
|
||||||
|
}
|
||||||
embedToken = compile.lexer(
|
embedToken = compile.lexer(
|
||||||
'```' +
|
'```' +
|
||||||
token.embed.lang +
|
token.embed.lang +
|
||||||
|
|
@ -57,9 +62,11 @@ function walkFetchEmbed({embedTokens, compile, fetch}, cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function prerenderEmbed({compiler, raw = '', fetch}, done) {
|
export function prerenderEmbed({compiler, raw = '', fetch}, done) {
|
||||||
let hit
|
let hit = cached[raw]
|
||||||
if ((hit = cached[raw])) {
|
if (hit) {
|
||||||
return done(hit)
|
const copy = hit.slice()
|
||||||
|
copy.links = hit.links
|
||||||
|
return done(copy)
|
||||||
}
|
}
|
||||||
|
|
||||||
const compile = compiler._marked
|
const compile = compiler._marked
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {inBrowser} from '../util/env'
|
import {inBrowser} from '../util/env'
|
||||||
|
|
||||||
function replace(m, $1) {
|
function replace(m, $1) {
|
||||||
return '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/' + $1 + '.png" alt="' + $1 + '" />'
|
return '<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/' + $1 + '.png" alt="' + $1 + '" />'
|
||||||
}
|
}
|
||||||
|
|
||||||
export function emojify(text) {
|
export function emojify(text) {
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ export function renderMixin(proto) {
|
||||||
dom.toggleClass(el, 'add', 'show')
|
dom.toggleClass(el, 'add', 'show')
|
||||||
|
|
||||||
let html = this.coverIsHTML ? text : this.compiler.cover(text)
|
let html = this.coverIsHTML ? text : this.compiler.cover(text)
|
||||||
|
|
||||||
const m = html
|
const m = html
|
||||||
.trim()
|
.trim()
|
||||||
.match('<p><img.*?data-origin="(.*?)"[^a]+alt="(.*?)">([^<]*?)</p>$')
|
.match('<p><img.*?data-origin="(.*?)"[^a]+alt="(.*?)">([^<]*?)</p>$')
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@ import {
|
||||||
isAbsolutePath,
|
isAbsolutePath,
|
||||||
stringifyQuery,
|
stringifyQuery,
|
||||||
cleanPath,
|
cleanPath,
|
||||||
replaceSlug
|
replaceSlug,
|
||||||
|
resolvePath
|
||||||
} from '../util'
|
} from '../util'
|
||||||
import {noop, merge} from '../../util/core'
|
import {noop, merge} from '../../util/core'
|
||||||
|
|
||||||
|
|
@ -73,9 +74,13 @@ export class History {
|
||||||
if (local) {
|
if (local) {
|
||||||
const idIndex = currentRoute.indexOf('?')
|
const idIndex = currentRoute.indexOf('?')
|
||||||
path =
|
path =
|
||||||
(idIndex > 0 ? currentRoute.substr(0, idIndex) : currentRoute) + path
|
(idIndex > 0 ? currentRoute.substring(0, idIndex) : currentRoute) + path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.config.relativePath && path.indexOf('/') !== 0) {
|
||||||
|
const currentDir = currentRoute.substring(0, currentRoute.lastIndexOf('/') + 1)
|
||||||
|
return cleanPath(resolvePath(currentDir + path))
|
||||||
|
}
|
||||||
return cleanPath('/' + path)
|
return cleanPath('/' + path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,20 @@ export const cleanPath = cached(path => {
|
||||||
return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/')
|
return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const resolvePath = cached(path => {
|
||||||
|
const segments = path.replace(/^\//, '').split('/')
|
||||||
|
let resolved = []
|
||||||
|
for (let i = 0, len = segments.length; i < len; i++) {
|
||||||
|
const segment = segments[i]
|
||||||
|
if (segment === '..') {
|
||||||
|
resolved.pop()
|
||||||
|
} else if (segment !== '.') {
|
||||||
|
resolved.push(segment)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '/' + resolved.join('/')
|
||||||
|
})
|
||||||
|
|
||||||
export function getPath(...args) {
|
export function getPath(...args) {
|
||||||
return cleanPath(args.join('/'))
|
return cleanPath(args.join('/'))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -892,7 +892,7 @@ const AllGithubEmoji = [
|
||||||
window.emojify = function (match, $1) {
|
window.emojify = function (match, $1) {
|
||||||
return AllGithubEmoji.indexOf($1) === -1 ?
|
return AllGithubEmoji.indexOf($1) === -1 ?
|
||||||
match :
|
match :
|
||||||
'<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/' +
|
'<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/' +
|
||||||
$1 +
|
$1 +
|
||||||
'.png" alt="' +
|
'.png" alt="' +
|
||||||
$1 +
|
$1 +
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,16 @@ function install(hook) {
|
||||||
const main = dom.getNode('#main')
|
const main = dom.getNode('#main')
|
||||||
div.style = `width: ${main.clientWidth}px; margin: 0 auto 20px;`
|
div.style = `width: ${main.clientWidth}px; margin: 0 auto 20px;`
|
||||||
dom.appendTo(dom.find('.content'), div)
|
dom.appendTo(dom.find('.content'), div)
|
||||||
const script = dom.create('script')
|
})
|
||||||
const content = `gitalk.render('gitalk-container')`
|
|
||||||
script.textContent = content
|
hook.doneEach(_ => {
|
||||||
dom.appendTo(dom.body, script)
|
const el = document.getElementById('gitalk-container')
|
||||||
|
while (el.hasChildNodes()) {
|
||||||
|
el.removeChild(el.firstChild)
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
|
gitalk.render('gitalk-container')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
37
src/plugins/matomo.js
Normal file
37
src/plugins/matomo.js
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
function appendScript(options) {
|
||||||
|
const script = document.createElement('script')
|
||||||
|
script.async = true
|
||||||
|
script.src = options.host + '/matomo.js'
|
||||||
|
document.body.appendChild(script)
|
||||||
|
}
|
||||||
|
|
||||||
|
function init(options) {
|
||||||
|
window._paq = window._paq || []
|
||||||
|
window._paq.push(['trackPageView'])
|
||||||
|
window._paq.push(['enableLinkTracking'])
|
||||||
|
setTimeout(function() {
|
||||||
|
appendScript(options)
|
||||||
|
window._paq.push(['setTrackerUrl', options.host + '/matomo.php'])
|
||||||
|
window._paq.push(['setSiteId', options.id + ''])
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function collect() {
|
||||||
|
if (!window._paq) {
|
||||||
|
init($docsify.matomo)
|
||||||
|
}
|
||||||
|
window._paq.push(['setCustomUrl', window.location.hash.substr(1)])
|
||||||
|
window._paq.push(['setDocumentTitle', document.title])
|
||||||
|
window._paq.push(['trackPageView'])
|
||||||
|
}
|
||||||
|
|
||||||
|
const install = function (hook) {
|
||||||
|
if (!$docsify.matomo) {
|
||||||
|
console.error('[Docsify] matomo is required.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
hook.beforeEach(collect)
|
||||||
|
}
|
||||||
|
|
||||||
|
$docsify.plugins = [].concat(install, $docsify.plugins)
|
||||||
|
|
@ -7,7 +7,8 @@ const CONFIG = {
|
||||||
paths: 'auto',
|
paths: 'auto',
|
||||||
depth: 2,
|
depth: 2,
|
||||||
maxAge: 86400000, // 1 day
|
maxAge: 86400000, // 1 day
|
||||||
hideOtherSidebarContent: false
|
hideOtherSidebarContent: false,
|
||||||
|
namespace: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const install = function (hook, vm) {
|
const install = function (hook, vm) {
|
||||||
|
|
@ -23,6 +24,7 @@ const install = function (hook, vm) {
|
||||||
CONFIG.noData = opts.noData || CONFIG.noData
|
CONFIG.noData = opts.noData || CONFIG.noData
|
||||||
CONFIG.depth = opts.depth || CONFIG.depth
|
CONFIG.depth = opts.depth || CONFIG.depth
|
||||||
CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent
|
CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent
|
||||||
|
CONFIG.namespace = opts.namespace || CONFIG.namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
const isAuto = CONFIG.paths === 'auto'
|
const isAuto = CONFIG.paths === 'auto'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,17 @@
|
||||||
let INDEXS = {}
|
let INDEXS = {}
|
||||||
|
|
||||||
|
const LOCAL_STORAGE = {
|
||||||
|
EXPIRE_KEY: 'docsify.search.expires',
|
||||||
|
INDEX_KEY: 'docsify.search.index'
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveExpireKey(namespace) {
|
||||||
|
return namespace ? `${LOCAL_STORAGE.EXPIRE_KEY}/${namespace}` : LOCAL_STORAGE.EXPIRE_KEY
|
||||||
|
}
|
||||||
|
function resolveIndexKey(namespace) {
|
||||||
|
return namespace ? `${LOCAL_STORAGE.INDEX_KEY}/${namespace}` : LOCAL_STORAGE.INDEX_KEY
|
||||||
|
}
|
||||||
|
|
||||||
function escapeHtml(string) {
|
function escapeHtml(string) {
|
||||||
const entityMap = {
|
const entityMap = {
|
||||||
'&': '&',
|
'&': '&',
|
||||||
|
|
@ -16,7 +28,7 @@ function escapeHtml(string) {
|
||||||
function getAllPaths(router) {
|
function getAllPaths(router) {
|
||||||
const paths = []
|
const paths = []
|
||||||
|
|
||||||
document.querySelectorAll('.sidebar-nav a:not(.section-link):not([data-nosearch])').forEach(node => {
|
Docsify.dom.findAll('.sidebar-nav a:not(.section-link):not([data-nosearch])').forEach(node => {
|
||||||
const href = node.href
|
const href = node.href
|
||||||
const originHref = node.getAttribute('href')
|
const originHref = node.getAttribute('href')
|
||||||
const path = router.parse(href).path
|
const path = router.parse(href).path
|
||||||
|
|
@ -33,9 +45,9 @@ function getAllPaths(router) {
|
||||||
return paths
|
return paths
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveData(maxAge) {
|
function saveData(maxAge, expireKey, indexKey) {
|
||||||
localStorage.setItem('docsify.search.expires', Date.now() + maxAge)
|
localStorage.setItem(expireKey, Date.now() + maxAge)
|
||||||
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS))
|
localStorage.setItem(indexKey, JSON.stringify(INDEXS))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function genIndex(path, content = '', router, depth) {
|
export function genIndex(path, content = '', router, depth) {
|
||||||
|
|
@ -84,29 +96,27 @@ export function search(query) {
|
||||||
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
const post = data[i]
|
const post = data[i]
|
||||||
let isMatch = false
|
let matchesScore = 0
|
||||||
let resultStr = ''
|
let resultStr = ''
|
||||||
const postTitle = post.title && post.title.trim()
|
const postTitle = post.title && post.title.trim()
|
||||||
const postContent = post.body && post.body.trim()
|
const postContent = post.body && post.body.trim()
|
||||||
const postUrl = post.slug || ''
|
const postUrl = post.slug || ''
|
||||||
|
|
||||||
if (postTitle && postContent) {
|
if (postTitle) {
|
||||||
keywords.forEach(keyword => {
|
keywords.forEach( keyword => {
|
||||||
// From https://github.com/sindresorhus/escape-string-regexp
|
// From https://github.com/sindresorhus/escape-string-regexp
|
||||||
const regEx = new RegExp(
|
const regEx = new RegExp(
|
||||||
keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'),
|
keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'),
|
||||||
'gi'
|
'gi'
|
||||||
)
|
);
|
||||||
let indexTitle = -1
|
let indexTitle = -1
|
||||||
let indexContent = -1
|
let indexContent = -1
|
||||||
|
|
||||||
indexTitle = postTitle && postTitle.search(regEx)
|
indexTitle = postTitle ? postTitle.search(regEx) : -1
|
||||||
indexContent = postContent && postContent.search(regEx)
|
indexContent = postContent ? postContent.search(regEx) : -1
|
||||||
|
|
||||||
if (indexTitle < 0 && indexContent < 0) {
|
if (indexTitle >= 0 || indexContent >= 0) {
|
||||||
isMatch = false
|
matchesScore += indexTitle >= 0 ? 3 : indexContent >= 0 ? 2 : 0;
|
||||||
} else {
|
|
||||||
isMatch = true
|
|
||||||
if (indexContent < 0) {
|
if (indexContent < 0) {
|
||||||
indexContent = 0
|
indexContent = 0
|
||||||
}
|
}
|
||||||
|
|
@ -132,11 +142,12 @@ export function search(query) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (isMatch) {
|
if (matchesScore > 0) {
|
||||||
const matchingPost = {
|
const matchingPost = {
|
||||||
title: escapeHtml(postTitle),
|
title: escapeHtml(postTitle),
|
||||||
content: resultStr,
|
content: postContent ? resultStr : '',
|
||||||
url: postUrl
|
url: postUrl,
|
||||||
|
score: matchesScore
|
||||||
}
|
}
|
||||||
|
|
||||||
matchingResults.push(matchingPost)
|
matchingResults.push(matchingPost)
|
||||||
|
|
@ -144,14 +155,18 @@ export function search(query) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return matchingResults
|
return matchingResults.sort((r1, r2) => r2.score - r1.score);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function init(config, vm) {
|
export function init(config, vm) {
|
||||||
const isAuto = config.paths === 'auto'
|
const isAuto = config.paths === 'auto'
|
||||||
const isExpired = localStorage.getItem('docsify.search.expires') < Date.now()
|
|
||||||
|
|
||||||
INDEXS = JSON.parse(localStorage.getItem('docsify.search.index'))
|
const expireKey = resolveExpireKey(config.namespace)
|
||||||
|
const indexKey = resolveIndexKey(config.namespace)
|
||||||
|
|
||||||
|
const isExpired = localStorage.getItem(expireKey) < Date.now()
|
||||||
|
|
||||||
|
INDEXS = JSON.parse(localStorage.getItem(indexKey))
|
||||||
|
|
||||||
if (isExpired) {
|
if (isExpired) {
|
||||||
INDEXS = {}
|
INDEXS = {}
|
||||||
|
|
@ -172,7 +187,7 @@ export function init(config, vm) {
|
||||||
.get(vm.router.getFile(path), false, vm.config.requestHeaders)
|
.get(vm.router.getFile(path), false, vm.config.requestHeaders)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
INDEXS[path] = genIndex(path, result, vm.router, config.depth)
|
INDEXS[path] = genIndex(path, result, vm.router, config.depth)
|
||||||
len === ++count && saveData(config.maxAge)
|
len === ++count && saveData(config.maxAge, expireKey, indexKey)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -323,6 +323,9 @@ body.sticky
|
||||||
|
|
||||||
.markdown-section iframe
|
.markdown-section iframe
|
||||||
border 1px solid #eee
|
border 1px solid #eee
|
||||||
|
/* fix horizontal overflow on iOS Safari */
|
||||||
|
width 1px
|
||||||
|
min-width 100%
|
||||||
|
|
||||||
.markdown-section table
|
.markdown-section table
|
||||||
border-collapse collapse
|
border-collapse collapse
|
||||||
|
|
@ -383,6 +386,9 @@ body.sticky
|
||||||
border-radius 2px
|
border-radius 2px
|
||||||
padding 1rem
|
padding 1rem
|
||||||
|
|
||||||
|
.markdown-section ul.task-list > li
|
||||||
|
list-style-type none
|
||||||
|
|
||||||
body.close
|
body.close
|
||||||
.sidebar
|
.sidebar
|
||||||
transform translateX(- $sidebar-width)
|
transform translateX(- $sidebar-width)
|
||||||
|
|
|
||||||
228
src/themes/dolphin.styl
Normal file
228
src/themes/dolphin.styl
Normal file
|
|
@ -0,0 +1,228 @@
|
||||||
|
@import url('https://fonts.googleapis.com/css?family=Thasadith:400,400i,700')
|
||||||
|
|
||||||
|
$color-primary = #00ffff
|
||||||
|
$color-bg = #f0ffff
|
||||||
|
$color-text = #34495e
|
||||||
|
$sidebar-width = 300px
|
||||||
|
|
||||||
|
@import 'basic/_layout'
|
||||||
|
@import 'basic/_coverpage'
|
||||||
|
|
||||||
|
body
|
||||||
|
background-color $color-bg
|
||||||
|
|
||||||
|
/* sidebar */
|
||||||
|
.sidebar
|
||||||
|
background-color $color-bg
|
||||||
|
color #364149
|
||||||
|
|
||||||
|
li
|
||||||
|
margin 6px 0 6px 0
|
||||||
|
|
||||||
|
ul li a
|
||||||
|
color #505d6b
|
||||||
|
font-size 14px
|
||||||
|
font-weight normal
|
||||||
|
overflow hidden
|
||||||
|
text-decoration none
|
||||||
|
text-overflow ellipsis
|
||||||
|
white-space nowrap
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
text-decoration underline
|
||||||
|
|
||||||
|
ul li ul
|
||||||
|
padding 0
|
||||||
|
|
||||||
|
ul li.active > a
|
||||||
|
border-right 2px solid
|
||||||
|
color var(--theme-color, $color-primary)
|
||||||
|
font-weight 600
|
||||||
|
|
||||||
|
.app-sub-sidebar
|
||||||
|
li
|
||||||
|
&::before
|
||||||
|
content '-'
|
||||||
|
padding-right 4px
|
||||||
|
float left
|
||||||
|
|
||||||
|
/* markdown content found on pages */
|
||||||
|
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4, .markdown-section strong
|
||||||
|
color #2c3e50
|
||||||
|
font-weight 600
|
||||||
|
|
||||||
|
.markdown-section a
|
||||||
|
color var(--theme-color, $color-primary)
|
||||||
|
font-weight 600
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
text-decoration underline
|
||||||
|
|
||||||
|
.markdown-section h1
|
||||||
|
font-size 2rem
|
||||||
|
margin 0 0 1rem
|
||||||
|
|
||||||
|
.markdown-section h2
|
||||||
|
font-size 1.75rem
|
||||||
|
margin 45px 0 0.8rem
|
||||||
|
|
||||||
|
.markdown-section h3
|
||||||
|
font-size 1.5rem
|
||||||
|
margin 40px 0 0.6rem
|
||||||
|
|
||||||
|
.markdown-section h4
|
||||||
|
font-size 1.25rem
|
||||||
|
|
||||||
|
.markdown-section h5
|
||||||
|
font-size 1rem
|
||||||
|
|
||||||
|
.markdown-section h6
|
||||||
|
color #777
|
||||||
|
font-size 1rem
|
||||||
|
|
||||||
|
.markdown-section figure, .markdown-section p
|
||||||
|
margin 1.2em 0
|
||||||
|
|
||||||
|
.markdown-section p, .markdown-section ul, .markdown-section ol
|
||||||
|
line-height 1.6rem
|
||||||
|
word-spacing 0.05rem
|
||||||
|
|
||||||
|
.markdown-section ul, .markdown-section ol
|
||||||
|
padding-left 1.5rem
|
||||||
|
|
||||||
|
.markdown-section blockquote
|
||||||
|
border-left 4px solid var(--theme-color, $color-primary)
|
||||||
|
color #858585
|
||||||
|
margin 2em 0
|
||||||
|
padding-left 20px
|
||||||
|
|
||||||
|
.markdown-section blockquote p
|
||||||
|
font-weight 600
|
||||||
|
margin-left 0
|
||||||
|
|
||||||
|
.markdown-section iframe
|
||||||
|
margin 1em 0
|
||||||
|
|
||||||
|
.markdown-section em
|
||||||
|
color #7f8c8d
|
||||||
|
|
||||||
|
.markdown-section code
|
||||||
|
background-color #f8f8f8
|
||||||
|
border-radius 2px
|
||||||
|
color #e96900
|
||||||
|
font-family 'Roboto Mono', Monaco, courier, monospace
|
||||||
|
font-size 0.8rem
|
||||||
|
margin 0 2px
|
||||||
|
padding 3px 5px
|
||||||
|
white-space pre-wrap
|
||||||
|
|
||||||
|
.markdown-section pre
|
||||||
|
-moz-osx-font-smoothing initial
|
||||||
|
-webkit-font-smoothing initial
|
||||||
|
background-color #f8f8f8
|
||||||
|
font-family 'Roboto Mono', Monaco, courier, monospace
|
||||||
|
line-height 1.5rem
|
||||||
|
margin 1.2em 0
|
||||||
|
overflow auto
|
||||||
|
padding 0 1.4rem
|
||||||
|
position relative
|
||||||
|
word-wrap normal
|
||||||
|
|
||||||
|
/* code highlight */
|
||||||
|
.token.comment, .token.prolog, .token.doctype, .token.cdata
|
||||||
|
color #8e908c
|
||||||
|
|
||||||
|
.token.namespace
|
||||||
|
opacity 0.7
|
||||||
|
|
||||||
|
.token.boolean, .token.number
|
||||||
|
color #c76b29
|
||||||
|
|
||||||
|
.token.punctuation
|
||||||
|
color #525252
|
||||||
|
|
||||||
|
.token.property
|
||||||
|
color #c08b30
|
||||||
|
|
||||||
|
.token.tag
|
||||||
|
color #2973b7
|
||||||
|
|
||||||
|
.token.string
|
||||||
|
color var(--theme-color, $color-primary)
|
||||||
|
|
||||||
|
.token.selector
|
||||||
|
color #6679cc
|
||||||
|
|
||||||
|
.token.attr-name
|
||||||
|
color #2973b7
|
||||||
|
|
||||||
|
.token.entity, .token.url, .language-css .token.string, .style .token.string
|
||||||
|
color #22a2c9
|
||||||
|
|
||||||
|
.token.attr-value, .token.control, .token.directive, .token.unit
|
||||||
|
color var(--theme-color, $color-primary)
|
||||||
|
|
||||||
|
.token.keyword, .token.function
|
||||||
|
color #e96900
|
||||||
|
|
||||||
|
.token.statement, .token.regex, .token.atrule
|
||||||
|
color #22a2c9
|
||||||
|
|
||||||
|
.token.placeholder, .token.variable
|
||||||
|
color #3d8fd1
|
||||||
|
|
||||||
|
.token.deleted
|
||||||
|
text-decoration line-through
|
||||||
|
|
||||||
|
.token.inserted
|
||||||
|
border-bottom 1px dotted #202746
|
||||||
|
text-decoration none
|
||||||
|
|
||||||
|
.token.italic
|
||||||
|
font-style italic
|
||||||
|
|
||||||
|
.token.important, .token.bold
|
||||||
|
font-weight bold
|
||||||
|
|
||||||
|
.token.important
|
||||||
|
color #c94922
|
||||||
|
|
||||||
|
.token.entity
|
||||||
|
cursor help
|
||||||
|
|
||||||
|
.markdown-section pre > code
|
||||||
|
-moz-osx-font-smoothing initial
|
||||||
|
-webkit-font-smoothing initial
|
||||||
|
background-color #f8f8f8
|
||||||
|
border-radius 2px
|
||||||
|
color #525252
|
||||||
|
display block
|
||||||
|
font-family 'Roboto Mono', Monaco, courier, monospace
|
||||||
|
font-size 0.8rem
|
||||||
|
line-height inherit
|
||||||
|
margin 0 2px
|
||||||
|
max-width inherit
|
||||||
|
overflow inherit
|
||||||
|
padding 2.2em 5px
|
||||||
|
white-space inherit
|
||||||
|
|
||||||
|
.markdown-section code::after, .markdown-section code::before
|
||||||
|
letter-spacing 0.05rem
|
||||||
|
|
||||||
|
code .token
|
||||||
|
-moz-osx-font-smoothing initial
|
||||||
|
-webkit-font-smoothing initial
|
||||||
|
min-height 1.5rem
|
||||||
|
|
||||||
|
pre::after
|
||||||
|
color #ccc
|
||||||
|
content attr(data-lang)
|
||||||
|
font-size 0.6rem
|
||||||
|
font-weight 600
|
||||||
|
height 15px
|
||||||
|
line-height 15px
|
||||||
|
padding 5px 10px 0
|
||||||
|
position absolute
|
||||||
|
right 0
|
||||||
|
text-align right
|
||||||
|
top 0
|
||||||
87
test/_helper.js
Normal file
87
test/_helper.js
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
// load ES6 modules in Node.js on the fly
|
||||||
|
require = require('esm')(module/*, options*/)
|
||||||
|
|
||||||
|
const path = require('path')
|
||||||
|
const {expect} = require('chai')
|
||||||
|
|
||||||
|
const {JSDOM} = require('jsdom')
|
||||||
|
|
||||||
|
function ready(callback) {
|
||||||
|
const state = document.readyState
|
||||||
|
|
||||||
|
if (state === 'complete' || state === 'interactive') {
|
||||||
|
return setTimeout(callback, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', callback)
|
||||||
|
}
|
||||||
|
module.exports.init = function(fixture = 'default', config = {}, markup) {
|
||||||
|
if (markup == null) {
|
||||||
|
markup = `<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head></head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script>
|
||||||
|
window.$docsify = ${JSON.stringify(config, null, 2)}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>`
|
||||||
|
}
|
||||||
|
const rootPath = path.join(__dirname, 'fixtures', fixture)
|
||||||
|
|
||||||
|
const dom = new JSDOM(markup)
|
||||||
|
dom.reconfigure({ url: 'file:///' + rootPath })
|
||||||
|
|
||||||
|
global.window = dom.window
|
||||||
|
global.document = dom.window.document
|
||||||
|
global.navigator = dom.window.navigator
|
||||||
|
global.location = dom.window.location
|
||||||
|
global.XMLHttpRequest = dom.window.XMLHttpRequest
|
||||||
|
|
||||||
|
// mimic src/core/index.js but for Node.js
|
||||||
|
function Docsify() {
|
||||||
|
this._init()
|
||||||
|
}
|
||||||
|
|
||||||
|
const proto = Docsify.prototype
|
||||||
|
|
||||||
|
const {initMixin} = require('../src/core/init')
|
||||||
|
const {routerMixin} = require('../src/core//router')
|
||||||
|
const {renderMixin} = require('../src/core//render')
|
||||||
|
const {fetchMixin} = require('../src/core/fetch')
|
||||||
|
const {eventMixin} = require('../src/core//event')
|
||||||
|
|
||||||
|
initMixin(proto)
|
||||||
|
routerMixin(proto)
|
||||||
|
renderMixin(proto)
|
||||||
|
fetchMixin(proto)
|
||||||
|
eventMixin(proto)
|
||||||
|
|
||||||
|
const NOT_INIT_PATTERN = '<!--main-->'
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
ready(() => {
|
||||||
|
const docsify = new Docsify()
|
||||||
|
// NOTE: I was not able to get it working with a callback, but polling works usually at the first time
|
||||||
|
const id = setInterval(() => {
|
||||||
|
if (dom.window.document.body.innerHTML.indexOf(NOT_INIT_PATTERN) == -1) {
|
||||||
|
clearInterval(id)
|
||||||
|
return resolve({
|
||||||
|
docsify: docsify,
|
||||||
|
dom: dom
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 10)
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
module.exports.expectSameDom = function(actual, expected) {
|
||||||
|
const WHITESPACES_BETWEEN_TAGS = />(\s\s+)</g
|
||||||
|
function replacer(match, group1) {
|
||||||
|
return match.replace(group1, '')
|
||||||
|
}
|
||||||
|
expect(actual.replace(WHITESPACES_BETWEEN_TAGS, replacer).trim())
|
||||||
|
.equal(expected.replace(WHITESPACES_BETWEEN_TAGS, replacer).trim())
|
||||||
|
}
|
||||||
6
test/fixtures/default/README.md
vendored
Normal file
6
test/fixtures/default/README.md
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<!--
|
||||||
|
|
||||||
|
create your own fixture directory
|
||||||
|
if you need a custom README.md or sidebar
|
||||||
|
|
||||||
|
-->
|
||||||
18
test/fixtures/simple/README.md
vendored
Normal file
18
test/fixtures/simple/README.md
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Heading
|
||||||
|
|
||||||
|
[another page](other.md)
|
||||||
|
|
||||||
|
## II 1
|
||||||
|
|
||||||
|
### III 1
|
||||||
|
|
||||||
|
#### IV 1
|
||||||
|
|
||||||
|
##### V 1
|
||||||
|
|
||||||
|
|
||||||
|
## II 2
|
||||||
|
|
||||||
|
### III 2
|
||||||
|
|
||||||
|
#### IV 2
|
||||||
16
test/fixtures/simple/other-page.md
vendored
Normal file
16
test/fixtures/simple/other-page.md
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Other
|
||||||
|
|
||||||
|
## two 1
|
||||||
|
|
||||||
|
### three 1
|
||||||
|
|
||||||
|
#### four 1
|
||||||
|
|
||||||
|
##### five 1
|
||||||
|
|
||||||
|
|
||||||
|
## two 2
|
||||||
|
|
||||||
|
### three 2
|
||||||
|
|
||||||
|
#### four 2
|
||||||
14
test/integration/render.js
Normal file
14
test/integration/render.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
const {expect} = require('chai')
|
||||||
|
|
||||||
|
const {init, expectSameDom} = require('../_helper')
|
||||||
|
|
||||||
|
describe('full docsify initialization', function() {
|
||||||
|
it('TODO: check generated markup', async function() {
|
||||||
|
const {docsify, dom} = await init('simple', {loadSidebar: true})
|
||||||
|
console.log(dom.window.document.body.innerHTML)
|
||||||
|
// TODO: add some expectations
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
14
test/integration/router.js
Normal file
14
test/integration/router.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
const {expect} = require('chai')
|
||||||
|
|
||||||
|
const {init, expectSameDom} = require('../_helper')
|
||||||
|
|
||||||
|
describe('router', function() {
|
||||||
|
it('TODO: trigger to load another page', async function() {
|
||||||
|
const {docsify} = await init()
|
||||||
|
window.location = '/?foo=bar'
|
||||||
|
// TODO: add some expectations
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
62
test/unit/base.js
Normal file
62
test/unit/base.js
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
/* eslint-env node, chai, mocha */
|
||||||
|
require = require('esm')(module/*, options*/)
|
||||||
|
const {expect} = require('chai')
|
||||||
|
const {History} = require('../../src/core/router/history/base')
|
||||||
|
|
||||||
|
class MockHistory extends History {
|
||||||
|
parse(path) {
|
||||||
|
return {path}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('router/history/base', function () {
|
||||||
|
describe('relativePath true', function () {
|
||||||
|
var history
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
history = new MockHistory({relativePath: true})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('toURL', function () {
|
||||||
|
// WHEN
|
||||||
|
const url = history.toURL('guide.md', {}, '/zh-ch/')
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(url).equal('/zh-ch/guide')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('toURL with double dot', function () {
|
||||||
|
// WHEN
|
||||||
|
const url = history.toURL('../README.md', {}, '/zh-ch/')
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(url).equal('/README')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('toURL child path', function () {
|
||||||
|
// WHEN
|
||||||
|
const url = history.toURL('config/example.md', {}, '/zh-ch/')
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(url).equal('/zh-ch/config/example')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('toURL absolute path', function () {
|
||||||
|
// WHEN
|
||||||
|
const url = history.toURL('/README', {}, '/zh-ch/')
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(url).equal('/README')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('toURL without relative path', function () {
|
||||||
|
const history = new MockHistory({relativePath: false})
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
const url = history.toURL('README', {}, '/zh-ch/')
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(url).equal('/README')
|
||||||
|
})
|
||||||
|
})
|
||||||
89
test/unit/render.js
Normal file
89
test/unit/render.js
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
const {expect} = require('chai')
|
||||||
|
|
||||||
|
const {init, expectSameDom} = require('../_helper')
|
||||||
|
|
||||||
|
describe('render', function() {
|
||||||
|
it('important content (tips)', async function() {
|
||||||
|
const {docsify, dom} = await init()
|
||||||
|
const output = docsify.compiler.compile('!> **Time** is money, my friend!')
|
||||||
|
expect(output).equal('<p class="tip"><strong>Time</strong> is money, my friend!</p>')
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('lists', function() {
|
||||||
|
it('as unordered task list', async function() {
|
||||||
|
const {docsify, dom} = await init()
|
||||||
|
const output = docsify.compiler.compile(`
|
||||||
|
- [x] Task 1
|
||||||
|
- [ ] Task 2
|
||||||
|
- [ ] Task 3`)
|
||||||
|
expect(output, `<ul class="task-list">
|
||||||
|
<li class="task-list-item"><label><input checked="" disabled="" type="checkbox"> Task 1</label></li>
|
||||||
|
<li class="task-list-item"><label><input disabled="" type="checkbox"> Task 2</label></li>
|
||||||
|
<li class="task-list-item"><label><input disabled="" type="checkbox"> Task 3</label></li>
|
||||||
|
</ul>`)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('as ordered task list', async function() {
|
||||||
|
const {docsify, dom} = await init()
|
||||||
|
const output = docsify.compiler.compile(`
|
||||||
|
1. [ ] Task 1
|
||||||
|
2. [x] Task 2`)
|
||||||
|
expectSameDom(output, `<ol class="task-list">
|
||||||
|
<li class="task-list-item"><label><input disabled="" type="checkbox"> Task 1</label></li>
|
||||||
|
<li class="task-list-item"><label><input checked="" disabled="" type="checkbox"> Task 2</label></li>
|
||||||
|
</ol>`)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('normal unordered', async function() {
|
||||||
|
const {docsify, dom} = await init()
|
||||||
|
const output = docsify.compiler.compile(`
|
||||||
|
- [linktext](link)
|
||||||
|
- just text`)
|
||||||
|
expectSameDom(output, `<ul >
|
||||||
|
<li><a href="#/link">linktext</a></li>
|
||||||
|
<li>just text</li>
|
||||||
|
</ul>`)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('unordered with custom start', async function() {
|
||||||
|
const {docsify, dom} = await init()
|
||||||
|
const output = docsify.compiler.compile(`
|
||||||
|
1. first
|
||||||
|
2. second
|
||||||
|
|
||||||
|
text
|
||||||
|
|
||||||
|
3. third`)
|
||||||
|
expectSameDom(output, `<ol >
|
||||||
|
<li>first</li>
|
||||||
|
<li>second</li>
|
||||||
|
</ol>
|
||||||
|
<p>text</p>
|
||||||
|
<ol start="3">
|
||||||
|
<li>third</li>
|
||||||
|
</ol>`)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('nested', async function() {
|
||||||
|
const {docsify, dom} = await init()
|
||||||
|
const output = docsify.compiler.compile(`
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- 2 a
|
||||||
|
- 2 b
|
||||||
|
- 3`)
|
||||||
|
expectSameDom(output, `<ul >
|
||||||
|
<li>1</li>
|
||||||
|
<li>2<ul >
|
||||||
|
<li>2 a</li>
|
||||||
|
<li>2 b</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>3</li>
|
||||||
|
</ul>`)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
30
test/unit/util.js
Normal file
30
test/unit/util.js
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
/* eslint-env node, chai, mocha */
|
||||||
|
require = require('esm')(module/*, options*/)
|
||||||
|
const {expect} = require('chai')
|
||||||
|
const {resolvePath} = require('../../src/core/router/util')
|
||||||
|
|
||||||
|
describe('router/util', function () {
|
||||||
|
it('resolvePath', async function () {
|
||||||
|
// WHEN
|
||||||
|
const result = resolvePath('hello.md')
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(result).equal('/hello.md')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('resolvePath with dot', async function () {
|
||||||
|
// WHEN
|
||||||
|
const result = resolvePath('./hello.md')
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(result).equal('/hello.md')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('resolvePath with two dots', async function () {
|
||||||
|
// WHEN
|
||||||
|
const result = resolvePath('test/../hello.md')
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(result).equal('/hello.md')
|
||||||
|
})
|
||||||
|
})
|
||||||
1
themes/.gitkeep
Normal file
1
themes/.gitkeep
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue