mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-10 05:48:18 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec8daca3ec | ||
|
|
1335baa22f | ||
|
|
123c516836 | ||
|
|
ecc0e04c70 | ||
|
|
278a75ebd5 | ||
|
|
b8a4e6ba1b | ||
|
|
01bbbaaf92 | ||
|
|
e5c64a3d8f | ||
|
|
e5ae6e8d25 | ||
|
|
702bb5b715 | ||
|
|
7cdf751cc5 | ||
|
|
6a09059645 | ||
|
|
84f7b5c7c2 | ||
|
|
fd14e14022 | ||
|
|
4b5185f0d7 | ||
|
|
45a7464d23 | ||
|
|
222cfdbbe4 | ||
|
|
890a7bf9b6 | ||
|
|
edc3201367 | ||
|
|
8dd4378e89 | ||
|
|
149d9929f8 | ||
|
|
50fe22563b | ||
|
|
4aafde85fb | ||
|
|
dc0c3ced4e | ||
|
|
62ce447fc3 |
@@ -3,3 +3,4 @@
|
||||
/themes/
|
||||
node_modules
|
||||
/lib/
|
||||
.idea
|
||||
+106
-173
@@ -1,7 +1,52 @@
|
||||
<a name="4.6.0"></a>
|
||||
# [4.6.0](https://github.com/QingWei-Li/docsify/compare/v4.5.9...v4.6.0) (2018-02-11)
|
||||
<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)
|
||||
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **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>
|
||||
## [4.6.3](https://github.com/QingWei-Li/docsify/compare/v4.6.2...v4.6.3) (2018-02-15)
|
||||
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<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)
|
||||
|
||||
|
||||
### 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:** init value ([890a7bf](https://github.com/QingWei-Li/docsify/commit/890a7bf))
|
||||
|
||||
|
||||
|
||||
<a name="4.6.1"></a>
|
||||
|
||||
## [4.6.1](https://github.com/QingWei-Li/docsify/compare/v4.6.0...v4.6.1) (2018-02-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **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)
|
||||
|
||||
<a name="4.6.0"></a>
|
||||
|
||||
# [4.6.0](https://github.com/QingWei-Li/docsify/compare/v4.5.9...v4.6.0) (2018-02-11)
|
||||
|
||||
### 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))
|
||||
@@ -15,7 +60,6 @@
|
||||
* 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))
|
||||
|
||||
|
||||
### 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))
|
||||
@@ -26,21 +70,17 @@
|
||||
* **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))
|
||||
|
||||
|
||||
|
||||
<a name="4.5.9"></a>
|
||||
## [4.5.9](https://github.com/QingWei-Li/docsify/compare/v4.5.8...v4.5.9) (2018-02-07)
|
||||
|
||||
## [4.5.9](https://github.com/QingWei-Li/docsify/compare/v4.5.8...v4.5.9) (2018-02-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade marked ([4157173](https://github.com/QingWei-Li/docsify/commit/4157173))
|
||||
|
||||
|
||||
|
||||
<a name="4.5.8"></a>
|
||||
## [4.5.8](https://github.com/QingWei-Li/docsify/compare/v4.5.6...v4.5.8) (2018-02-07)
|
||||
|
||||
## [4.5.8](https://github.com/QingWei-Li/docsify/compare/v4.5.6...v4.5.8) (2018-02-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -48,440 +88,360 @@
|
||||
* 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>
|
||||
## [4.5.7](https://github.com/QingWei-Li/docsify/compare/v4.5.6...v4.5.7) (2017-12-29)
|
||||
|
||||
## [4.5.7](https://github.com/QingWei-Li/docsify/compare/v4.5.6...v4.5.7) (2017-12-29)
|
||||
|
||||
### Features
|
||||
|
||||
* 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>
|
||||
## [4.5.6](https://github.com/QingWei-Li/docsify/compare/v4.5.3...v4.5.6) (2017-12-14)
|
||||
|
||||
## [4.5.6](https://github.com/QingWei-Li/docsify/compare/v4.5.3...v4.5.6) (2017-12-14)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.5.5"></a>
|
||||
## [4.5.5](https://github.com/QingWei-Li/docsify/compare/v4.5.4...v4.5.5) (2017-11-30)
|
||||
|
||||
## [4.5.5](https://github.com/QingWei-Li/docsify/compare/v4.5.4...v4.5.5) (2017-11-30)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
|
||||
<a name="4.5.4"></a>
|
||||
## [4.5.4](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.4) (2017-11-29)
|
||||
|
||||
## [4.5.4](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.4) (2017-11-29)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 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>
|
||||
## [4.5.3](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.3) (2017-11-11)
|
||||
|
||||
## [4.5.3](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.3) (2017-11-11)
|
||||
|
||||
### Features
|
||||
|
||||
* 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>
|
||||
## [4.5.2](https://github.com/QingWei-Li/docsify/compare/v4.5.1...v4.5.2) (2017-11-09)
|
||||
|
||||
## [4.5.2](https://github.com/QingWei-Li/docsify/compare/v4.5.1...v4.5.2) (2017-11-09)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.5.1"></a>
|
||||
## [4.5.1](https://github.com/QingWei-Li/docsify/compare/v4.5.0...v4.5.1) (2017-11-07)
|
||||
|
||||
## [4.5.1](https://github.com/QingWei-Li/docsify/compare/v4.5.0...v4.5.1) (2017-11-07)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.5.0"></a>
|
||||
# [4.5.0](https://github.com/QingWei-Li/docsify/compare/v4.4.1...v4.5.0) (2017-11-04)
|
||||
|
||||
# [4.5.0](https://github.com/QingWei-Li/docsify/compare/v4.4.1...v4.5.0) (2017-11-04)
|
||||
|
||||
### Features
|
||||
|
||||
* 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>
|
||||
## [4.4.1](https://github.com/QingWei-Li/docsify/compare/v4.4.0...v4.4.1) (2017-10-31)
|
||||
|
||||
## [4.4.1](https://github.com/QingWei-Li/docsify/compare/v4.4.0...v4.4.1) (2017-10-31)
|
||||
|
||||
### 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))
|
||||
* 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>
|
||||
# [4.4.0](https://github.com/QingWei-Li/docsify/compare/v4.3.15...v4.4.0) (2017-10-30)
|
||||
|
||||
# [4.4.0](https://github.com/QingWei-Li/docsify/compare/v4.3.15...v4.4.0) (2017-10-30)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.15"></a>
|
||||
## [4.3.15](https://github.com/QingWei-Li/docsify/compare/v4.3.14...v4.3.15) (2017-10-20)
|
||||
|
||||
## [4.3.15](https://github.com/QingWei-Li/docsify/compare/v4.3.14...v4.3.15) (2017-10-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* scroll active sidebar ([a2b8eae](https://github.com/QingWei-Li/docsify/commit/a2b8eae))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.14"></a>
|
||||
## [4.3.14](https://github.com/QingWei-Li/docsify/compare/v4.3.13...v4.3.14) (2017-10-20)
|
||||
|
||||
## [4.3.14](https://github.com/QingWei-Li/docsify/compare/v4.3.13...v4.3.14) (2017-10-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* codesponsor style ([ab68268](https://github.com/QingWei-Li/docsify/commit/ab68268))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.13"></a>
|
||||
## [4.3.13](https://github.com/QingWei-Li/docsify/compare/v4.3.12...v4.3.13) (2017-10-17)
|
||||
|
||||
## [4.3.13](https://github.com/QingWei-Li/docsify/compare/v4.3.12...v4.3.13) (2017-10-17)
|
||||
|
||||
### 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
|
||||
|
||||
* 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>
|
||||
## [4.3.12](https://github.com/QingWei-Li/docsify/compare/v4.3.11...v4.3.12) (2017-10-15)
|
||||
|
||||
## [4.3.12](https://github.com/QingWei-Li/docsify/compare/v4.3.11...v4.3.12) (2017-10-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 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>
|
||||
## [4.3.11](https://github.com/QingWei-Li/docsify/compare/v4.3.10...v4.3.11) (2017-10-15)
|
||||
|
||||
## [4.3.11](https://github.com/QingWei-Li/docsify/compare/v4.3.10...v4.3.11) (2017-10-15)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.10"></a>
|
||||
## [4.3.10](https://github.com/QingWei-Li/docsify/compare/v4.3.9...v4.3.10) (2017-10-12)
|
||||
|
||||
## [4.3.10](https://github.com/QingWei-Li/docsify/compare/v4.3.9...v4.3.10) (2017-10-12)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.9"></a>
|
||||
## [4.3.9](https://github.com/QingWei-Li/docsify/compare/v4.3.8...v4.3.9) (2017-10-11)
|
||||
|
||||
## [4.3.9](https://github.com/QingWei-Li/docsify/compare/v4.3.8...v4.3.9) (2017-10-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 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>
|
||||
## [4.3.8](https://github.com/QingWei-Li/docsify/compare/v4.3.7...v4.3.8) (2017-10-07)
|
||||
|
||||
## [4.3.8](https://github.com/QingWei-Li/docsify/compare/v4.3.7...v4.3.8) (2017-10-07)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.7"></a>
|
||||
## [4.3.7](https://github.com/QingWei-Li/docsify/compare/v4.3.6...v4.3.7) (2017-10-02)
|
||||
|
||||
## [4.3.7](https://github.com/QingWei-Li/docsify/compare/v4.3.6...v4.3.7) (2017-10-02)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.6"></a>
|
||||
## [4.3.6](https://github.com/QingWei-Li/docsify/compare/v4.3.5...v4.3.6) (2017-09-21)
|
||||
|
||||
## [4.3.6](https://github.com/QingWei-Li/docsify/compare/v4.3.5...v4.3.6) (2017-09-21)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* style for codesponsor plugin ([08afec7](https://github.com/QingWei-Li/docsify/commit/08afec7))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.5"></a>
|
||||
## [4.3.5](https://github.com/QingWei-Li/docsify/compare/v4.3.4...v4.3.5) (2017-09-20)
|
||||
|
||||
## [4.3.5](https://github.com/QingWei-Li/docsify/compare/v4.3.4...v4.3.5) (2017-09-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* missed symbol ([#254](https://github.com/QingWei-Li/docsify/issues/254)) ([6c702d3](https://github.com/QingWei-Li/docsify/commit/6c702d3))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **plugin:** add codesponsor plugin ([46ac4c3](https://github.com/QingWei-Li/docsify/commit/46ac4c3))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.4"></a>
|
||||
## [4.3.4](https://github.com/QingWei-Li/docsify/compare/v4.3.3...v4.3.4) (2017-09-07)
|
||||
|
||||
## [4.3.4](https://github.com/QingWei-Li/docsify/compare/v4.3.3...v4.3.4) (2017-09-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 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>
|
||||
## [4.3.3](https://github.com/QingWei-Li/docsify/compare/v4.3.2...v4.3.3) (2017-09-06)
|
||||
|
||||
## [4.3.3](https://github.com/QingWei-Li/docsify/compare/v4.3.2...v4.3.3) (2017-09-06)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.2"></a>
|
||||
## [4.3.2](https://github.com/QingWei-Li/docsify/compare/v4.3.1...v4.3.2) (2017-09-01)
|
||||
|
||||
## [4.3.2](https://github.com/QingWei-Li/docsify/compare/v4.3.1...v4.3.2) (2017-09-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* sidebar highlight ([f82f419](https://github.com/QingWei-Li/docsify/commit/f82f419))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 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>
|
||||
|
||||
## [4.3.1](https://github.com/QingWei-Li/docsify/compare/v4.2.9...v4.3.1) (2017-08-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **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>
|
||||
# [4.3.0](https://github.com/QingWei-Li/docsify/compare/v4.2.9...v4.3.0) (2017-08-17)
|
||||
|
||||
# [4.3.0](https://github.com/QingWei-Li/docsify/compare/v4.2.9...v4.3.0) (2017-08-17)
|
||||
|
||||
### Features
|
||||
|
||||
* **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>
|
||||
## [4.2.9](https://github.com/QingWei-Li/docsify/compare/v4.2.8...v4.2.9) (2017-08-15)
|
||||
|
||||
## [4.2.9](https://github.com/QingWei-Li/docsify/compare/v4.2.8...v4.2.9) (2017-08-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ensure document ready before init Docsify [#233](https://github.com/QingWei-Li/docsify/issues/233)
|
||||
|
||||
<a name="4.2.8"></a>
|
||||
## [4.2.8](https://github.com/QingWei-Li/docsify/compare/v4.2.7...v4.2.8) (2017-08-10)
|
||||
|
||||
## [4.2.8](https://github.com/QingWei-Li/docsify/compare/v4.2.7...v4.2.8) (2017-08-10)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.2.7"></a>
|
||||
## [4.2.7](https://github.com/QingWei-Li/docsify/compare/v4.2.4...v4.2.7) (2017-08-05)
|
||||
|
||||
## [4.2.7](https://github.com/QingWei-Li/docsify/compare/v4.2.4...v4.2.7) (2017-08-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **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))
|
||||
|
||||
|
||||
|
||||
<a name="4.2.6"></a>
|
||||
## [4.2.6](https://github.com/QingWei-Li/docsify/compare/v4.2.4...v4.2.6) (2017-07-27)
|
||||
|
||||
## [4.2.6](https://github.com/QingWei-Li/docsify/compare/v4.2.4...v4.2.6) (2017-07-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **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))
|
||||
|
||||
|
||||
|
||||
<a name="4.2.4"></a>
|
||||
## [4.2.4](https://github.com/QingWei-Li/docsify/compare/v4.2.2...v4.2.4) (2017-07-26)
|
||||
|
||||
## [4.2.4](https://github.com/QingWei-Li/docsify/compare/v4.2.2...v4.2.4) (2017-07-26)
|
||||
|
||||
### 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))
|
||||
|
||||
<a name="4.2.3"></a>
|
||||
## [4.2.3](https://github.com/QingWei-Li/docsify/compare/v4.2.2...v4.2.3) (2017-07-26)
|
||||
|
||||
## [4.2.3](https://github.com/QingWei-Li/docsify/compare/v4.2.2...v4.2.3) (2017-07-26)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.2.2"></a>
|
||||
## [4.2.2](https://github.com/QingWei-Li/docsify/compare/v4.2.1...v4.2.2) (2017-07-24)
|
||||
|
||||
## [4.2.2](https://github.com/QingWei-Li/docsify/compare/v4.2.1...v4.2.2) (2017-07-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* style rerender due to setting themeColor ([17ff3d1](https://github.com/QingWei-Li/docsify/commit/17ff3d1))
|
||||
|
||||
|
||||
|
||||
<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)
|
||||
|
||||
- give the navbar some line-height (#216)
|
||||
- Remove unnecessary moduleName option from rollup config for plugins (#209)
|
||||
* give the navbar some line-height (#216)
|
||||
* Remove unnecessary moduleName option from rollup config for plugins (#209)
|
||||
|
||||
<a name="4.2.0"></a>
|
||||
# [4.2.0](https://github.com/QingWei-Li/docsify/compare/v4.1.14...v4.2.0) (2017-07-10)
|
||||
|
||||
# [4.2.0](https://github.com/QingWei-Li/docsify/compare/v4.1.14...v4.2.0) (2017-07-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* not found page ([9af8559](https://github.com/QingWei-Li/docsify/commit/9af8559))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.14"></a>
|
||||
## [4.1.14](https://github.com/QingWei-Li/docsify/compare/v4.1.13...v4.1.14) (2017-06-24)
|
||||
|
||||
## [4.1.14](https://github.com/QingWei-Li/docsify/compare/v4.1.13...v4.1.14) (2017-06-24)
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 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>
|
||||
|
||||
## [4.1.13](https://github.com/QingWei-Li/docsify/compare/v4.1.12...v4.1.13) (2017-06-11)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.12"></a>
|
||||
## [4.1.12](https://github.com/QingWei-Li/docsify/compare/v4.1.11...v4.1.12) (2017-06-03)
|
||||
|
||||
## [4.1.12](https://github.com/QingWei-Li/docsify/compare/v4.1.11...v4.1.12) (2017-06-03)
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.11"></a>
|
||||
## [4.1.11](https://github.com/QingWei-Li/docsify/compare/v4.1.10...v4.1.11) (2017-06-02)
|
||||
|
||||
## [4.1.11](https://github.com/QingWei-Li/docsify/compare/v4.1.10...v4.1.11) (2017-06-02)
|
||||
|
||||
### 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))
|
||||
* **render:** autoHeader does not work ([1304d2e](https://github.com/QingWei-Li/docsify/commit/1304d2e))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.10"></a>
|
||||
## [4.1.10](https://github.com/QingWei-Li/docsify/compare/v4.1.9...v4.1.10) (2017-06-02)
|
||||
|
||||
## [4.1.10](https://github.com/QingWei-Li/docsify/compare/v4.1.9...v4.1.10) (2017-06-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **hash:** hash routing crashes when url has querystring ([6d48ce1](https://github.com/QingWei-Li/docsify/commit/6d48ce1))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.9"></a>
|
||||
## [4.1.9](https://github.com/QingWei-Li/docsify/compare/v4.1.8...v4.1.9) (2017-05-31)
|
||||
|
||||
## [4.1.9](https://github.com/QingWei-Li/docsify/compare/v4.1.8...v4.1.9) (2017-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -489,136 +449,109 @@
|
||||
* **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))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.8"></a>
|
||||
## [4.1.8](https://github.com/QingWei-Li/docsify/compare/v4.1.7...v4.1.8) (2017-05-31)
|
||||
|
||||
## [4.1.8](https://github.com/QingWei-Li/docsify/compare/v4.1.7...v4.1.8) (2017-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 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))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.7"></a>
|
||||
## [4.1.7](https://github.com/QingWei-Li/docsify/compare/v4.1.6...v4.1.7) (2017-05-30)
|
||||
|
||||
## [4.1.7](https://github.com/QingWei-Li/docsify/compare/v4.1.6...v4.1.7) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** clean files ([0014895](https://github.com/QingWei-Li/docsify/commit/0014895))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.6"></a>
|
||||
## [4.1.6](https://github.com/QingWei-Li/docsify/compare/v4.1.5...v4.1.6) (2017-05-30)
|
||||
|
||||
## [4.1.6](https://github.com/QingWei-Li/docsify/compare/v4.1.5...v4.1.6) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** add debug ([6b9e092](https://github.com/QingWei-Li/docsify/commit/6b9e092))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.5"></a>
|
||||
## [4.1.5](https://github.com/QingWei-Li/docsify/compare/v4.1.4...v4.1.5) (2017-05-30)
|
||||
|
||||
## [4.1.5](https://github.com/QingWei-Li/docsify/compare/v4.1.4...v4.1.5) (2017-05-30)
|
||||
|
||||
### 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>
|
||||
## [4.1.4](https://github.com/QingWei-Li/docsify/compare/v4.1.3...v4.1.4) (2017-05-30)
|
||||
|
||||
## [4.1.4](https://github.com/QingWei-Li/docsify/compare/v4.1.3...v4.1.4) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** file path ([79a83bc](https://github.com/QingWei-Li/docsify/commit/79a83bc))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.3"></a>
|
||||
## [4.1.3](https://github.com/QingWei-Li/docsify/compare/v4.1.2...v4.1.3) (2017-05-30)
|
||||
|
||||
## [4.1.3](https://github.com/QingWei-Li/docsify/compare/v4.1.2...v4.1.3) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update babel config ([9825db4](https://github.com/QingWei-Li/docsify/commit/9825db4))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.2"></a>
|
||||
## [4.1.2](https://github.com/QingWei-Li/docsify/compare/v4.1.1...v4.1.2) (2017-05-30)
|
||||
|
||||
## [4.1.2](https://github.com/QingWei-Li/docsify/compare/v4.1.1...v4.1.2) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update babel config ([80dba19](https://github.com/QingWei-Li/docsify/commit/80dba19))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.1"></a>
|
||||
## [4.1.1](https://github.com/QingWei-Li/docsify/compare/v4.1.0...v4.1.1) (2017-05-30)
|
||||
|
||||
## [4.1.1](https://github.com/QingWei-Li/docsify/compare/v4.1.0...v4.1.1) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 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))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
|
||||
# [4.1.0](https://github.com/QingWei-Li/docsify/compare/v4.0.2...v4.1.0) (2017-05-30)
|
||||
|
||||
|
||||
|
||||
<a name="4.0.2"></a>
|
||||
## [4.0.2](https://github.com/QingWei-Li/docsify/compare/v4.0.1...v4.0.2) (2017-05-30)
|
||||
|
||||
## [4.0.2](https://github.com/QingWei-Li/docsify/compare/v4.0.1...v4.0.2) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* basePath for history mode ([fc1cd3f](https://github.com/QingWei-Li/docsify/commit/fc1cd3f))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.1"></a>
|
||||
## [4.0.1](https://github.com/QingWei-Li/docsify/compare/v4.0.0...v4.0.1) (2017-05-29)
|
||||
|
||||
## [4.0.1](https://github.com/QingWei-Li/docsify/compare/v4.0.0...v4.0.1) (2017-05-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** remove context ([4626157](https://github.com/QingWei-Li/docsify/commit/4626157))
|
||||
* lint ([b764b6e](https://github.com/QingWei-Li/docsify/commit/b764b6e))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
# [4.0.0](https://github.com/QingWei-Li/docsify/compare/v3.7.3...v4.0.0) (2017-05-29)
|
||||
|
||||
# [4.0.0](https://github.com/QingWei-Li/docsify/compare/v3.7.3...v4.0.0) (2017-05-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **render:** init event in ssr ([eba1c98](https://github.com/QingWei-Li/docsify/commit/eba1c98))
|
||||
* lint ([1f4514d](https://github.com/QingWei-Li/docsify/commit/1f4514d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* finish ssr ([3444884](https://github.com/QingWei-Li/docsify/commit/3444884))
|
||||
* 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))
|
||||
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
* Useful plugin API
|
||||
* Compatible with IE10+
|
||||
* Support SSR ([example](https://github.com/QingWei-Li/docsify-ssr-demo))
|
||||
* Support embedded files
|
||||
|
||||
## Quick start
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# docsify <small>4.6.0</small>
|
||||
# docsify <small>4.6.4</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
* [Vue compatibility](vue.md)
|
||||
* [CDN](cdn.md)
|
||||
* [Offline Mode(PWA)](pwa.md)
|
||||
* [Server-client renderer(SSR)](ssr.md)
|
||||
* [Server-Side Rendering(SSR)](ssr.md)
|
||||
* [Embed Files <sup style="color:red">(new)<sup>](embed-files.md)
|
||||
|
||||
* [Awesome docsify](awesome.md)
|
||||
|
||||
+23
-1
@@ -380,7 +380,7 @@ window.$docsify = {
|
||||
|
||||
* type: `Boolean`
|
||||
|
||||
Only coverpage is loaded when When visiting the home page.
|
||||
Only coverpage is loaded when visiting the home page.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -413,3 +413,25 @@ window.$docsify = {
|
||||
ext: '.md'
|
||||
};
|
||||
```
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
|
||||
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
|
||||
|
||||
Example:
|
||||
|
||||
- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
|
||||
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
|
||||
- then display 404 page.
|
||||
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
fallbackLanguages: [
|
||||
"fr",
|
||||
"de"
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* [Vue Kompatibilität](de-de/vue.md)
|
||||
* [CDN](de-de/cdn.md)
|
||||
* [Offline Modus (PWA)](de-de/pwa.md)
|
||||
* [Server-client renderer (SSR)](de-de/ssr.md)
|
||||
* [Server-Side Rendering (SSR)](de-de/ssr.md)
|
||||
* [Embed Files <sup style="color:red">(new)<sup>](de-de/embed-files.md)
|
||||
|
||||
* [Awesome docsify](de-de/awesome.md)
|
||||
|
||||
@@ -401,3 +401,21 @@ window.$docsify = {
|
||||
ext: '.md'
|
||||
};
|
||||
```
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
|
||||
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
|
||||
|
||||
Example:
|
||||
|
||||
* try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
|
||||
* then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
|
||||
* then display 404 page.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
fallbackLanguages: ['fr', 'de']
|
||||
};
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Server client renderer
|
||||
# Server-Side Rendering
|
||||
|
||||
See https://docsify.now.sh
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Server client renderer
|
||||
# Server-Side Rendering
|
||||
|
||||
See https://docsify.now.sh
|
||||
|
||||
|
||||
@@ -413,3 +413,21 @@ window.$docsify = {
|
||||
ext: '.md'
|
||||
};
|
||||
```
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
|
||||
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
|
||||
|
||||
Example:
|
||||
|
||||
* try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
|
||||
* then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
|
||||
* then display 404 page.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
fallbackLanguages: ['fr', 'de']
|
||||
};
|
||||
```
|
||||
|
||||
+232
-81
@@ -5,8 +5,9 @@
|
||||
function cached (fn) {
|
||||
var cache = Object.create(null);
|
||||
return function cachedFn (str) {
|
||||
var hit = cache[str];
|
||||
return hit || (cache[str] = fn(str))
|
||||
var key = isPrimitive(str) ? str : JSON.stringify(str);
|
||||
var hit = cache[key];
|
||||
return hit || (cache[key] = fn(str))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2876,7 +2877,6 @@ var replaceSlug = cached(function (path) {
|
||||
});
|
||||
|
||||
var cachedLinks = {};
|
||||
var uid = 0;
|
||||
|
||||
function getAndRemoveConfig (str) {
|
||||
if ( str === void 0 ) str = '';
|
||||
@@ -2894,46 +2894,37 @@ function getAndRemoveConfig (str) {
|
||||
|
||||
return { str: str, config: config }
|
||||
}
|
||||
|
||||
var compileMedia = {
|
||||
markdown: function markdown (url) {
|
||||
var this$1 = this;
|
||||
|
||||
var id = "docsify-get-" + (uid++);
|
||||
|
||||
{
|
||||
get(url, false).then(function (text) {
|
||||
document.getElementById(id).innerHTML = this$1.compile(text);
|
||||
});
|
||||
|
||||
return ("<div data-origin=\"" + url + "\" id=" + id + "></div>")
|
||||
return {
|
||||
url: url
|
||||
}
|
||||
},
|
||||
iframe: function iframe (url, title) {
|
||||
return ("<iframe src=\"" + url + "\" " + (title || 'width=100% height=400') + "></iframe>")
|
||||
return {
|
||||
code: ("<iframe src=\"" + url + "\" " + (title || 'width=100% height=400') + "></iframe>")
|
||||
}
|
||||
},
|
||||
video: function video (url, title) {
|
||||
return ("<video src=\"" + url + "\" " + (title || 'controls') + ">Not Support</video>")
|
||||
return {
|
||||
code: ("<video src=\"" + url + "\" " + (title || 'controls') + ">Not Support</video>")
|
||||
}
|
||||
},
|
||||
audio: function audio (url, title) {
|
||||
return ("<audio src=\"" + url + "\" " + (title || 'controls') + ">Not Support</audio>")
|
||||
return {
|
||||
code: ("<audio src=\"" + url + "\" " + (title || 'controls') + ">Not Support</audio>")
|
||||
}
|
||||
},
|
||||
code: function code (url, title) {
|
||||
var this$1 = this;
|
||||
var lang = url.match(/\.(\w+)$/);
|
||||
|
||||
var id = "docsify-get-" + (uid++);
|
||||
var ext = url.match(/\.(\w+)$/);
|
||||
lang = title || (lang && lang[1]);
|
||||
if (lang === 'md') { lang = 'markdown'; }
|
||||
|
||||
ext = title || (ext && ext[1]);
|
||||
if (ext === 'md') { ext = 'markdown'; }
|
||||
|
||||
{
|
||||
get(url, false).then(function (text) {
|
||||
document.getElementById(id).innerHTML = this$1.compile(
|
||||
'```' + ext + '\n' + text.replace(/`/g, '@qm@') + '\n```\n'
|
||||
).replace(/@qm@/g, '`');
|
||||
});
|
||||
|
||||
return ("<div data-origin=\"" + url + "\" id=" + id + "></div>")
|
||||
return {
|
||||
url: url,
|
||||
lang: lang
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2961,12 +2952,18 @@ var Compiler = function Compiler (config, router) {
|
||||
compile = marked;
|
||||
}
|
||||
|
||||
this._marked = compile;
|
||||
this.compile = cached(function (text) {
|
||||
var html = '';
|
||||
|
||||
if (!text) { return text }
|
||||
|
||||
html = compile(text);
|
||||
if (isPrimitive(text)) {
|
||||
html = compile(text);
|
||||
} else {
|
||||
html = compile.parser(text);
|
||||
}
|
||||
|
||||
html = config.noEmoji ? html : emojify(html);
|
||||
slugify.clear();
|
||||
|
||||
@@ -2974,7 +2971,42 @@ var Compiler = function Compiler (config, router) {
|
||||
});
|
||||
};
|
||||
|
||||
Compiler.prototype.matchNotCompileLink = function matchNotCompileLink (link) {
|
||||
Compiler.prototype.compileEmbed = function compileEmbed (href, title) {
|
||||
var ref = getAndRemoveConfig(title);
|
||||
var str = ref.str;
|
||||
var config = ref.config;
|
||||
var embed;
|
||||
title = str;
|
||||
|
||||
if (config.include) {
|
||||
if (!isAbsolutePath(href)) {
|
||||
href = getPath(this.contentBase, href);
|
||||
}
|
||||
|
||||
var media;
|
||||
if (config.type && (media = compileMedia[config.type])) {
|
||||
embed = media.call(this, href, title);
|
||||
embed.type = config.type;
|
||||
} else {
|
||||
var type = 'code';
|
||||
if (/\.(md|markdown)/.test(href)) {
|
||||
type = 'markdown';
|
||||
} else if (/\.html?/.test(href)) {
|
||||
type = 'iframe';
|
||||
} else if (/\.(mp4|ogg)/.test(href)) {
|
||||
type = 'video';
|
||||
} else if (/\.mp3/.test(href)) {
|
||||
type = 'audio';
|
||||
}
|
||||
embed = compileMedia[type].call(this, href, title);
|
||||
embed.type = type;
|
||||
}
|
||||
|
||||
return embed
|
||||
}
|
||||
};
|
||||
|
||||
Compiler.prototype._matchNotCompileLink = function _matchNotCompileLink (link) {
|
||||
var links = this.config.noCompileLinks || [];
|
||||
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
@@ -3026,6 +3058,7 @@ Compiler.prototype._initRenderer = function _initRenderer () {
|
||||
origin.code = renderer.code = function (code, lang) {
|
||||
if ( lang === void 0 ) lang = '';
|
||||
|
||||
code = code.replace(/@DOCSIFY_QM@/g, '`');
|
||||
var hl = prism.highlight(
|
||||
code,
|
||||
prism.languages[lang] || prism.languages.markup
|
||||
@@ -3043,33 +3076,9 @@ Compiler.prototype._initRenderer = function _initRenderer () {
|
||||
var config = ref.config;
|
||||
title = str;
|
||||
|
||||
if (config.include) {
|
||||
if (!isAbsolutePath(href)) {
|
||||
href = getPath(contentBase, href);
|
||||
}
|
||||
|
||||
var media;
|
||||
if (config.type && (media = compileMedia[config.type])) {
|
||||
return media.call(_self, href, title)
|
||||
}
|
||||
|
||||
var type = 'code';
|
||||
if (/\.(md|markdown)/.test(href)) {
|
||||
type = 'markdown';
|
||||
} else if (/\.html?/.test(href)) {
|
||||
type = 'iframe';
|
||||
} else if (/\.(mp4|ogg)/.test(href)) {
|
||||
type = 'video';
|
||||
} else if (/\.mp3/.test(href)) {
|
||||
type = 'audio';
|
||||
}
|
||||
|
||||
return compileMedia[type].call(_self, href, title)
|
||||
}
|
||||
|
||||
if (
|
||||
!/:|(\/{2})/.test(href) &&
|
||||
!_self.matchNotCompileLink(href) &&
|
||||
!_self._matchNotCompileLink(href) &&
|
||||
!config.ignore
|
||||
) {
|
||||
if (href === _self.config.homepage) { href = 'README'; }
|
||||
@@ -3508,6 +3517,105 @@ function scroll2Top (offset) {
|
||||
scrollEl.scrollTop = offset === true ? 0 : Number(offset);
|
||||
}
|
||||
|
||||
var cached$1 = {};
|
||||
|
||||
function walkFetchEmbed (ref, cb) {
|
||||
var step = ref.step; if ( step === void 0 ) step = 0;
|
||||
var embedTokens = ref.embedTokens;
|
||||
var compile = ref.compile;
|
||||
var fetch = ref.fetch;
|
||||
|
||||
var token = embedTokens[step];
|
||||
|
||||
if (!token) {
|
||||
return cb({})
|
||||
}
|
||||
|
||||
var next = function (text) {
|
||||
var embedToken;
|
||||
if (text) {
|
||||
if (token.embed.type === 'markdown') {
|
||||
embedToken = compile.lexer(text);
|
||||
} else if (token.embed.type === 'code') {
|
||||
embedToken = compile.lexer(
|
||||
'```' +
|
||||
token.embed.lang +
|
||||
'\n' +
|
||||
text.replace(/`/g, '@DOCSIFY_QM@') +
|
||||
'\n```\n'
|
||||
);
|
||||
}
|
||||
}
|
||||
cb({ token: token, embedToken: embedToken });
|
||||
walkFetchEmbed({ step: ++step, compile: compile, embedTokens: embedTokens, fetch: fetch }, cb);
|
||||
};
|
||||
|
||||
{
|
||||
get(token.embed.url).then(next);
|
||||
}
|
||||
}
|
||||
|
||||
function prerenderEmbed (ref, done) {
|
||||
var compiler = ref.compiler;
|
||||
var raw = ref.raw; if ( raw === void 0 ) raw = '';
|
||||
var fetch = ref.fetch;
|
||||
|
||||
var hit;
|
||||
if ((hit = cached$1[raw])) {
|
||||
return done(hit)
|
||||
}
|
||||
|
||||
var compile = compiler._marked;
|
||||
var tokens = compile.lexer(raw);
|
||||
var embedTokens = [];
|
||||
var linkRE = compile.InlineLexer.rules.link;
|
||||
var links = tokens.links;
|
||||
|
||||
tokens.forEach(function (token, index) {
|
||||
if (token.type === 'paragraph') {
|
||||
token.text = token.text.replace(
|
||||
new RegExp(linkRE.source, 'g'),
|
||||
function (src, filename, href, title) {
|
||||
var embed = compiler.compileEmbed(href, title);
|
||||
|
||||
if (embed) {
|
||||
if (embed.type === 'markdown' || embed.type === 'code') {
|
||||
embedTokens.push({
|
||||
index: index,
|
||||
embed: embed
|
||||
});
|
||||
}
|
||||
return embed.code
|
||||
}
|
||||
|
||||
return src
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var moveIndex = 0;
|
||||
walkFetchEmbed({ compile: compile, embedTokens: embedTokens, fetch: fetch }, function (ref) {
|
||||
var embedToken = ref.embedToken;
|
||||
var token = ref.token;
|
||||
|
||||
if (token) {
|
||||
var index = token.index + moveIndex;
|
||||
|
||||
merge(links, embedToken.links);
|
||||
|
||||
tokens = tokens
|
||||
.slice(0, index)
|
||||
.concat(embedToken, tokens.slice(index + 1));
|
||||
moveIndex += embedToken.length - 1;
|
||||
} else {
|
||||
cached$1[raw] = tokens.concat();
|
||||
tokens.links = cached$1[raw].links = links;
|
||||
done(tokens);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function executeScript () {
|
||||
var script = findAll('.markdown-section>script')
|
||||
.filter(function (s) { return !/template/.test(s.type); })[0];
|
||||
@@ -3621,7 +3729,7 @@ function renderMixin (proto) {
|
||||
getAndActive(this.router, 'nav');
|
||||
};
|
||||
|
||||
proto._renderMain = function (text, opt) {
|
||||
proto._renderMain = function (text, opt, next) {
|
||||
var this$1 = this;
|
||||
if ( opt === void 0 ) opt = {};
|
||||
|
||||
@@ -3630,12 +3738,31 @@ function renderMixin (proto) {
|
||||
}
|
||||
|
||||
callHook(this, 'beforeEach', text, function (result) {
|
||||
var html = this$1.isHTML ? result : this$1.compiler.compile(result);
|
||||
if (opt.updatedAt) {
|
||||
html = formatUpdated(html, opt.updatedAt, this$1.config.formatUpdated);
|
||||
}
|
||||
var html;
|
||||
var callback = function () {
|
||||
if (opt.updatedAt) {
|
||||
html = formatUpdated(html, opt.updatedAt, this$1.config.formatUpdated);
|
||||
}
|
||||
|
||||
callHook(this$1, 'afterEach', html, function (text) { return renderMain.call(this$1, text); });
|
||||
callHook(this$1, 'afterEach', html, function (text) { return renderMain.call(this$1, text); });
|
||||
};
|
||||
if (this$1.isHTML) {
|
||||
html = this$1.result = text;
|
||||
callback();
|
||||
next();
|
||||
} else {
|
||||
prerenderEmbed(
|
||||
{
|
||||
compiler: this$1.compiler,
|
||||
raw: result
|
||||
},
|
||||
function (tokens) {
|
||||
html = this$1.compiler.compile(tokens);
|
||||
callback();
|
||||
next();
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -3736,16 +3863,16 @@ function initRender (vm) {
|
||||
toggleClass(body, 'ready');
|
||||
}
|
||||
|
||||
var cached$1 = {};
|
||||
var cached$2 = {};
|
||||
|
||||
function getAlias (path, alias, last) {
|
||||
var match = Object.keys(alias).filter(function (key) {
|
||||
var re = cached$1[key] || (cached$1[key] = new RegExp(("^" + key + "$")));
|
||||
var re = cached$2[key] || (cached$2[key] = new RegExp(("^" + key + "$")));
|
||||
return re.test(path) && path !== last
|
||||
})[0];
|
||||
|
||||
return match
|
||||
? getAlias(path.replace(cached$1[match], alias[match]), alias, path)
|
||||
? getAlias(path.replace(cached$2[match], alias[match]), alias, path)
|
||||
: path
|
||||
}
|
||||
|
||||
@@ -4050,14 +4177,39 @@ function fetchMixin (proto) {
|
||||
var loadNavbar = ref$1.loadNavbar;
|
||||
var loadSidebar = ref$1.loadSidebar;
|
||||
var requestHeaders = ref$1.requestHeaders;
|
||||
|
||||
var fallbackLanguages = ref$1.fallbackLanguages;
|
||||
// Abort last request
|
||||
last && last.abort && last.abort();
|
||||
|
||||
last = get(this.router.getFile(path) + qs, true, requestHeaders);
|
||||
var file = this.router.getFile(path);
|
||||
last = get(file + qs, true, requestHeaders);
|
||||
|
||||
// Current page is html
|
||||
this.isHTML = /\.html$/g.test(path);
|
||||
this.isHTML = /\.html$/g.test(file);
|
||||
|
||||
var getFallBackPage = function (file) {
|
||||
if (!fallbackLanguages) {
|
||||
return false
|
||||
}
|
||||
|
||||
var local = file.split('/')[1];
|
||||
|
||||
if (fallbackLanguages.indexOf(local) === -1) {
|
||||
return false
|
||||
}
|
||||
|
||||
file = file.replace(new RegExp(("^/" + local)), '');
|
||||
|
||||
return get(file + qs, true, requestHeaders)
|
||||
.then(
|
||||
function (text, opt) {
|
||||
this$1._renderMain(text, opt, loadSideAndNav);
|
||||
},
|
||||
function (_) {
|
||||
return this$1._renderMain(null, {}, loadSideAndNav)
|
||||
}
|
||||
)
|
||||
};
|
||||
|
||||
var loadSideAndNav = function () {
|
||||
if (!loadSidebar) { return cb() }
|
||||
@@ -4072,16 +4224,15 @@ function fetchMixin (proto) {
|
||||
};
|
||||
|
||||
// Load main content
|
||||
last.then(
|
||||
function (text, opt) {
|
||||
this$1._renderMain(text, opt);
|
||||
loadSideAndNav();
|
||||
},
|
||||
function (_) {
|
||||
this$1._renderMain(null);
|
||||
loadSideAndNav();
|
||||
}
|
||||
);
|
||||
last
|
||||
.then(
|
||||
function (text, opt) {
|
||||
this$1._renderMain(text, opt, loadSideAndNav);
|
||||
},
|
||||
function (_) {
|
||||
return getFallBackPage(file) || this$1._renderMain(null, {}, loadSideAndNav)
|
||||
}
|
||||
);
|
||||
|
||||
// Load nav
|
||||
loadNavbar &&
|
||||
@@ -4158,7 +4309,7 @@ function initFetch (vm) {
|
||||
var ref = vm.config;
|
||||
var loadSidebar = ref.loadSidebar;
|
||||
|
||||
// server-client renderer
|
||||
// Server-Side Rendering
|
||||
if (vm.rendered) {
|
||||
var activeEl = getAndActive(vm.router, '.sidebar-nav', true, true);
|
||||
if (loadSidebar && activeEl) {
|
||||
@@ -4254,7 +4405,7 @@ initGlobalAPI();
|
||||
/**
|
||||
* Version
|
||||
*/
|
||||
Docsify.version = '4.6.0';
|
||||
Docsify.version = '4.6.4';
|
||||
|
||||
/**
|
||||
* Run Docsify
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
+155
-48
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "4.6.0",
|
||||
"version": "4.6.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -150,14 +150,12 @@
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
||||
"dev": true
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
||||
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
|
||||
"dev": true
|
||||
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
|
||||
},
|
||||
"any-promise": {
|
||||
"version": "1.3.0",
|
||||
@@ -651,7 +649,6 @@
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "2.2.1",
|
||||
"escape-string-regexp": "1.0.5",
|
||||
@@ -663,16 +660,14 @@
|
||||
"supports-color": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
|
||||
"dev": true
|
||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
|
||||
}
|
||||
}
|
||||
},
|
||||
"chardet": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
|
||||
"integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
|
||||
"dev": true
|
||||
"integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I="
|
||||
},
|
||||
"chokidar": {
|
||||
"version": "1.7.0",
|
||||
@@ -748,7 +743,6 @@
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
|
||||
"integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"restore-cursor": "2.0.0"
|
||||
}
|
||||
@@ -756,8 +750,7 @@
|
||||
"cli-width": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz",
|
||||
"integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=",
|
||||
"dev": true
|
||||
"integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao="
|
||||
},
|
||||
"clipboard": {
|
||||
"version": "1.7.1",
|
||||
@@ -1156,8 +1149,7 @@
|
||||
"core-js": {
|
||||
"version": "2.5.3",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz",
|
||||
"integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=",
|
||||
"dev": true
|
||||
"integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4="
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
@@ -1629,6 +1621,14 @@
|
||||
"integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=",
|
||||
"dev": true
|
||||
},
|
||||
"encoding": {
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
|
||||
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
|
||||
"requires": {
|
||||
"iconv-lite": "0.4.19"
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
|
||||
@@ -1653,8 +1653,7 @@
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
||||
"dev": true
|
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
|
||||
},
|
||||
"eslint": {
|
||||
"version": "4.14.0",
|
||||
@@ -1917,7 +1916,6 @@
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz",
|
||||
"integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chardet": "0.4.2",
|
||||
"iconv-lite": "0.4.19",
|
||||
@@ -1963,7 +1961,6 @@
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
|
||||
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"escape-string-regexp": "1.0.5"
|
||||
}
|
||||
@@ -3273,7 +3270,6 @@
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
|
||||
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "2.1.1"
|
||||
}
|
||||
@@ -3337,8 +3333,7 @@
|
||||
"iconv-lite": {
|
||||
"version": "0.4.19",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
|
||||
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
|
||||
},
|
||||
"ignore": {
|
||||
"version": "3.3.7",
|
||||
@@ -3678,8 +3673,7 @@
|
||||
"is-promise": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
|
||||
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
|
||||
"dev": true
|
||||
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o="
|
||||
},
|
||||
"is-redirect": {
|
||||
"version": "1.0.0",
|
||||
@@ -3702,8 +3696,7 @@
|
||||
"is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
|
||||
"dev": true
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
||||
},
|
||||
"is-subset": {
|
||||
"version": "0.1.1",
|
||||
@@ -4192,8 +4185,7 @@
|
||||
"lodash": {
|
||||
"version": "4.17.4",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
|
||||
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=",
|
||||
"dev": true
|
||||
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
|
||||
},
|
||||
"lodash._reinterpolate": {
|
||||
"version": "3.0.0",
|
||||
@@ -4406,8 +4398,7 @@
|
||||
"mimic-fn": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz",
|
||||
"integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=",
|
||||
"dev": true
|
||||
"integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
@@ -4454,8 +4445,7 @@
|
||||
"mute-stream": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
|
||||
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
|
||||
"dev": true
|
||||
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s="
|
||||
},
|
||||
"mz": {
|
||||
"version": "2.7.0",
|
||||
@@ -4481,6 +4471,15 @@
|
||||
"integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
|
||||
"dev": true
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz",
|
||||
"integrity": "sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=",
|
||||
"requires": {
|
||||
"encoding": "0.1.12",
|
||||
"is-stream": "1.1.0"
|
||||
}
|
||||
},
|
||||
"nodemon": {
|
||||
"version": "1.14.7",
|
||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.14.7.tgz",
|
||||
@@ -4590,8 +4589,7 @@
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
|
||||
"dev": true
|
||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
||||
},
|
||||
"object.omit": {
|
||||
"version": "2.0.1",
|
||||
@@ -4625,11 +4623,119 @@
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
|
||||
"integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mimic-fn": "1.1.0"
|
||||
}
|
||||
},
|
||||
"opencollective": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz",
|
||||
"integrity": "sha1-ruY3K8KBRFg2kMPKja7PwSDdDvE=",
|
||||
"requires": {
|
||||
"babel-polyfill": "6.23.0",
|
||||
"chalk": "1.1.3",
|
||||
"inquirer": "3.0.6",
|
||||
"minimist": "1.2.0",
|
||||
"node-fetch": "1.6.3",
|
||||
"opn": "4.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-escapes": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz",
|
||||
"integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4="
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
|
||||
},
|
||||
"babel-polyfill": {
|
||||
"version": "6.23.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz",
|
||||
"integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=",
|
||||
"requires": {
|
||||
"babel-runtime": "6.26.0",
|
||||
"core-js": "2.5.3",
|
||||
"regenerator-runtime": "0.10.5"
|
||||
}
|
||||
},
|
||||
"babel-runtime": {
|
||||
"version": "6.26.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
|
||||
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
|
||||
"requires": {
|
||||
"core-js": "2.5.3",
|
||||
"regenerator-runtime": "0.11.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"regenerator-runtime": {
|
||||
"version": "0.11.1",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
|
||||
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"inquirer": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz",
|
||||
"integrity": "sha1-4EqqnQW3o8ubD0B9BDdfBEcZA0c=",
|
||||
"requires": {
|
||||
"ansi-escapes": "1.4.0",
|
||||
"chalk": "1.1.3",
|
||||
"cli-cursor": "2.1.0",
|
||||
"cli-width": "2.1.0",
|
||||
"external-editor": "2.1.0",
|
||||
"figures": "2.0.0",
|
||||
"lodash": "4.17.4",
|
||||
"mute-stream": "0.0.7",
|
||||
"run-async": "2.3.0",
|
||||
"rx": "4.1.0",
|
||||
"string-width": "2.1.1",
|
||||
"strip-ansi": "3.0.1",
|
||||
"through": "2.3.8"
|
||||
}
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
||||
},
|
||||
"string-width": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||
"requires": {
|
||||
"is-fullwidth-code-point": "2.0.0",
|
||||
"strip-ansi": "4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"strip-ansi": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||
"requires": {
|
||||
"ansi-regex": "3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"opn": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz",
|
||||
"integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=",
|
||||
"requires": {
|
||||
"object-assign": "4.1.1",
|
||||
"pinkie-promise": "2.0.1"
|
||||
}
|
||||
},
|
||||
"optimist": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
|
||||
@@ -4699,8 +4805,7 @@
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
|
||||
"dev": true
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||
},
|
||||
"p-finally": {
|
||||
"version": "1.0.0",
|
||||
@@ -4862,14 +4967,12 @@
|
||||
"pinkie": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
|
||||
"integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
|
||||
"dev": true
|
||||
"integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
|
||||
},
|
||||
"pinkie-promise": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
|
||||
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pinkie": "2.0.4"
|
||||
}
|
||||
@@ -7866,6 +7969,11 @@
|
||||
"balanced-match": "0.4.2"
|
||||
}
|
||||
},
|
||||
"regenerator-runtime": {
|
||||
"version": "0.10.5",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
|
||||
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
|
||||
},
|
||||
"regex-cache": {
|
||||
"version": "0.4.4",
|
||||
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
|
||||
@@ -7968,7 +8076,6 @@
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
|
||||
"integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"onetime": "2.0.1",
|
||||
"signal-exit": "3.0.2"
|
||||
@@ -8206,11 +8313,15 @@
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
|
||||
"integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-promise": "2.1.0"
|
||||
}
|
||||
},
|
||||
"rx": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
|
||||
"integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I="
|
||||
},
|
||||
"rx-lite": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz",
|
||||
@@ -8383,8 +8494,7 @@
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
|
||||
"dev": true
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
|
||||
},
|
||||
"slice-ansi": {
|
||||
"version": "1.0.0",
|
||||
@@ -8514,7 +8624,6 @@
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "2.1.1"
|
||||
}
|
||||
@@ -8767,8 +8876,7 @@
|
||||
"through": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
|
||||
"dev": true
|
||||
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
|
||||
},
|
||||
"through2": {
|
||||
"version": "2.0.3",
|
||||
@@ -8801,7 +8909,6 @@
|
||||
"version": "0.0.33",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
||||
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"os-tmpdir": "1.0.2"
|
||||
}
|
||||
|
||||
+8
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "4.6.0",
|
||||
"version": "4.6.4",
|
||||
"description": "A magical documentation generator.",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
@@ -21,9 +21,10 @@
|
||||
],
|
||||
"scripts": {
|
||||
"bootstrap": "npm i && lerna bootstrap && npm run build:ssr",
|
||||
"build": "rm -rf lib themes && node build/build && mkdir lib/themes && mkdir themes && node build/build-css && npm run build:ssr && node build/build-cover",
|
||||
"dev:build": "rm -rf lib themes && mkdir themes && node build/build --dev && node build/build-css --dev",
|
||||
"dev": "node app & nodemon -w src -e js,css --exec 'npm run dev:build'",
|
||||
"build": "rimraf lib themes && node build/build && mkdir lib/themes && mkdir themes && node build/build-css && npm run build:ssr && node build/build-cover",
|
||||
"dev:build": "rimraf lib themes && mkdir themes && node build/build --dev && node build/build-css --dev",
|
||||
"dev:watch": "nodemon -w ./src/ -e js,css --exec \"npm run dev:build\"",
|
||||
"dev": "concurrently \"node app\" \"npm run dev:watch\"",
|
||||
"build:ssr": "node build/build-ssr",
|
||||
"test": "eslint {src,packages} --fix",
|
||||
"pub:next": "RELEASE_TAG=next sh build/release.sh",
|
||||
@@ -32,13 +33,14 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"marked": "^0.3.12",
|
||||
"opencollective": "^1.0.3",
|
||||
"medium-zoom": "^0.3.0",
|
||||
"opencollective": "^1.0.3",
|
||||
"prismjs": "^1.9.0",
|
||||
"tinydate": "^1.0.0",
|
||||
"tweezer.js": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "^3.5.1",
|
||||
"conventional-changelog-cli": "^1.3.5",
|
||||
"cssnano": "^3.10.0",
|
||||
"eslint": "^4.14.0",
|
||||
@@ -48,6 +50,7 @@
|
||||
"nodemon": "^1.14.7",
|
||||
"postcss": "^5.2.16",
|
||||
"postcss-salad": "^1.0.8",
|
||||
"rimraf": "^2.6.2",
|
||||
"rollup": "^0.53.3",
|
||||
"rollup-plugin-async": "^1.2.0",
|
||||
"rollup-plugin-buble": "^0.18.0",
|
||||
|
||||
@@ -7,6 +7,7 @@ import { readFileSync } from 'fs'
|
||||
import { resolve, basename } from 'path'
|
||||
import resolvePathname from 'resolve-pathname'
|
||||
import debug from 'debug'
|
||||
import { prerenderEmbed } from '../../src/core/render/embed'
|
||||
|
||||
function cwd (...args) {
|
||||
return resolve(process.cwd(), ...args)
|
||||
@@ -61,7 +62,7 @@ export default class Renderer {
|
||||
const { loadSidebar, loadNavbar, coverpage } = this.config
|
||||
|
||||
const mainFile = this._getPath(url)
|
||||
this._renderHtml('main', await this._render(mainFile))
|
||||
this._renderHtml('main', await this._render(mainFile, 'main'))
|
||||
|
||||
if (loadSidebar) {
|
||||
const name = loadSidebar === true ? '_sidebar.md' : loadSidebar
|
||||
@@ -120,6 +121,19 @@ export default class Renderer {
|
||||
case 'cover':
|
||||
html = this.compiler.cover(html)
|
||||
break
|
||||
case 'main':
|
||||
const tokens = await new Promise(r => {
|
||||
prerenderEmbed(
|
||||
{
|
||||
fetch: url => this._loadFile(this._getPath(url)),
|
||||
compiler: this.compiler,
|
||||
raw: html
|
||||
},
|
||||
r
|
||||
)
|
||||
})
|
||||
html = this.compiler.compile(tokens)
|
||||
break
|
||||
case 'navbar':
|
||||
case 'article':
|
||||
default:
|
||||
|
||||
+1
-1
@@ -37,5 +37,5 @@
|
||||
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
||||
}
|
||||
},
|
||||
"version": "4.6.0"
|
||||
"version": "4.6.4"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify-server-renderer",
|
||||
"version": "4.6.0",
|
||||
"version": "4.6.4",
|
||||
"description": "docsify server renderer",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
|
||||
+38
-15
@@ -22,15 +22,39 @@ export function fetchMixin (proto) {
|
||||
proto._fetch = function (cb = noop) {
|
||||
const { path, query } = this.route
|
||||
const qs = stringifyQuery(query, ['id'])
|
||||
const { loadNavbar, loadSidebar, requestHeaders } = this.config
|
||||
|
||||
const { loadNavbar, loadSidebar, requestHeaders, fallbackLanguages } = this.config
|
||||
// Abort last request
|
||||
last && last.abort && last.abort()
|
||||
|
||||
last = get(this.router.getFile(path) + qs, true, requestHeaders)
|
||||
const file = this.router.getFile(path)
|
||||
last = get(file + qs, true, requestHeaders)
|
||||
|
||||
// Current page is html
|
||||
this.isHTML = /\.html$/g.test(path)
|
||||
this.isHTML = /\.html$/g.test(file)
|
||||
|
||||
const getFallBackPage = (file) => {
|
||||
if (!fallbackLanguages) {
|
||||
return false
|
||||
}
|
||||
|
||||
const local = file.split('/')[1]
|
||||
|
||||
if (fallbackLanguages.indexOf(local) === -1) {
|
||||
return false
|
||||
}
|
||||
|
||||
file = file.replace(new RegExp(`^/${local}`), '')
|
||||
|
||||
return get(file + qs, true, requestHeaders)
|
||||
.then(
|
||||
(text, opt) => {
|
||||
this._renderMain(text, opt, loadSideAndNav)
|
||||
},
|
||||
_ => {
|
||||
return this._renderMain(null, {}, loadSideAndNav)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const loadSideAndNav = () => {
|
||||
if (!loadSidebar) return cb()
|
||||
@@ -45,16 +69,15 @@ export function fetchMixin (proto) {
|
||||
}
|
||||
|
||||
// Load main content
|
||||
last.then(
|
||||
(text, opt) => {
|
||||
this._renderMain(text, opt)
|
||||
loadSideAndNav()
|
||||
},
|
||||
_ => {
|
||||
this._renderMain(null)
|
||||
loadSideAndNav()
|
||||
}
|
||||
)
|
||||
last
|
||||
.then(
|
||||
(text, opt) => {
|
||||
this._renderMain(text, opt, loadSideAndNav)
|
||||
},
|
||||
_ => {
|
||||
return getFallBackPage(file) || this._renderMain(null, {}, loadSideAndNav)
|
||||
}
|
||||
)
|
||||
|
||||
// Load nav
|
||||
loadNavbar &&
|
||||
@@ -123,7 +146,7 @@ export function fetchMixin (proto) {
|
||||
export function initFetch (vm) {
|
||||
const { loadSidebar } = vm.config
|
||||
|
||||
// server-client renderer
|
||||
// Server-Side Rendering
|
||||
if (vm.rendered) {
|
||||
const activeEl = getAndActive(vm.router, '.sidebar-nav', true, true)
|
||||
if (loadSidebar && activeEl) {
|
||||
|
||||
+63
-74
@@ -5,13 +5,11 @@ import { genTree } from './gen-tree'
|
||||
import { slugify } from './slugify'
|
||||
import { emojify } from './emojify'
|
||||
import { isAbsolutePath, getPath } from '../router/util'
|
||||
import { isFn, merge, cached } from '../util/core'
|
||||
import { get } from '../fetch/ajax'
|
||||
import { isFn, merge, cached, isPrimitive } from '../util/core'
|
||||
|
||||
const cachedLinks = {}
|
||||
let uid = 0
|
||||
|
||||
function getAndRemoveConfig (str = '') {
|
||||
export function getAndRemoveConfig (str = '') {
|
||||
const config = {}
|
||||
|
||||
if (str) {
|
||||
@@ -25,62 +23,37 @@ function getAndRemoveConfig (str = '') {
|
||||
|
||||
return { str, config }
|
||||
}
|
||||
|
||||
const compileMedia = {
|
||||
markdown (url) {
|
||||
const id = `docsify-get-${uid++}`
|
||||
|
||||
if (!process.env.SSR) {
|
||||
get(url, false).then(text => {
|
||||
document.getElementById(id).innerHTML = this.compile(text)
|
||||
})
|
||||
|
||||
return `<div data-origin="${url}" id=${id}></div>`
|
||||
} else {
|
||||
return `<div data-origin="${url}" id=${uid}></div>
|
||||
<script>
|
||||
var compile = window.__current_docsify_compiler__
|
||||
Docsify.get('${url}', false).then(function(text) {
|
||||
document.getElementById('${uid}').innerHTML = compile(text)
|
||||
})
|
||||
</script>`
|
||||
return {
|
||||
url
|
||||
}
|
||||
},
|
||||
iframe (url, title) {
|
||||
return `<iframe src="${url}" ${title || 'width=100% height=400'}></iframe>`
|
||||
return {
|
||||
code: `<iframe src="${url}" ${title || 'width=100% height=400'}></iframe>`
|
||||
}
|
||||
},
|
||||
video (url, title) {
|
||||
return `<video src="${url}" ${title || 'controls'}>Not Support</video>`
|
||||
return {
|
||||
code: `<video src="${url}" ${title || 'controls'}>Not Support</video>`
|
||||
}
|
||||
},
|
||||
audio (url, title) {
|
||||
return `<audio src="${url}" ${title || 'controls'}>Not Support</audio>`
|
||||
return {
|
||||
code: `<audio src="${url}" ${title || 'controls'}>Not Support</audio>`
|
||||
}
|
||||
},
|
||||
code (url, title) {
|
||||
const id = `docsify-get-${uid++}`
|
||||
let ext = url.match(/\.(\w+)$/)
|
||||
let lang = url.match(/\.(\w+)$/)
|
||||
|
||||
ext = title || (ext && ext[1])
|
||||
if (ext === 'md') ext = 'markdown'
|
||||
lang = title || (lang && lang[1])
|
||||
if (lang === 'md') lang = 'markdown'
|
||||
|
||||
if (!process.env.SSR) {
|
||||
get(url, false).then(text => {
|
||||
document.getElementById(id).innerHTML = this.compile(
|
||||
'```' + ext + '\n' + text.replace(/`/g, '@qm@') + '\n```\n'
|
||||
).replace(/@qm@/g, '`')
|
||||
})
|
||||
|
||||
return `<div data-origin="${url}" id=${id}></div>`
|
||||
} else {
|
||||
return `<div data-origin="${url}" id=${id}></div>
|
||||
<script>
|
||||
setTimeout(() => {
|
||||
var compiler = window.__current_docsify_compiler__
|
||||
Docsify.get('${url}', false).then(function(text) {
|
||||
document.getElementById('${id}').innerHTML = compiler
|
||||
.compile('\`\`\`${ext}\\n' + text.replace(/\`/g, '@qm@') + '\\n\`\`\`\\n')
|
||||
.replace(/@qm@/g, '\`')
|
||||
})
|
||||
})
|
||||
</script>`
|
||||
return {
|
||||
url,
|
||||
lang
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,12 +82,18 @@ export class Compiler {
|
||||
compile = marked
|
||||
}
|
||||
|
||||
this._marked = compile
|
||||
this.compile = cached(text => {
|
||||
let html = ''
|
||||
|
||||
if (!text) return text
|
||||
|
||||
html = compile(text)
|
||||
if (isPrimitive(text)) {
|
||||
html = compile(text)
|
||||
} else {
|
||||
html = compile.parser(text)
|
||||
}
|
||||
|
||||
html = config.noEmoji ? html : emojify(html)
|
||||
slugify.clear()
|
||||
|
||||
@@ -122,7 +101,40 @@ export class Compiler {
|
||||
})
|
||||
}
|
||||
|
||||
matchNotCompileLink (link) {
|
||||
compileEmbed (href, title) {
|
||||
const { str, config } = getAndRemoveConfig(title)
|
||||
let embed
|
||||
title = str
|
||||
|
||||
if (config.include) {
|
||||
if (!isAbsolutePath(href)) {
|
||||
href = getPath(process.env.SSR ? '' : this.contentBase, href)
|
||||
}
|
||||
|
||||
let media
|
||||
if (config.type && (media = compileMedia[config.type])) {
|
||||
embed = media.call(this, href, title)
|
||||
embed.type = config.type
|
||||
} else {
|
||||
let type = 'code'
|
||||
if (/\.(md|markdown)/.test(href)) {
|
||||
type = 'markdown'
|
||||
} else if (/\.html?/.test(href)) {
|
||||
type = 'iframe'
|
||||
} else if (/\.(mp4|ogg)/.test(href)) {
|
||||
type = 'video'
|
||||
} else if (/\.mp3/.test(href)) {
|
||||
type = 'audio'
|
||||
}
|
||||
embed = compileMedia[type].call(this, href, title)
|
||||
embed.type = type
|
||||
}
|
||||
|
||||
return embed
|
||||
}
|
||||
}
|
||||
|
||||
_matchNotCompileLink (link) {
|
||||
const links = this.config.noCompileLinks || []
|
||||
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
@@ -169,6 +181,7 @@ export class Compiler {
|
||||
}
|
||||
// highlight code
|
||||
origin.code = renderer.code = function (code, lang = '') {
|
||||
code = code.replace(/@DOCSIFY_QM@/g, '`')
|
||||
const hl = Prism.highlight(
|
||||
code,
|
||||
Prism.languages[lang] || Prism.languages.markup
|
||||
@@ -182,33 +195,9 @@ export class Compiler {
|
||||
const { str, config } = getAndRemoveConfig(title)
|
||||
title = str
|
||||
|
||||
if (config.include) {
|
||||
if (!isAbsolutePath(href)) {
|
||||
href = getPath(contentBase, href)
|
||||
}
|
||||
|
||||
let media
|
||||
if (config.type && (media = compileMedia[config.type])) {
|
||||
return media.call(_self, href, title)
|
||||
}
|
||||
|
||||
let type = 'code'
|
||||
if (/\.(md|markdown)/.test(href)) {
|
||||
type = 'markdown'
|
||||
} else if (/\.html?/.test(href)) {
|
||||
type = 'iframe'
|
||||
} else if (/\.(mp4|ogg)/.test(href)) {
|
||||
type = 'video'
|
||||
} else if (/\.mp3/.test(href)) {
|
||||
type = 'audio'
|
||||
}
|
||||
|
||||
return compileMedia[type].call(_self, href, title)
|
||||
}
|
||||
|
||||
if (
|
||||
!/:|(\/{2})/.test(href) &&
|
||||
!_self.matchNotCompileLink(href) &&
|
||||
!_self._matchNotCompileLink(href) &&
|
||||
!config.ignore
|
||||
) {
|
||||
if (href === _self.config.homepage) href = 'README'
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
import { get } from '../fetch/ajax'
|
||||
import { merge } from '../util/core'
|
||||
|
||||
const cached = {}
|
||||
|
||||
function walkFetchEmbed ({ step = 0, embedTokens, compile, fetch }, cb) {
|
||||
const token = embedTokens[step]
|
||||
|
||||
if (!token) {
|
||||
return cb({})
|
||||
}
|
||||
|
||||
const next = text => {
|
||||
let embedToken
|
||||
if (text) {
|
||||
if (token.embed.type === 'markdown') {
|
||||
embedToken = compile.lexer(text)
|
||||
} else if (token.embed.type === 'code') {
|
||||
embedToken = compile.lexer(
|
||||
'```' +
|
||||
token.embed.lang +
|
||||
'\n' +
|
||||
text.replace(/`/g, '@DOCSIFY_QM@') +
|
||||
'\n```\n'
|
||||
)
|
||||
}
|
||||
}
|
||||
cb({ token, embedToken })
|
||||
walkFetchEmbed({ step: ++step, compile, embedTokens, fetch }, cb)
|
||||
}
|
||||
|
||||
if (process.env.SSR) {
|
||||
fetch(token.embed.url).then(next)
|
||||
} else {
|
||||
get(token.embed.url).then(next)
|
||||
}
|
||||
}
|
||||
|
||||
export function prerenderEmbed ({ compiler, raw = '', fetch }, done) {
|
||||
let hit
|
||||
if ((hit = cached[raw])) {
|
||||
return done(hit)
|
||||
}
|
||||
|
||||
const compile = compiler._marked
|
||||
let tokens = compile.lexer(raw)
|
||||
const embedTokens = []
|
||||
const linkRE = compile.InlineLexer.rules.link
|
||||
const links = tokens.links
|
||||
|
||||
tokens.forEach((token, index) => {
|
||||
if (token.type === 'paragraph') {
|
||||
token.text = token.text.replace(
|
||||
new RegExp(linkRE.source, 'g'),
|
||||
(src, filename, href, title) => {
|
||||
const embed = compiler.compileEmbed(href, title)
|
||||
|
||||
if (embed) {
|
||||
if (embed.type === 'markdown' || embed.type === 'code') {
|
||||
embedTokens.push({
|
||||
index,
|
||||
embed
|
||||
})
|
||||
}
|
||||
return embed.code
|
||||
}
|
||||
|
||||
return src
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
let moveIndex = 0
|
||||
walkFetchEmbed({ compile, embedTokens, fetch }, ({ embedToken, token }) => {
|
||||
if (token) {
|
||||
const index = token.index + moveIndex
|
||||
|
||||
merge(links, embedToken.links)
|
||||
|
||||
tokens = tokens
|
||||
.slice(0, index)
|
||||
.concat(embedToken, tokens.slice(index + 1))
|
||||
moveIndex += embedToken.length - 1
|
||||
} else {
|
||||
cached[raw] = tokens.concat()
|
||||
tokens.links = cached[raw].links = links
|
||||
done(tokens)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { getPath, isAbsolutePath } from '../router/util'
|
||||
import { isMobile, inBrowser } from '../util/env'
|
||||
import { isPrimitive } from '../util/core'
|
||||
import { scrollActiveSidebar, scroll2Top } from '../event/scroll'
|
||||
import { prerenderEmbed } from './embed'
|
||||
|
||||
function executeScript () {
|
||||
const script = dom
|
||||
@@ -119,18 +120,37 @@ export function renderMixin (proto) {
|
||||
getAndActive(this.router, 'nav')
|
||||
}
|
||||
|
||||
proto._renderMain = function (text, opt = {}) {
|
||||
proto._renderMain = function (text, opt = {}, next) {
|
||||
if (!text) {
|
||||
return renderMain.call(this, text)
|
||||
}
|
||||
|
||||
callHook(this, 'beforeEach', text, result => {
|
||||
let html = this.isHTML ? result : this.compiler.compile(result)
|
||||
if (opt.updatedAt) {
|
||||
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated)
|
||||
}
|
||||
let html
|
||||
const callback = () => {
|
||||
if (opt.updatedAt) {
|
||||
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated)
|
||||
}
|
||||
|
||||
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
|
||||
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
|
||||
}
|
||||
if (this.isHTML) {
|
||||
html = this.result = text
|
||||
callback()
|
||||
next()
|
||||
} else {
|
||||
prerenderEmbed(
|
||||
{
|
||||
compiler: this.compiler,
|
||||
raw: result
|
||||
},
|
||||
tokens => {
|
||||
html = this.compiler.compile(tokens)
|
||||
callback()
|
||||
next()
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
export function cached (fn) {
|
||||
const cache = Object.create(null)
|
||||
return function cachedFn (str) {
|
||||
const hit = cache[str]
|
||||
return hit || (cache[str] = fn(str))
|
||||
const key = isPrimitive(str) ? str : JSON.stringify(str)
|
||||
const hit = cache[key]
|
||||
return hit || (cache[key] = fn(str))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user