Compare commits

...
172 Commits
Author SHA1 Message Date
qingwei.li 178ba64157 chore: add changelog 4.5.6 2017-12-14 22:13:46 +08:00
qingwei.li 93a995f5bc [build] 4.5.6 2017-12-14 22:13:45 +08:00
qingwei.li 888f217356 fix(style): increase the tap targets of menu button, fixed #325 2017-12-14 22:12:58 +08:00
spiritreeandcinwell.li 6bfc81147f chore: add vue-orgchart in showcase section (#324) 2017-12-14 19:55:47 +08:00
qingwei.li 3af1641874 docs: update alias 2017-12-14 09:40:29 +08:00
qingwei.li 66c8fd501a fix: remove codesponsor 2017-12-13 10:29:53 +08:00
qingwei.li d60f6f0d03 chore: update logo 2017-11-30 16:04:11 +08:00
Romain Lenzottiandcinwell.li 2002cb8b22 chore: Add website example based on docsify (#319)
* chore: Add website example based on docsify

* Update README.md
2017-11-30 15:42:17 +08:00
qingwei.li 572ab1afae chore: add changelog 4.5.5 2017-11-30 09:43:46 +08:00
qingwei.li d3dc8bcfb7 [build] 4.5.5 2017-11-30 09:43:44 +08:00
qingwei.li 0e693fcda2 chore: tweaks code 2017-11-30 09:43:25 +08:00
Leon Zhangandcinwell.li 041b33e967 fix: disqus plugin issue (#318)
* fix issue disqus plugin issue

fix #317, disqus plugin make page refresh continuously.

* Update disqus.js
2017-11-30 09:42:02 +08:00
qingwei.li b34a9375c3 chore: add changelog 4.5.4 2017-11-29 09:46:20 +08:00
qingwei.li a1d2a1f1e3 [build] 4.5.4 2017-11-29 09:46:18 +08:00
qingwei.li e43ded4ea7 fix(compiler): task lists style, fixed #215 2017-11-29 09:45:40 +08:00
Kamilandcinwell.li 88df107c70 Add vue-sticker in Showcase section (#313)
Add one more component, that use docsify
2017-11-28 09:48:38 +08:00
Jonas Zhangandcinwell.li bc3ef52bbe docs: Improve the translation (#312)
* docs:Improve the translation

docs:Improve the translation

* docs:Improve the translation

docs:Improve the translation

* Update configuration.md

* Update deploy.md

* Update helpers.md
2017-11-24 10:11:15 +08:00
ItsPugleandcinwell.li 9bed441a0c Update deploy.md (#311) 2017-11-24 00:09:36 +08:00
Jonas Zhangandcinwell.li af38fc70fd docs: translate zh-cn doc for more-pages.md (#310)
translate zh-cn doc for more-pages.md
2017-11-21 17:31:41 +08:00
qingwei.li 4f164e995e chore: add changelog 4.5.3 2017-11-11 10:15:17 +08:00
qingwei.li b77f46a8e3 [build] 4.5.3 2017-11-11 10:15:16 +08:00
spiritreeandcinwell.li 9208e64939 feat: add gitalk plugin (#306) 2017-11-09 20:53:07 +08:00
qingwei.li 405349102f chore: add changelog 4.5.2 2017-11-09 13:06:59 +08:00
qingwei.li 9d6595d04b [build] 4.5.2 2017-11-09 13:06:57 +08:00
cinwell.liandGitHub d486eef6cc feat: github task lists, close #215 (#305) 2017-11-09 13:06:23 +08:00
qingwei.li b3c3180bab chore: add changelog 4.5.1 2017-11-07 20:03:42 +08:00
qingwei.li c30af850a1 [build] 4.5.1 2017-11-07 20:03:41 +08:00
qingwei.li 2a2ed96eb8 feat: fetch files with the query params, fixed #303 2017-11-07 20:03:11 +08:00
Desmondandcinwell.li 0d54c0cf83 Add zooming to showcase (#302) 2017-11-05 00:42:10 -05:00
qingwei.li f27ce7d2b2 chore: add changelog 4.5.0 2017-11-04 13:56:25 +08:00
qingwei.li 2e1a7367a8 [build] 4.5.0 2017-11-04 13:56:24 +08:00
qingwei.li 7510f75968 fix lint 2017-11-04 13:56:08 +08:00
qingwei.li fd7d4e0e4e feat: add disqus plugin, closed #123 2017-11-04 13:54:37 +08:00
qingwei.li 025bc5cddf chore: update all plugins.md, fixed #187 2017-11-02 10:48:09 +08:00
cinwell.liandGitHub 8f1066a035 chore: update doc
fixed #187
2017-11-01 21:43:09 -05:00
qingwei.li 800c0c503a chore: add changelog 4.4.1 2017-10-31 21:48:15 +08:00
qingwei.li d5194b4f6b [build] 4.4.1 2017-10-31 21:48:15 +08:00
cinwell.liandGitHub fa772cfa94 fix: zoom image plugin issue, fixed #187 (#300) 2017-10-31 08:20:08 -05:00
Li Xueliandcinwell.li cc98f56cdd fix: {docsify-ignore-all} and {docsify-ignore} bug (#299)
* fix {docsify-ignore-all} not work bug

* fix {docsify-ignore} bug
2017-10-31 08:19:48 -05:00
Li Xueliandcinwell.li 752f68e5f8 chore: {docsify-ignore-all} not working properly (#298) 2017-10-31 03:11:40 -05:00
qingwei.li bde17e1f10 chore: update template 2017-10-30 21:58:33 +08:00
qingwei.li 2db197f6dc chore: add changelog 4.4.0 2017-10-30 19:02:56 +08:00
qingwei.li e8b5b09f2c [build] 4.4.0 2017-10-30 19:02:55 +08:00
cinwell.liandGitHub 36bfc9d91d fix: sidebar style issue on firefox, fixed #184 (#297) 2017-10-30 06:01:01 -05:00
cinwell.liandGitHub 4ad96f3d12 feat: add helper for disabled link, fixed #295 (#296) 2017-10-30 06:00:31 -05:00
Aleksandr Filatovandcinwell.li 1f04912a8f Added IT-films project which is based on docsify in readme (#293) 2017-10-27 09:23:21 -05:00
Sanctuaryandcinwell.li 65f17b4753 Move script tags above closing body tag (#290) 2017-10-22 20:38:38 -05:00
Ron Hashimotoandcinwell.li b3419f3842 docs: fix a broken code block (#286) 2017-10-20 09:41:38 -05:00
Maxandcinwell.li 0bb7e18018 Add rnback website to showcase (#287) 2017-10-20 09:41:26 -05:00
qingwei.li 86583e19ab chore: add changelog 4.3.15 2017-10-20 12:55:30 +08:00
qingwei.li 0bef31951c [build] 4.3.15 2017-10-20 12:55:29 +08:00
qingwei.li a2b8eae8c4 fix: scroll active sidebar 2017-10-20 12:54:27 +08:00
qingwei.li 63d08369f6 chore: add changelog 4.3.14 2017-10-20 09:29:30 +08:00
qingwei.li 142623e87e [build] 4.3.14 2017-10-20 09:29:28 +08:00
qingwei.li ab682684ca fix: codesponsor style 2017-10-20 09:29:11 +08:00
qingwei.li e16c89e539 chore: add changelog 4.3.13 2017-10-17 10:28:28 +08:00
qingwei.li f1272a2f1c [build] 4.3.13 2017-10-17 10:28:26 +08:00
LaySentandcinwell.li 1b912272df feat: make whole search result clickable (#285) 2017-10-16 21:27:44 -05:00
Alexander Chibrikinandcinwell.li 3476f6ff1f fix: duplicate results in search fixed #257 (#284) 2017-10-16 21:16:37 -05:00
qingwei.li fac7ce693f chore: fix bootstrap script, fixed #282 2017-10-16 08:23:54 +08:00
Alexander Chibrikinandcinwell.li 470ee474d4 chore: ignore ./lib , force add ./lib on release (#283) 2017-10-15 19:20:35 -05:00
qingwei.li f7cf95a771 chore: add changelog 4.3.12 2017-10-15 21:26:50 +08:00
qingwei.li 4a9d594f7c [build] 4.3.12 2017-10-15 21:26:49 +08:00
LaySentandcinwell.li a3ab37952d fix: incorrect active link (#281)
* fix scroll issue in IE

* add meta tag for IE browser

* fix link render issue after page refreshing

* fix issue of incorrect active link

Should use both `path` and `id` to identify link, as `id` might not be unique under different paths
2017-10-15 08:25:49 -05:00
qingwei.li 6949455899 chore: add changelog 4.3.11 2017-10-15 10:44:35 +08:00
qingwei.li 4e52315564 [build] 4.3.11 2017-10-15 10:44:34 +08:00
qingwei.li 91d6337936 fix: broken links to same page heading, fix #278, fix #279 2017-10-15 10:43:35 +08:00
Gant Labordeandcinwell.li 26cc466420 chore: Add another fan of docsify! (#280)
* Add another fan of docsify!

Thanks for such a great documentation tool!

* Update README.md
2017-10-14 21:34:58 -05:00
Nicolas Gomes De Oliveiraandcinwell.li 6f92a871ca Update language-highlight.md (#277) 2017-10-13 02:46:32 -05:00
qingwei.li 538ee3d0dc chore: add changelog 4.3.10 2017-10-12 22:51:32 +08:00
qingwei.li 49fd30d73d [build] 4.3.10 2017-10-12 22:51:30 +08:00
LaySentandqingwei.li abd885e133 fix: link render issue after page refreshing (#276)
* fix scroll issue in IE

* add meta tag for IE browser

* fix link render issue after page refreshing
2017-10-12 22:48:07 +08:00
qingwei.li 69b2040571 chore: add changelog 4.3.9 2017-10-12 00:37:10 +08:00
qingwei.li e8d675c405 [build] 4.3.9 2017-10-12 00:37:09 +08:00
qingwei.li 5cc3e6c469 chore: update docs 2017-10-12 00:36:23 +08:00
LaySentandcinwell.li 3e94cb6d76 fix: scroll issue in IE (#275)
* fix scroll issue in IE

* add meta tag for IE browser
2017-10-11 11:33:59 -05:00
cinwell.liandGitHub 641e522779 Update deploy.md 2017-10-11 04:20:41 -05:00
Ho Chin Cheeandcinwell.li 026530de10 docs: Deployment guide for GitLab Pages (#274) 2017-10-10 20:59:00 -05:00
qingwei.li 1b74ef31a9 chore: add changelog 4.3.8 2017-10-07 10:08:28 +08:00
qingwei.li 25acd8ce77 [build] 4.3.8 2017-10-07 10:08:27 +08:00
qingwei.li 9b4e6669db fix(slugify): GitHub compatible heading links, fixed #272 2017-10-07 10:08:09 +08:00
qingwei.li 2e3fe59702 chore: add changelog 4.3.7 2017-10-02 13:27:16 +08:00
qingwei.li 7923608bc9 [build] 4.3.7 2017-10-02 13:27:15 +08:00
qingwei.li e307308a78 chore: add vscode config 2017-10-02 13:26:45 +08:00
qingwei.li c195d2d1a6 fix(slugify): GitHub compatible heading links, fixed #267 2017-10-02 13:26:36 +08:00
JP Erasmusandcinwell.li 0624e592d8 docs: Add new copy-to-clipboard plugin (#265) 2017-09-28 21:14:09 -05:00
qingwei.li aba2aec0d0 chore: prettier code 2017-09-22 10:07:10 +08:00
qingwei.li a9704b5156 chore: add changelog 4.3.6 2017-09-21 09:51:53 +08:00
qingwei.li 16d730ec3d [build] 4.3.6 2017-09-21 09:51:51 +08:00
qingwei.li 08afec7d2a fix: style for codesponsor plugin 2017-09-21 09:51:02 +08:00
qingwei.li fcee316d2c chore: use unpkg cdn 2017-09-20 10:06:23 +08:00
qingwei.li 1d2b546602 chore: add changelog 4.3.5 2017-09-20 09:03:55 +08:00
qingwei.li 97793bfd6c [build] 4.3.5 2017-09-20 09:03:54 +08:00
qingwei.li ae3f74bfd4 chore: add build script 2017-09-20 09:01:31 +08:00
qingwei.li 04eaf4026b chore: add doc for codesponsor 2017-09-20 09:01:06 +08:00
qingwei.li 46ac4c3fd2 feat(plugin): add codesponsor plugin 2017-09-20 09:00:34 +08:00
Ken Berkeleyandcinwell.li 44dc68c6b2 Add vue2-datatable-component in Showcase (#255)
In my humble opinion, the doc of this project might have a better file structure for multiple languages
2017-09-13 03:38:25 -05:00
Chikara Chanandcinwell.li 6c702d3362 fix: missed symbol (#254) 2017-09-13 03:38:09 -05:00
cinwell.liandGitHub c476e49164 Update README.md 2017-09-11 01:30:48 -05:00
Ying Zhongandcinwell.li 0329bab359 Add xTeko website to showcase (#250) 2017-09-10 22:44:38 -05:00
qingwei.li 62aa161bff chore: add ga 2017-09-11 07:13:46 +08:00
qingwei.li 3854692331 chore: add codesponsor 2017-09-11 07:03:19 +08:00
qingwei.li 2066cb672d chore: add changelog 4.3.4 2017-09-07 23:05:24 +08:00
qingwei.li 5b7b60c553 [build] 4.3.4 2017-09-07 23:05:23 +08:00
qingwei.li 388ed3d685 fix: scroll position issue, fixed #234 2017-09-07 23:04:58 +08:00
qingwei.li e898350a84 chore: update travisci 2017-09-06 18:25:56 +08:00
qingwei.li 9c62fb41b8 chore: add changelog 4.3.3 2017-09-06 17:18:33 +08:00
qingwei.li 9b73b0bf8a [build] 4.3.3 2017-09-06 17:18:32 +08:00
qingwei.li 9d43051791 fix(buble.css): tweaks code block style, fixed #249 2017-09-06 17:17:57 +08:00
Leon Zhangandcinwell.li f0aca1905c feat: add doc for react and vue demo box plugin (#247) 2017-09-05 09:46:05 +08:00
Jeremygaoandcinwell.li 2959497874 bugfix: config.js里面应为routerMode属性而非routerModel (#245) 2017-09-01 16:33:29 +08:00
qingwei.li 5a9921f5e7 chore: add changelog 4.3.2 2017-09-01 15:53:06 +08:00
qingwei.li c9d556d829 [build] 4.3.2 2017-09-01 15:53:04 +08:00
qingwei.li a0e1ea811a feat: add Edit on github plugin (thanks @njleonzhang) 2017-09-01 15:52:35 +08:00
qingwei.li f82f41900e fix: sidebar highlight 2017-09-01 15:50:53 +08:00
Leon Zhangandcinwell.li 7a4d9bc5cd add doc for Edit on github plugin (#244) 2017-09-01 15:43:43 +08:00
qingwei.li 5e522879dd chore: add changelog 4.3.1 2017-08-30 21:54:49 +08:00
qingwei.li a72e7a3a3f [build] 4.3.1 2017-08-30 21:54:48 +08:00
qingwei.li 26c22a9843 chore: add lockfile 2017-08-30 21:54:17 +08:00
fyandcinwell.li 4ce118d60f fixed sidebar item inactive issue & fixed _sidebar.md 404 issue & smooth scroll (#242)
* fixed sidebar item inactive issue & fixed _sidebar.md 404 issue & smooth scroll

* sidebar load fix
2017-08-30 21:48:36 +08:00
Jonasandcinwell.li 3ad1645b90 fix yarn add command (#237)
package is published at `docsify-server-renderer` but README.md refers to `docsify-server-render`
2017-08-18 09:06:34 +08:00
qingwei.li 41967fa8fa chore(docs): fix markdown demo 2017-08-17 17:18:41 +08:00
qingwei.li 48276db15d chore: add changelog 4.3.0 2017-08-17 16:54:12 +08:00
qingwei.li b67ea62c75 [build] 4.3.0 2017-08-17 16:54:10 +08:00
qingwei.li f4800e09f1 feat(markdown): supports mermaid #137 2017-08-17 16:52:54 +08:00
qingwei.li ac10de1c5b chore: update changelog 2017-08-15 23:48:53 +08:00
qingwei.li d6ac7031b0 chore: add changelog 4.2.9 2017-08-15 23:47:21 +08:00
qingwei.li 4417f4669d [build] 4.2.9 2017-08-15 23:47:20 +08:00
qingwei.li b7735066ff chore(*): remove document-ready 2017-08-15 23:46:47 +08:00
yeloandcinwell.li 10045249d3 ensure document ready before init Docsify (#233) 2017-08-15 23:35:27 +08:00
qingwei.li 190710733e chore: add changelog 4.2.8 2017-08-10 08:46:26 +08:00
qingwei.li b292d819fc [build] 4.2.8 2017-08-10 08:46:25 +08:00
qingwei.li 7f270f93c6 feat(compiler): support for setting target attribute for link, fixed #230 2017-08-10 08:45:49 +08:00
qingwei.li c3a149679a chore(*): tweaks changelog 2017-08-05 09:56:53 +08:00
qingwei.li 5efa763075 chore: add changelog 4.2.7 2017-08-05 09:54:25 +08:00
qingwei.li 03a04f7898 [build] 4.2.7 2017-08-05 09:54:24 +08:00
qingwei.li a88252c6b2 fix(style): nowrap => pre-wrap, fixed #228 2017-08-05 09:53:57 +08:00
Nedim Arabacıandcinwell.li 2f5f90750a Noty added to showcase (#226)
Nice documentation site generator! Thanks.
2017-07-28 13:30:09 +08:00
qingwei.li 709c152950 chore: add changelog 4.2.6 2017-07-27 10:03:18 +08:00
qingwei.li b09a5a317e [build] 4.2.6 2017-07-27 10:03:17 +08:00
qingwei.li 628e2115a3 fix(release): release shell 2017-07-27 10:02:49 +08:00
qingwei.li 271dde8f5e chore(*): fix changelog script 2017-07-27 09:58:37 +08:00
qingwei.li 1fa1619278 fix(css): hide the nav when the content has not yet been loaded 2017-07-27 09:50:21 +08:00
qingwei.li 3de3def8a8 chore(*): fix changelog script 2017-07-26 18:55:13 +08:00
qingwei.li fb25726426 chore: add changelog 4.2.4 2017-07-26 18:52:59 +08:00
qingwei.li 36ddc42e91 [release] 4.2.4 2017-07-26 18:52:58 +08:00
qingwei.li abb0f6019f [build] 4.2.4 2017-07-26 18:52:58 +08:00
qingwei.li b8dd346baf fix(render): Remove getRootNode to be compatible with the lower version of Chrome, fixed #225 2017-07-26 18:52:36 +08:00
qingwei.li 7191d702e1 chore(*): add cdn 2017-07-26 08:42:07 +08:00
qingwei.li c039f1bfc0 chore: add changelog 4.2.3 2017-07-26 08:37:36 +08:00
qingwei.li f859d2d0b2 [release] 4.2.3 2017-07-26 08:37:35 +08:00
qingwei.li 9735f4036e [build] 4.2.3 2017-07-26 08:37:35 +08:00
qingwei.li b8a96b867b Merge branch 'master' of github.com:qingwei-li/docsify 2017-07-26 08:37:02 +08:00
qingwei.li b7b589b1bf feat(search): Supports the max depth of the search headline, fixed #223, resolve #129 2017-07-26 08:36:35 +08:00
qingwei.li 761e38f6ad chore: add changelog 4.2.2 2017-07-24 19:06:24 +08:00
qingwei.li 78899a0251 [release] 4.2.2 2017-07-24 19:00:39 +08:00
qingwei.li 357631c8b7 [build] 4.2.2 2017-07-24 19:00:12 +08:00
qingwei.li 17ff3d1506 fix: style rerender due to setting themeColor 2017-07-24 18:57:41 +08:00
Leon Zhangandcinwell.li f59aac478a Update README.md (#219) 2017-07-20 10:54:21 +08:00
qingwei.li 0dd2497467 chore: add history.md 2017-07-20 01:15:39 +08:00
qingwei.li 306136f6a3 chore: update changlog 2017-07-20 01:13:47 +08:00
qingwei.li 4aba9d0a25 chore(*): remove history.md 2017-07-20 01:05:01 +08:00
qingwei.li 3d2f23bcdc chore: add changelog 4.2.1 2017-07-20 00:58:17 +08:00
qingwei.li b85eb0ff4b [release] 4.2.1 2017-07-20 00:58:16 +08:00
qingwei.li efa8d25912 [build] 4.2.1 2017-07-20 00:58:15 +08:00
qingwei.li 437737cc5a chore: update release shell 2017-07-20 00:53:25 +08:00
qingwei.li 992ff77808 chore: remove yarnlock 2017-07-20 00:41:46 +08:00
yeloandcinwell.li 4cf13db685 give the navbar some line-height (#216) 2017-07-19 16:09:10 +08:00
Kim Burgessandcinwell.li e54062f80d Remove unnecessary moduleName option from rollup config for plugins (#209) 2017-07-18 17:44:25 +08:00
qingwei.li cee8ac6698 fix typo 2017-07-12 08:56:52 +08:00
Mario Neblandcinwell.li d057f66fce docs: add commitlint to showcase (#207) 2017-07-12 08:55:27 +08:00
Dobromir Hristovandcinwell.li 9b0f1978a4 docs: Add palettify in Showcase (#206) 2017-07-11 08:19:00 +08:00
101 changed files with 8001 additions and 7451 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
*.log
.DS_Store
/themes
/themes/
node_modules
/lib/
-6
View File
@@ -1,9 +1,3 @@
sudo: false
cache:
directories:
- $HOME/.yarn-cache
language: node_js
node_js: stable
os:
- linux
- osx
+3
View File
@@ -0,0 +1,3 @@
{
"prettier.eslintIntegration": true
}
+486 -125
View File
@@ -1,207 +1,568 @@
# Changelog
<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.2.0 / 2017-07-10
* feat: ignore to compiled link, fixed #203 (#204)
* feat: alias option supports regexp, resolve #183
### Bug Fixes
4.1.14 / 2017-06-24
* **compiler:** task lists style, fixed [#215](https://github.com/QingWei-Li/docsify/issues/215) ([e43ded4](https://github.com/QingWei-Li/docsify/commit/e43ded4))
* 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)
* remove codesponsor ([66c8fd5](https://github.com/QingWei-Li/docsify/commit/66c8fd5))
* **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))
* feat: add context attribute, fixed #191
* fix: get file path
* Merge pull request #195 from crawt/master
* Filter picture
* Update doc for external link target (#194)
4.1.13 / 2017-06-11
* fix ga
<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.1.12 / 2017-06-03
* fix(render): ubtitle in side bar shows undefined, fixed [#182](https://github.com/QingWei-Li/docsify/issues/182)
### Bug Fixes
4.1.11 / 2017-06-02
* 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)
* fix(render): autoHeader does not work
* fix(compiler): force reset toc when rendering sidebar fixed [#181](https://github.com/QingWei-Li/docsify/issues/181)
4.1.10 / 2017-06-02
* fix(hash): hash routing crashes when url has querystring
<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.1.9 / 2017-05-31
* fix(lifecycle): continue to handle data
* fix: can't render toc on first load, fixed [#171](https://github.com/QingWei-Li/docsify/issues/171)
* fix(render): broken name link, fixed [#167](https://github.com/QingWei-Li/docsify/issues/167)
### Bug Fixes
## 4.1.8(since 4.1.1) / 2017-05-31
* **compiler:** task lists style, fixed [#215](https://github.com/QingWei-Li/docsify/issues/215) ([e43ded4](https://github.com/QingWei-Li/docsify/commit/e43ded4))
* fix(pure-css):add coverpage style, fixed [#165](https://github.com/QingWei-Li/docsify/issues/165)
* feat: add edit button demo, close [#162](https://github.com/QingWei-Li/docsify/issues/162)
* fix some ssr bugs
## 4.1.0 / 2017-05-30 🎂 to me
### Features
* add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
* feat: Support server client renderer [See detail](//docsify.js.org/#/ssr)
* feat: Support HTML5 history API. `$docsify.routerMode = 'history'`
* Breaking change: Clean global API
## 3.7.3 / 2017-05-22
* fix(render): find => filter, Compatible with old browser
* Pretty dir tree
<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)
## 3.7.2 / 2017-05-19
* tweaks
### Features
## 3.7.1 / 2017-05-19
* add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
* fix: docsify-updated is undefined
## 3.7.0 / 2017-05-16
* feat: add externalLinkTarget, close ([#149](https://github.com/QingWei-Li/docsify/issues/149)
* feat: add **{docsify-updated<span>}</span>**, close ([#158](https://github.com/QingWei-Li/docsify/issues/158)
<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)
## 3.6.6 / 2017-05-06
* feat: support query string for the search, likes `https://docsify.js.org/#/?s=navbar`, fixed ([#156](https://github.com/QingWei-Li/docsify/issues/156)
### Features
## 3.6.5 / 2017-04-28
* 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))
* fix(util): fix crash, fixed ([#154](https://github.com/QingWei-Li/docsify/issues/154)
## 3.6.4 / 2017-04-28
* fix(util): correctly clean up duplicate slashes, fixed ([#153](https://github.com/QingWei-Li/docsify/issues/153)
<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)
## 3.6.3 / 2017-04-25
* fix(external-script): script attrs
### Features
## 3.6.2/ 2017-04-12
* 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))
* feat(external-script): detect more than one script dom, fixed ([#146](https://github.com/QingWei-Li/docsify/issues/146)
* GA: Send hash instead of complete href ([#147](https://github.com/QingWei-Li/docsify/issues/147)
## 3.6.1 / 2017-04-09
* feat(event): Collapse the sidebar when click outside element in the small screen
<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)
## 3.6.0 / 2017-04-09
* feat(render): add mergeNavbar option, close ([#125](https://github.com/QingWei-Li/docsify/issues/125)
### Features
## 3.5.2/ 2017-04-05
* add disqus plugin, closed [#123](https://github.com/QingWei-Li/docsify/issues/123) ([fd7d4e0](https://github.com/QingWei-Li/docsify/commit/fd7d4e0))
* add optional current route param to toURL and use it to properly compose local anchor links
* fix code style by removing semicolons
* in toURL test for anchor links and if so prepend the currentPath to the generated path. fixes ([#142](https://github.com/QingWei-Li/docsify/issues/142))
## 3.5.1 / 2017-03-25
* fix: .md file extension regex
<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)
## 3.5.0 / 2017-03-25
* feat(route): auto remove .md extension
* fix: adjust display on small screens [@jrappen](https://github.com/jrappen)
* fix: navbar labels for German [@jrappen](https://github.com/jrappen)
### Bug Fixes
## 3.4.4 / 2017-03-17
* {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))
* fix(search): fix input style
* fix search plugin match bug
## 3.4.3 / 2017-03-16
* Add ability to ignore headers when generating toc ([#127](https://github.com/QingWei-Li/docsify/issues/127) [@christopherwk210](https://github.com/christopherwk210))
* fix external-script not inserting script at right place [@Leopoldthecoder](https://github.com/Leopoldthecoder)
* add German docs [@jrappen](https://github.com/jrappen)
<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)
## 3.4.2 / 2017-03-11
* feat(emojify): add no-emoji option
### Bug Fixes
## 3.4.1 / 2017-03-10
* 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))
* fix(dom): Disable the dom cache when vue is present, fixed [#119](https://github.com/QingWei-Li/docsify/issues/119)
* update english docs, [@jrappen](https://github.com/jrappen)
## 3.4.0 / 2017-03-09
### Features
* feat(zoom-image): add plugin
* 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))
## 3.3.0 / 2017-03-07
* add front-matter plugin
* add external-script plugin, [@Leopoldthecoder](https://github.com/Leopoldthecoder)
* Fix nav showing while loading ([#112](https://github.com/QingWei-Li/docsify/issues/112))
## 3.2.0 / 2017-02-28
<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)
* fix(render): Toc rendering error, fixed [#106](https://github.com/QingWei-Li/docsify/issues/106)
* feat(search): Localization for no data tip, close [#103](https://github.com/QingWei-Li/docsify/issues/103)
* fix(fetch): load sidebar and navbar for parent path, fixed [#100](https://github.com/QingWei-Li/docsify/issues/100)
* feat(render) nameLink for each route, fixed [#99](https://github.com/QingWei-Li/docsify/issues/99)
## 3.1.2 / 2017-02-27
### Bug Fixes
* fix(search): dont search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102)
* scroll active sidebar ([a2b8eae](https://github.com/QingWei-Li/docsify/commit/a2b8eae))
## 3.1.1 / 2017-02-24
* fix(search): dont search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102)
* fix(render): custom cover background image
* fix(tpl): extra character, fixed [#101](https://github.com/QingWei-Li/docsify/issues/101)
## 3.1.0 / 2017-02-22
<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)
* fix(search): incorrect anchor link, fixed [#90](https://github.com/QingWei-Li/docsify/issues/90)
* feat(emoji): add emoji plugin
## 3.0.5 / 2017-02-21
### Bug Fixes
* feat(pwa): add sw.js
* fix(layout.css): loading style
* fix(event): highlight sidebar when clicked, fixed [#86](https://github.com/QingWei-Li/docsify/issues/86)
* fix(gen-tree): cache toc list, fixed [#88](https://github.com/QingWei-Li/docsify/issues/88)
* codesponsor style ([ab68268](https://github.com/QingWei-Li/docsify/commit/ab68268))
## 3.0.4 / 2017-02-20
* fix(render): execute script
* fix(render): disable rendering sub list when loadSidebar is false
## 3.0.3 / 2017-02-19
<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)
* fixed look of links in blockquote
* fix(scroll) highlight bug
## 3.0.2 / 2017-02-19
### Bug Fixes
* fix(search): add lazy input
* fix(compiler): link
* 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))
## 3.0.1 / 2017-02-19
* fix(route): empty alias
### Features
## 3.0.0 / 2017-02-19
* make whole search result clickable ([#285](https://github.com/QingWei-Li/docsify/issues/285)) ([1b91227](https://github.com/QingWei-Li/docsify/commit/1b91227))
##### Breaking change
* Not support IE9
* The route becomes: `/#/page?id=slug`. The previous route will be redirected
##### Features
<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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
<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)
### 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)
### 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)
### Bug Fixes
* **render:** ubtitle 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)
### 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)
### 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)
### Bug Fixes
* 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))
* **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)
### 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)
### 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)
### 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)
### Bug Fixes
* **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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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))
* Faster rendering
* Clearer source code
* More powerful API
* Auto header for each page [#78](https://github.com/QingWei-Li/docsify/issues/78)
* Localization for search plugin [#80](https://github.com/QingWei-Li/docsify/issues/80)
* Execute the script in markdown (see `executeScript`)
+568 -344
View File
File diff suppressed because it is too large Load Diff
+21 -4
View File
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://docsify.js.org">
<img alt="docsify" src="./media/docsify.png">
<img alt="docsify" src="./docs/_media/icon.svg">
</a>
</p>
@@ -11,15 +11,15 @@
<p align="center">
<a href="https://travis-ci.org/QingWei-Li/docsify"><img alt="Travis Status" src="https://img.shields.io/travis/QingWei-Li/docsify/master.svg?style=flat-square"></a>
<a href="https://www.npmjs.com/package/docsify"><img alt="npm" src="https://img.shields.io/npm/v/docsify.svg?style=flat-square"></a>
<a href="https://cdnjs.com/libraries/docsify"><img alt="cdnjs" src="https://img.shields.io/cdnjs/v/docsify.svg?style=flat-square"></a>
<a href="https://github.com/QingWei-Li/donate"><img alt="donate" src="https://img.shields.io/badge/%24-donate-ff69b4.svg?style=flat-square"></a>
<a href="https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify.svg?type=shield"/></a>
</p>
## Links
- [Documentation](https://docsify.js.org)
- [CLI](https://github.com/QingWei-Li/docsify-cli)
- CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify)
## Features
@@ -41,6 +41,8 @@ Create an `index.html`.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
</head>
@@ -71,6 +73,20 @@ These projects are using docsify to generate their sites. Pull requests welcome
| [hire-me](https://fvcproductions.github.io/hire-me) | A path to getting an awesome tech gig. |
| [vue-amap](https://elemefe.github.io/vue-amap/) | A Map Component Library Base on Vue 2.x and Gaode Map. |
| [samlify](https://samlify.js.org) | Node.js SAML2 library |
| [palettify](https://dobromir-hristov.github.io/palettify/) | A color palette effects assistant |
| [commitlint](https://marionebl.github.io/commitlint/) | Lint commit messages |
| [vue-data-tables](https://github.com/njleonzhang/vue-data-tables/) | A simple and customizable data tablebased on vue2 and element-ui. |
| [Noty](http://ned.im/noty/) | A Dependency-free notification library |
| [xTeko](https://docs.xteko.com/) | Addins framework for Pin 3.0 |
| [vue2-datatable-component](https://github.com/OneWayTech/vue2-datatable) | The best Datatable for Vue.js 2.x which never sucks |
| [Solidarity](https://infinitered.github.io/solidarity/) | Environment enforcer for your projects across machines. |
| [rnback](https://rnback.com/) | Backend service for react-native applications. |
| [IT-films](https://greybax.github.com/IT-films/) | A curated list of awesome movies, documentaries and TV series about hackers, geeks and IT in common, sorted by IMDB rating. |
| [zooming](http://desmonding.me/zooming/docs) | Image zoom that makes sense. |
| [vue-sticker](https://kamilocean.github.io/vue-sticker/#/) | Vue component, that helps to make sticky effects |
| [Ts.ED](https://romakita.github.io/ts-express-decorators/#/) | A TypeScript Framework on top of Express |
| [Ts.LogDebug](https://romakita.github.io/ts-log-debug/#/) | A multi channel logger written in TypeScript |
| [vue-orgchart](https://spiritree.github.io/vue-orgchart) | Vue.js wrapper for OrgChart.js |
## Similar projects
@@ -91,7 +107,7 @@ These projects are using docsify to generate their sites. Pull requests welcome
## Development
```bash
npm i && npm run dev
npm run bootstrap && npm run dev
open http://localhost:3000
```
@@ -100,3 +116,4 @@ open http://localhost:3000
MIT
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify?ref=badge_large)
+11 -9
View File
@@ -30,22 +30,24 @@ var renderer = new Renderer({
alias: {
'/de-de/changelog': '/changelog',
'/zh-cn/changelog': '/changelog',
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
'/changelog':
'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
}
},
path: './'
})
http.createServer(function (req, res) {
serveStatic('.')(req, res, function () {
// TEST SSR
// renderer.renderToString(req.url)
http
.createServer(function (req, res) {
serveStatic('.')(req, res, function () {
// TEST SSR
// renderer.renderToString(req.url)
// .then(html => res.end(html))
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end(fs.readFileSync('dev.html'))
res.writeHead(404, { 'Content-Type': 'text/html' })
res.end(fs.readFileSync('dev.html'))
})
})
}).listen(3000, '0.0.0.0')
.listen(3000, '0.0.0.0')
console.log(`\nListening at http://0.0.0.0:3000\n`)
+4 -1
View File
@@ -7,5 +7,8 @@ var file = __dirname + '/../docs/_coverpage.md'
var cover = read(file, 'utf8').toString()
console.log('Replace version number in cover page...')
cover = cover.replace(/<small>(\S+)?<\/small>/g, '<small>' + version + '</small>')
cover = cover.replace(
/<small>(\S+)?<\/small>/g,
'<small>' + version + '</small>'
)
write(file, cover)
+15 -12
View File
@@ -4,15 +4,17 @@ var resolve = require('path').resolve
var postcss = require('postcss')
var isProd = process.argv[process.argv.length - 1] !== '--dev'
var processor = postcss([require('postcss-salad')({
features: {
precss: {
properties: {
preserve: true
var processor = postcss([
require('postcss-salad')({
features: {
precss: {
properties: {
preserve: true
}
}
}
}
})])
})
])
var saveMin = function (file, content) {
fs.writeFileSync(resolve(__dirname, '../lib/themes/', file), content)
@@ -31,17 +33,18 @@ var list = fs.readdirSync(resolve(__dirname, '../src/themes'))
list.forEach(function (file) {
if (!/\.css$/.test(file)) return
processor.process(load(file), { from: resolve(__dirname, '../src/themes/', file) })
processor
.process(load(file), { from: resolve(__dirname, '../src/themes/', file) })
.then(function (result) {
save(file, result.css)
console.log('salad - ' + file)
isProd && cssnano(loadLib(file))
.then(function (result) {
isProd &&
cssnano(loadLib(file)).then(function (result) {
saveMin(file, result.css)
console.log('cssnao - ' + file)
})
}).catch(function (err) {
})
.catch(function (err) {
console.log(err)
})
})
+1 -1
View File
@@ -17,7 +17,7 @@ rollup
}
})
],
onwarn: function() {}
onwarn: function () {}
})
.then(function (bundle) {
var dest = 'packages/docsify-server-renderer/build.js'
+9 -10
View File
@@ -28,7 +28,6 @@ var build = function (opts) {
console.log(dest)
bundle.write({
format: 'iife',
moduleName: opts.moduleName || 'D',
dest: dest
})
})
@@ -43,19 +42,20 @@ build({
})
var plugins = [
{ name: 'search', entry: 'search/index.js', moduleName: 'Search' },
{ name: 'ga', entry: 'ga.js', moduleName: 'GA' },
{ name: 'emoji', entry: 'emoji.js', moduleName: 'Emoji' },
{ name: 'external-script', entry: 'external-script.js', moduleName: 'ExternalScript' },
{ name: 'front-matter', entry: 'front-matter/index.js', moduleName: 'FrontMatter' },
{ name: 'zoom-image', entry: 'zoom-image.js', moduleName: 'ZoomImage' }
{ name: 'search', entry: 'search/index.js' },
{ name: 'ga', entry: 'ga.js' },
{ name: 'emoji', entry: 'emoji.js' },
{ name: 'external-script', entry: 'external-script.js' },
{ name: 'front-matter', entry: 'front-matter/index.js' },
{ name: 'zoom-image', entry: 'zoom-image.js' },
{ name: 'disqus', entry: 'disqus.js' },
{ name: 'gitalk', entry: 'gitalk.js' }
]
plugins.forEach(item => {
build({
entry: 'plugins/' + item.entry,
output: 'plugins/' + item.name + '.js',
moduleName: 'D.' + item.moduleName
output: 'plugins/' + item.name + '.js'
})
})
@@ -69,7 +69,6 @@ if (isProd) {
build({
entry: 'plugins/' + item.entry,
output: 'plugins/' + item.name + '.min.js',
moduleName: 'D.' + item.moduleName,
plugins: [uglify()]
})
})
+9 -1
View File
@@ -29,10 +29,18 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
# commit
git add -A
git add -f lib/ -A
git commit -m "[build] $VERSION $RELEASE_TAG"
npm version $VERSION --message "[release] $VERSION $RELEASE_TAG"
npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG"
# changelog
node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s
git add .
git commit -m "chore: add changelog $VERSION"
# publish
git tag v$VERSION
git push origin refs/tags/v$VERSION
git push
if [[ -z $RELEASE_TAG ]]; then
+35 -33
View File
@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<title>docsify</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="/themes/vue.css" title="vue">
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled>
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled>
@@ -15,37 +16,38 @@
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
alias: {
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
'/.*/_navbar.md': '/_navbar.md'
},
auto2top: true,
basePath: '/docs/',
executeScript: true,
loadNavbar: true,
loadSidebar: true,
coverpage: true,
name: 'docsify',
subMaxLevel: 2,
mergeNavbar: true,
formatUpdated: '{MM}/{DD} {HH}:{mm}',
plugins: [
function(hook, vm) {
hook.beforeEach(function (html) {
var url = 'https://github.com/QingWei-Li/docsify/blob/master/' + vm.route.file
var editHtml = '[:memo: Edit Document](' + url + ')\n'
return editHtml
+ html
+ '\n----\n'
+ 'Last modified {docsify-updated} '
+ editHtml
})
}
]
}
</script>
<script src="/lib/docsify.js"></script>
</body>
<script>
window.$docsify = {
alias: {
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
},
auto2top: true,
basePath: '/docs/',
executeScript: true,
loadNavbar: true,
loadSidebar: true,
coverpage: true,
name: 'docsify',
subMaxLevel: 0,
mergeNavbar: true,
formatUpdated: '{MM}/{DD} {HH}:{mm}',
plugins: [
function(hook, vm) {
hook.beforeEach(function (html) {
var url = 'https://github.com/QingWei-Li/docsify/blob/master/' + vm.route.file
var editHtml = '[:memo: Edit Document](' + url + ')\n'
return editHtml
+ html
+ '\n----\n'
+ 'Last modified {docsify-updated} '
+ editHtml
})
}
]
}
</script>
<script src="/lib/docsify.js"></script>
</html>
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>4.2.0</small>
# docsify <small>4.5.6</small>
> A magical documentation site generator.
+2 -1
View File
@@ -257,7 +257,8 @@ window.$docsify = {
alias: {
'/foo/(+*)': '/bar/$1', // supports regexp
'/zh-cn/changelog': '/changelog',
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
'/.*/_sidebar.md': '/_sidebar.md' // See #301
}
}
```
+2 -1
View File
@@ -257,7 +257,8 @@ window.$docsify = {
alias: {
'/foo/(+*)': '/bar/$1', // supports regexp
'/zh-cn/changelog': '/changelog',
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
'/.*/_sidebar.md': '/_sidebar.md' // See #301
}
}
```
+24
View File
@@ -16,6 +16,30 @@ Es wird empfohlen, deine Dateien im `./docs` Unterordner im `master` branch dein
!> Du kannst die Dateien auch im Hauptverzeichnis speichern und dann `master branch` in den Einstellungen auswählen.
## GitLab Pages
If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
``` YAML
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
```
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
## VPS
Verwende folgende nginx config.
+27
View File
@@ -49,3 +49,30 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
<a href="/demo/" title="title">link</a>
```
## Set target attribute for link
```md
[link](/demo ":target=_blank")
[link](/demo2 ":target=_self")
```
## Github Task Lists
```md
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
```
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
+27
View File
@@ -28,3 +28,30 @@ window.$docsify = {
}
}
```
## Supports mermaid
```js
// Import mermaid
// <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>
mermaid.initialize({ startOnLoad: false });
window.$docsify = {
markdown: {
renderer: {
code: function(code, lang) {
if (lang === "mermaid") {
return (
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
);
}
return this.origin.code.apply(this, arguments);
}
}
}
}
```
+15 -2
View File
@@ -35,7 +35,10 @@ Als Standardeinstellung werden Hyperlinks auf der aktuellen Seite erkannt und de
noData: {
'/de-de/': 'Keine Ergebnisse',
'/': 'No Results'
}
},
// Headline depth, 1 - 6
depth: 2
}
}
</script>
@@ -88,8 +91,18 @@ Wenn das Skript auf der Seite ein externes ist (eine Javascript Datei über das
## Bilder zoomen
Medium's Bilderzoom. Basierend auf [zoom-image](https://github.com/egoist/zoom-image).
Medium's Bilderzoom. Basierend auf [medium-zoom](https://github.com/francoischalifour/medium-zoom).
```html
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.min.js"></script>
```
Exclude the special image
```markdown
![](image.png ':no-zoom')
```
## Edit on github
Add `Edit on github` button on every pages. provided by 3rd party, check [document](https://github.com/njleonzhang/docsify-edit-on-github)
+3 -1
View File
@@ -44,7 +44,9 @@ Wenn du `npm` nicht verwenden möchtest, oder Probleme bei der Installation des
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">dict.
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
</head>
<body>
+24 -1
View File
@@ -1,6 +1,6 @@
# Deploy
Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pages or VPS.
Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pages, GitLab Pages or VPS.
## GitHub Pages
@@ -15,6 +15,29 @@ It is recommended that you save your files to the `./docs` subfolder of the `mas
![github pages](_images/deploy-github-pages.png)
!> 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
## GitLab Pages
If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
``` YAML
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
```
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
## VPS
+32
View File
@@ -50,3 +50,35 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
<a href="/demo/" title="title">link</a>
```
## Set target attribute for link
```md
[link](/demo ":target=_blank")
[link](/demo2 ":target=_self")
```
## Disable link
```md
[link](/demo ":disabled")
```
## Github Task Lists
```md
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
```
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
+56 -52
View File
@@ -4,13 +4,14 @@
<meta charset="UTF-8">
<title>docsify</title>
<link rel="icon" href="_media/favicon.ico">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
<meta name="description" content="A magical documentation generator.">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@latest/lib/themes/vue.css" title="vue">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@latest/lib/themes/dark.css" title="dark" disabled>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@latest/lib/themes/buble.css" title="buble" disabled>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@latest/lib/themes/pure.css" title="pure" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" title="vue">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/dark.css" title="dark" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/buble.css" title="buble" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/pure.css" title="pure" disabled>
<style>
nav.app-nav li ul {
min-width: 100px;
@@ -19,54 +20,57 @@
</head>
<body>
<div id="app">Loading ...</div>
</body>
<script>
window.$docsify = {
alias: {
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
},
auto2top: true,
coverpage: true,
executeScript: true,
loadSidebar: true,
loadNavbar: true,
mergeNavbar: true,
maxLevel: 4,
subMaxLevel: 2,
name: 'docsify',
search: {
noData: {
'/de-de/': 'Keine Ergebnisse!',
'/zh-cn/': '没有结果!',
'/': 'No results!'
<script>
window.$docsify = {
alias: {
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
'/.*/_navbar.md': '/_navbar.md'
},
paths: 'auto',
placeholder: {
'/de-de/': 'Suche',
'/zh-cn/': '搜索',
'/': 'Search'
}
},
formatUpdated: '{MM}/{DD} {HH}:{mm}',
plugins: [
function(hook, vm) {
hook.beforeEach(function (html) {
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs/' + vm.route.file
var editHtml = '[:memo: Edit Document](' + url + ')\n'
auto2top: true,
coverpage: true,
executeScript: true,
loadSidebar: true,
loadNavbar: true,
mergeNavbar: true,
maxLevel: 4,
subMaxLevel: 2,
ga: 'UA-106147152-1',
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}',
plugins: [
function(hook, vm) {
hook.beforeEach(function (html) {
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs/' + vm.route.file
var editHtml = '[:memo: Edit Document](' + url + ')\n'
return editHtml
+ html
+ '\n----\n'
+ 'Last modified {docsify-updated} '
+ editHtml
})
}
]
}
</script>
<script src="//cdn.jsdelivr.net/npm/docsify@latest/lib/docsify.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify@latest/lib/plugins/search.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-markdown.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-nginx.min.js"></script>
return editHtml
+ html
+ '\n----\n'
+ 'Last modified {docsify-updated} '
+ editHtml
})
}
]
}
</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/ga.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-nginx.min.js"></script>
</body>
</html>
+1 -1
View File
@@ -1,6 +1,6 @@
# language highlight
**docsify** uses [Prism](https://github.com/PrismJS/prism) to highlight code blocks in your pages. By default it only supports CSS, JavaScipt and HTML. You can make **Prism** load additional languages:
**docsify** uses [Prism](https://github.com/PrismJS/prism) to highlight code blocks in your pages. By default it only supports CSS, JavaScript and HTML. You can make **Prism** load additional languages:
```html
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
+25
View File
@@ -28,3 +28,28 @@ window.$docsify = {
}
}
```
## Supports mermaid
```js
// Import mermaid
// <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>
mermaid.initialize({ startOnLoad: false });
window.$docsify = {
markdown: {
renderer: {
code: function(code, lang) {
if (lang === "mermaid") {
return (
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
);
}
return this.origin.code.apply(this, arguments);
}
}
}
}
```
+80 -2
View File
@@ -35,7 +35,10 @@ By default, the hyperlink on the current page is recognized and the content is s
noData: {
'/zh-cn/': '找不到结果',
'/': 'No Results'
}
},
// Headline depth, 1 - 6
depth: 2
}
}
</script>
@@ -88,8 +91,83 @@ If the script on the page is an external one (imports a js file via `src` attrib
## Zoom image
Medium's Image Zoom. Based on [zoom-image](https://github.com/egoist/zoom-image).
Medium's image zoom. Based on [medium-zoom](https://github.com/francoischalifour/medium-zoom).
```html
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.min.js"></script>
```
Exclude the special image
```markdown
![](image.png ':no-zoom')
```
## Edit on github
Add `Edit on github` button on every pages. provided by 3rd party, check [document](https://github.com/njleonzhang/docsify-edit-on-github)
## Demo code with instant preview and jsfiddle integration
With this plugin, sample code can be rendered on the page instantly, so that the readers can see the preview immediately.
When readers expand the demo box, the source code and description are shown there. if they click the button `Try in Jsfiddle`,
`jsfiddle.net` will be open with the code of this sample, which allow readers to revise the code and try on their own.
[Vue](https://njleonzhang.github.io/docsify-demo-box-vue/) and [React](https://njleonzhang.github.io/docsify-demo-box-react/) are both supported.
## Copy to Clipboard
Add a simple `Click to copy` button to all preformatted code blocks to effortlessly allow users to copy example code from your docs.
```html
<link rel="stylesheet" href="//unpkg.com/docsify-copy-code/styles.css">
<script src="//unpkg.com/docsify-copy-code/index.js"></script>
```
```javascript
window.$docsify = {
plugins: [
window.DocsifyCopyCodePlugin.init()
]
}
```
See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.
## Disqus
Disqus comments. https://disqus.com/
```html
<script>
window.$docsify = {
disqus: 'shortname'
}
</script>
<script src="//unpkg.com/docsify/lib/plugins/disqus.min.js"></script>
```
## Gitalk
Gitalk is a modern comment component based on Github Issue and Preact. https://github.com/gitalk/gitalk
```html
<link rel="stylesheet" href="//unpkg.com/gitalk/dist/gitalk.css">
<script src="//unpkg.com/docsify/lib/plugins/gitalk.min.js"></script>
<script src="//unpkg.com/gitalk/dist/gitalk.min.js"></script>
<script>
const gitalk = new Gitalk({
clientID: 'Github Application Client ID',
clientSecret: 'Github Application Client Secret',
repo: 'Github repo',
owner: 'Github repo owner',
admin: ['Github repo collaborators, only these guys can initialize github issues'],
// facebook-like distraction free mode
distractionFreeMode: false
})
</script>
```
+2
View File
@@ -44,6 +44,8 @@ If you don't like `npm` or have trouble installing the tool, you can manually cr
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
</head>
+3 -3
View File
@@ -19,7 +19,7 @@ Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main'
*README.md*
```markdown
````markdown
# Vue guide
`v-for` usage.
@@ -28,12 +28,12 @@ Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main'
<ul>
<li v-for="i in 10">{{ i }}</li>
</ul>
``
```
<ul>
<li v-for="i in 10">{{ i }}</li>
</ul>
```
````
You can manually initialize a Vue instance.
+6 -5
View File
@@ -266,7 +266,8 @@ window.$docsify = {
alias: {
'/foo/(+*)': '/bar/$1', // supports regexp
'/zh-cn/changelog': '/changelog',
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
'/.*/_sidebar.md': '/_sidebar.md' // See #301
}
}
```
@@ -329,7 +330,7 @@ window.$docsify = {
## format-updated
我们可以显示文档更新日期通过 **{docsify-updated<span>}</span>** 变量. 并且格式化日期通过 `formatUpdated`.
我们可以显示文档更新日期通过 **{docsify-updated<span>}</span>** 变量. 并且格式化日期通过 `formatUpdated`
参考 https://github.com/lukeed/tinydate#patterns
```js
window.$docsify = {
@@ -345,7 +346,7 @@ window.$docsify = {
## external-link-target
Currently it defaults to _blank, would be nice if configurable:
当前默认为 _blank, 配置一下就可以:
```js
window.$docsify = {
@@ -356,10 +357,10 @@ window.$docsify = {
## noCompileLinks
- type: `Array`
- 类型: `Array`
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/QingWei-Li/docsify/issues/203)
有时我们不希望 docsify 处理我们的链接。 参考 [#203](https://github.com/QingWei-Li/docsify/issues/203)
```js
+24
View File
@@ -15,6 +15,30 @@ GitHub Pages 支持从三个地方读取文件
!> 可以将文档放在根目录下,然后选择 **master 分支** 作为文档目录。
## GitLab Pages
如果你正在部署你的主分支, 在 `.gitlab-ci.yml` 中包含以下脚本:
?> `.public` 的解决方法是这样的,`cp` 不会无限循环的将 `public/` 复制到自身。
``` YAML
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
```
!> 你可以用 `- cp -r docs/. public` 替换脚本, 如果 `./docs` 是你的 docsify 子文件夹。
## VPS
和部署所有静态网站一样,只需将服务器的访问根目录设定为 `index.html` 文件。
+32 -5
View File
@@ -25,23 +25,23 @@ docsify 扩展了一些 Markdown 语法,可以让文档更易读。
?> *TODO* 完善示例
## Ignore to compile link
## 忽略编译链接
Some time we will put some other relative path to the link, you have to need to tell docsify you don't need to compile this link. For example
有时候我们会把其他一些相对路径放到链接上,你必须告诉 docsify 你不需要编译这个链接。 例如:
```md
[link](/demo/)
```
It will be compiled to `<a href="/#/demo/">link</a>` and will be loaded `/demo/README.md`. Maybe you want to jump to `/demo/index.html`.
它将被编译为 `<a href="/#/demo/">link</a>` 并将加载 `/demo/README.md`. 可能你想跳转到 `/demo/index.html`
Now you can do that
现在你可以做到这一点
```md
[link](/demo/ ":ignore")
```
You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set title for link.
即将会得到 `<a href="/demo/">link</a>` html 代码。不要担心,你仍然可以为链接设置标题。
```md
[link](/demo/ ":ignore title")
@@ -49,3 +49,30 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
<a href="/demo/" title="title">link</a>
```
## 设置链接的 target 属性
```md
[link](/demo ":target=_blank")
[link](/demo2 ":target=_self")
```
## Github 任务列表
```md
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
```
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
+27 -1
View File
@@ -27,4 +27,30 @@ window.$docsify = {
return marked
}
}
```
```
## 支持 mermaid
```js
// Import mermaid
// <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>
mermaid.initialize({ startOnLoad: false });
window.$docsify = {
markdown: {
renderer: {
code: function(code, lang) {
if (lang === "mermaid") {
return (
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
);
}
return this.origin.code.apply(this, arguments);
}
}
}
}
```
+6 -6
View File
@@ -63,25 +63,25 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
<script src="//unpkg.com/docsify"></script>
```
## Ignoring Subheaders
## 忽略副标题
When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it.
当设置了 `subMaxLevel` 时,默认情况下每个标题都会自动添加到目录中。如果你想忽略特定的标题,可以给它添加 `{docsify-ignore}`
```markdown
# Getting Started
## Header {docsify-ignore}
This header won't appear in the sidebar table of contents.
该标题不会出现在侧边栏的目录中。
```
To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
要忽略特定页面上的所有标题,你可以在页面的第一个标题上使用 `{docsify-ignore-all}`
```markdown
# Getting Started {docsify-ignore-all}
## Header
This header won't appear in the sidebar table of contents.
该标题不会出现在侧边栏的目录中。
```
Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used.
在使用时, `{docsify-ignore}` `{docsify-ignore-all}` 都不会在页面上呈现。
+18 -2
View File
@@ -35,7 +35,10 @@
noData: {
'/zh-cn/': '找不到结果',
'/': 'No Results'
}
},
// 搜索标题的最大程级, 1 - 6
depth: 2
}
}
</script>
@@ -82,8 +85,21 @@
## 图片缩放 - Zoom image
Medium's 风格的图片缩放插件. 基于 [zoom-image](https://github.com/egoist/zoom-image)。
Medium's 风格的图片缩放插件. 基于 [medium-zoom](https://github.com/francoischalifour/medium-zoom)。
```html
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.js"></script>
```
忽略某张图片
```markdown
![](image.png ':no-zoom')
```
## 在 Github 上编辑
在每一页上添加 `Edit on github` 按钮. 由第三方库提供, 查看 [document](https://github.com/njleonzhang/docsify-edit-on-github)
+2
View File
@@ -44,6 +44,8 @@ docsify serve docs
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
</head>
+452 -189
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
File diff suppressed because one or more lines are too long
+56
View File
@@ -0,0 +1,56 @@
(function () {
'use strict';
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', +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
View File
@@ -0,0 +1 @@
!function(){"use strict";function i(i,t){var e=Docsify.dom,o=t.config.disqus;if(!o)throw Error("$docsify.disqus is required");i.init(function(i){var t=e.create("script");t.async=!0,t.src="https://"+o+".disqus.com/embed.js",t.setAttribute("data-timestamp",+new Date),e.appendTo(e.body,t)}),i.mounted(function(i){var o=e.create("div");o.id="disqus_thread";var n=e.getNode("#main");o.style="width: "+n.clientWidth+"px; margin: 0 auto 20px;",e.appendTo(e.find(".content"),o),window.disqus_config=function(){this.page.url=location.origin+"/-"+t.route.path,this.page.identifier=t.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+"/-"+t.route.path,this.page.identifier=t.route.path,this.page.title=document.title}})})}var t=location.href.replace("/-/","/#/");t!==location.href&&(location.href=t),$docsify.plugins=[].concat(i,$docsify.plugins)}();
+893 -147
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
-1
View File
@@ -1,4 +1,3 @@
this.D = this.D || {};
(function () {
'use strict';
+1 -1
View File
@@ -1 +1 @@
this.D=this.D||{},function(){"use strict";function e(){for(var e=Docsify.dom.getNode("#main"),i=Docsify.dom.findAll(e,"script"),o=i.length;o--;){var t=i[o];if(t&&t.src){var n=document.createElement("script");Array.prototype.slice.call(t.attributes).forEach(function(e){n[e.name]=e.value}),t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)}}}var i=function(i){i.doneEach(e)};window.$docsify.plugins=[].concat(i,window.$docsify.plugins)}();
!function(){"use strict";function e(){for(var e=Docsify.dom.getNode("#main"),o=Docsify.dom.findAll(e,"script"),n=o.length;n--;){var i=o[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(e){t[e.name]=e.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}var o=function(o){o.doneEach(e)};window.$docsify.plugins=[].concat(o,window.$docsify.plugins)}();
+327 -332
View File
@@ -1,4 +1,3 @@
this.D = this.D || {};
(function () {
'use strict';
@@ -33,386 +32,381 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* @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("([^\\\'\\\"#]+([\\\'\\\"][^\\\'\\\"]*[\\\'\\\"])*)*(#.*)?")
};
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;
}
};
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 regLevel = regex$1['regLevel'];
var invalidLine = regex$1['invalidLine'];
var lines = str.split('\n');
var m;
var level = 0,
curLevel = 0;
var blocks = [];
var blocks = [];
var result = new Block(-1);
var currentBlock = new Block(0);
result.addChild(currentBlock);
var levels = [];
var line = "";
var result = new Block(-1);
var currentBlock = new Block(0);
result.addChild(currentBlock);
var levels = [];
var line = '';
blocks.push(currentBlock);
levels.push(level);
blocks.push(currentBlock);
levels.push(level);
for(var i = 0, len = lines.length; i < len; ++i) {
line = lines[i];
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;
if (line.match(invalidLine)) {
continue
}
return result;
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;
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 (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
}
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;
}
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
}
if(content.length > 0)
{ res.push(content); }
content += c;
}
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]);
}
}
if (content.length > 0) { res.push(content); }
return newRes;
} else
{ return val; }
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");
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;
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 m = null;
var res = {};
var lines = null;
var children = null;
var currentObj = null;
var level = -1;
var level = -1;
var processedBlocks = [];
var processedBlocks = [];
var isMap = true;
var isMap = true;
for(var j = 0, lenJ = blocks.length; j < lenJ; ++j) {
for (var j = 0, lenJ = blocks.length; j < lenJ; ++j) {
if (level != -1 && level != blocks[j].level) { continue }
if(level != -1 && level != blocks[j].level)
{ continue; }
processedBlocks.push(j);
processedBlocks.push(j);
level = blocks[j].level;
lines = blocks[j].lines;
children = blocks[j].children;
currentObj = null;
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];
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(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 (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(currentObj != null) {
if (isMap) {
isMap = false;
if (typeof(res.length) === "undefined") {
res = [];
}
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; }
}
res.push(currentObj);
} 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
}
}
for(var j = processedBlocks.length - 1; j >= 0; --j) {
blocks.splice.call(blocks, processedBlocks[j], 1);
if (currentObj != null) {
if (isMap) {
isMap = false;
if (typeof res.length === 'undefined') {
res = [];
}
}
res.push(currentObj);
}
}
return res;
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;
var res = processBlock(blocks.children);
return res
}
function preProcess(src) {
var m;
var lines = src.split("\n");
var m;
var lines = src.split('\n');
var r = regex$1["comment"];
var r = regex$1['comment'];
for(var i in lines) {
if(m = lines[i].match(r)) {
/* var cmt = "";
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")
@@ -420,25 +414,25 @@ function preProcess(src) {
else
lines[i] = "";
*/
if(typeof m[3] !== "undefined") {
lines[i] = m[0].substr(0, m[0].length - m[3].length);
}
}
if (typeof m[3] !== 'undefined') {
lines[i] = m[0].substr(0, m[0].length - m[3].length);
}
}
}
return lines.join("\n");
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;
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;
return res
}
/**
@@ -446,7 +440,8 @@ function load(str) {
*/
/* eslint-disable */
var optionalByteOrderMark = '\\ufeff?';
var pattern = '^(' +
var pattern =
'^(' +
optionalByteOrderMark +
'(= yaml =|---)' +
'$([\\s\\S]*?)' +
@@ -458,7 +453,7 @@ var pattern = '^(' +
// need to be moved down into the functions that use it.
var regex = new RegExp(pattern, 'm');
function extractor (string) {
function extractor(string) {
string = string || '';
var lines = string.split(/(\r?\n)/);
@@ -469,7 +464,7 @@ function extractor (string) {
}
}
function parse (string) {
function parse(string) {
var match = regex.exec(string);
if (!match) {
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -4
View File
@@ -1,4 +1,3 @@
this.D = this.D || {};
(function () {
'use strict';
@@ -12,9 +11,11 @@ function appendScript () {
function init (id) {
appendScript();
window.ga = window.ga || function () {
(window.ga.q = window.ga.q || []).push(arguments);
};
window.ga =
window.ga ||
function () {
(window.ga.q = window.ga.q || []).push(arguments);
};
window.ga.l = Number(new Date());
window.ga('create', id, 'auto');
}
+1 -1
View File
@@ -1 +1 @@
this.D=this.D||{},function(){"use strict";function n(){var n=document.createElement("script");n.async=!0,n.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(n)}function i(i){n(),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",i,"auto")}function o(){window.ga||i($docsify.ga),window.ga("set","page",location.hash),window.ga("send","pageview")}var a=function(n){if(!$docsify.ga)return void console.error("[Docsify] ga is required.");n.beforeEach(o)};$docsify.plugins=[].concat(a,$docsify.plugins)}();
!function(){"use strict";function n(){var n=document.createElement("script");n.async=!0,n.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(n)}function o(o){n(),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",o,"auto")}function i(){window.ga||o($docsify.ga),window.ga("set","page",location.hash),window.ga("send","pageview")}var a=function(n){if(!$docsify.ga)return void console.error("[Docsify] ga is required.");n.beforeEach(i)};$docsify.plugins=[].concat(a,$docsify.plugins)}();
+22
View File
@@ -0,0 +1,22 @@
(function () {
'use strict';
function install (hook, vm) {
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
View File
@@ -0,0 +1 @@
!function(){"use strict";function t(t,n){var i=Docsify.dom;t.mounted(function(t){var n=i.create("div");n.id="gitalk-container";var e=i.getNode("#main");n.style="width: "+e.clientWidth+"px; margin: 0 auto 20px;",i.appendTo(i.find(".content"),n);var o=i.create("script");o.textContent="gitalk.render('gitalk-container')",i.appendTo(i.body,o)})}$docsify.plugins=[].concat(t,$docsify.plugins)}();
+24 -12
View File
@@ -1,4 +1,3 @@
this.D = this.D || {};
(function () {
'use strict';
@@ -42,7 +41,7 @@ function saveData (maxAge) {
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS));
}
function genIndex (path, content, router) {
function genIndex (path, content, router, depth) {
if ( content === void 0 ) content = '';
var tokens = window.marked.lexer(content);
@@ -51,7 +50,7 @@ function genIndex (path, content, router) {
var slug;
tokens.forEach(function (token) {
if (token.type === 'heading' && token.depth <= 2) {
if (token.type === 'heading' && token.depth <= depth) {
slug = router.toURL(path, { id: slugify(token.text) });
index[slug] = { slug: slug, title: token.text, body: '' };
} else {
@@ -71,14 +70,22 @@ function genIndex (path, content, router) {
return index
}
function search (keywords) {
/**
* @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]; }));
});
keywords = [].concat(keywords, keywords.trim().split(/[\s\-\\\/]+/));
query = query.trim();
var keywords = query.split(/[\s\-\\\/]+/);
if (keywords.length !== 1) {
keywords = [].concat(query, keywords);
}
var loop = function ( i ) {
var post = data[i];
@@ -162,7 +169,7 @@ function init$1 (config, vm) {
helper
.get(vm.router.getFile(path))
.then(function (result) {
INDEXS[path] = genIndex(path, result, vm.router);
INDEXS[path] = genIndex(path, result, vm.router, config.depth);
len === ++count && saveData(config.maxAge);
});
});
@@ -172,8 +179,8 @@ var NO_DATA_TEXT = '';
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 .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: 7px;\n line-height: 22px;\n font-size: 14px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\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}";
var style = Docsify.dom.create('style', code);
Docsify.dom.appendTo(Docsify.dom.head, style);
Docsify.dom.style(code);
}
function tpl (opts, defaultValue) {
@@ -181,7 +188,7 @@ function tpl (opts, defaultValue) {
var html =
"<input type=\"search\" value=\"" + defaultValue + "\" />" +
'<div class="results-panel"></div>' +
'<div class="results-panel"></div>' +
'</div>';
var el = Docsify.dom.create('div', html);
var aside = Docsify.dom.find('aside');
@@ -203,7 +210,7 @@ function doSearch (value) {
var html = '';
matchs.forEach(function (post) {
html += "<div class=\"matching-post\">\n<h2><a href=\"" + (post.url) + "\">" + (post.title) + "</a></h2>\n<p>" + (post.content) + "</p>\n</div>";
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');
@@ -216,8 +223,11 @@ function bindEvents () {
var timeId;
// Prevent to Fold sidebar
Docsify.dom.on($search, 'click',
function (e) { return e.target.tagName !== 'A' && e.stopPropagation(); });
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);
@@ -263,6 +273,7 @@ var CONFIG = {
placeholder: 'Type to search',
noData: 'No Results!',
paths: 'auto',
depth: 2,
maxAge: 86400000 // 1 day
};
@@ -277,6 +288,7 @@ var install = function (hook, vm) {
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;
}
var isAuto = CONFIG.paths === 'auto';
+1 -1
View File
@@ -1 +1 @@
this.D=this.D||{},function(){"use strict";function e(e){var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return String(e).replace(/[&<>"'\/]/g,function(e){return n[e]})}function n(e){var n=[];return h.dom.findAll("a:not([data-nosearch])").map(function(t){var o=t.href,i=t.getAttribute("href"),r=e.parse(o).path;r&&-1===n.indexOf(r)&&!Docsify.util.isAbsolutePath(i)&&n.push(r)}),n}function t(e){localStorage.setItem("docsify.search.expires",Date.now()+e),localStorage.setItem("docsify.search.index",JSON.stringify(y))}function o(e,n,t){void 0===n&&(n="");var o,i=window.marked.lexer(n),r=window.Docsify.slugify,a={};return i.forEach(function(n){if("heading"===n.type&&n.depth<=2)o=t.toURL(e,{id:r(n.text)}),a[o]={slug:o,title:n.text,body:""};else{if(!o)return;a[o]?a[o].body?a[o].body+="\n"+(n.text||""):a[o].body=n.text:a[o]={slug:o,title:"",body:""}}}),r.clear(),a}function i(n){var t=[],o=[];Object.keys(y).forEach(function(e){o=o.concat(Object.keys(y[e]).map(function(n){return y[e][n]}))}),n=[].concat(n,n.trim().split(/[\s\-\\\\/]+/));for(var i=0;i<o.length;i++)!function(i){var r=o[i],a=!1,s="",c=r.title&&r.title.trim(),f=r.body&&r.body.trim(),l=r.slug||"";if(c&&f&&(n.forEach(function(n,t){var o=new RegExp(n,"gi"),i=-1,r=-1;if(i=c&&c.search(o),r=f&&f.search(o),i<0&&r<0)a=!1;else{a=!0,r<0&&(r=0);var l=0,d=0;l=r<11?0:r-10,d=0===l?70:r+n.length+60,d>f.length&&(d=f.length);var u="..."+e(f).substring(l,d).replace(o,'<em class="search-keyword">'+n+"</em>")+"...";s+=u}}),a)){var d={title:e(c),content:s,url:l};t.push(d)}}(i);return t}function r(e,i){h=Docsify;var r="auto"===e.paths,a=localStorage.getItem("docsify.search.expires")<Date.now();if(y=JSON.parse(localStorage.getItem("docsify.search.index")),a)y={};else if(!r)return;var s=r?n(i.router):e.paths,c=s.length,f=0;s.forEach(function(n){if(y[n])return f++;h.get(i.router.getFile(n)).then(function(r){y[n]=o(n,r,i.router),c===++f&&t(e.maxAge)})})}function a(){var e=Docsify.dom.create("style","\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 .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: 7px;\n line-height: 22px;\n font-size: 14px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\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}");Docsify.dom.appendTo(Docsify.dom.head,e)}function s(e,n){void 0===n&&(n="");var t='<input type="search" value="'+n+'" /><div class="results-panel"></div></div>',o=Docsify.dom.create("div",t),i=Docsify.dom.find("aside");Docsify.dom.toggleClass(o,"search"),Docsify.dom.before(i,o)}function c(e){var n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,".results-panel");if(!e)return t.classList.remove("show"),void(t.innerHTML="");var o=i(e),r="";o.forEach(function(e){r+='<div class="matching-post">\n<h2><a href="'+e.url+'">'+e.title+"</a></h2>\n<p>"+e.content+"</p>\n</div>"}),t.classList.add("show"),t.innerHTML=r||'<p class="empty">'+m+"</p>"}function f(){var e,n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,"input");Docsify.dom.on(n,"click",function(e){return"A"!==e.target.tagName&&e.stopPropagation()}),Docsify.dom.on(t,"input",function(n){clearTimeout(e),e=setTimeout(function(e){return c(n.target.value.trim())},100)})}function l(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var o=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];t.placeholder=e[o]}}function d(e,n){if("string"==typeof e)m=e;else{var t=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];m=e[t]}}function u(e,n){var t=n.router.parse().query.s;a(),s(e,t),f(),t&&setTimeout(function(e){return c(t)},500)}function p(e,n){l(e.placeholder,n.route.path),d(e.noData,n.route.path)}var h,y={},m="",g={placeholder:"Type to search",noData:"No Results!",paths:"auto",maxAge:864e5},v=function(e,n){var t=Docsify.util,o=n.config.search||g;Array.isArray(o)?g.paths=o:"object"==typeof o&&(g.paths=Array.isArray(o.paths)?o.paths:"auto",g.maxAge=t.isPrimitive(o.maxAge)?o.maxAge:g.maxAge,g.placeholder=o.placeholder||g.placeholder,g.noData=o.noData||g.noData);var i="auto"===g.paths;e.mounted(function(e){u(g,n),!i&&r(g,n)}),e.doneEach(function(e){p(g,n),i&&r(g,n)})};$docsify.plugins=[].concat(v,$docsify.plugins)}();
!function(){"use strict";function e(e){var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return String(e).replace(/[&<>"'\/]/g,function(e){return n[e]})}function n(e){var n=[];return h.dom.findAll("a:not([data-nosearch])").map(function(t){var o=t.href,i=t.getAttribute("href"),r=e.parse(o).path;r&&-1===n.indexOf(r)&&!Docsify.util.isAbsolutePath(i)&&n.push(r)}),n}function t(e){localStorage.setItem("docsify.search.expires",Date.now()+e),localStorage.setItem("docsify.search.index",JSON.stringify(g))}function o(e,n,t,o){void 0===n&&(n="");var i,r=window.marked.lexer(n),a=window.Docsify.slugify,s={};return r.forEach(function(n){if("heading"===n.type&&n.depth<=o)i=t.toURL(e,{id:a(n.text)}),s[i]={slug:i,title:n.text,body:""};else{if(!i)return;s[i]?s[i].body?s[i].body+="\n"+(n.text||""):s[i].body=n.text:s[i]={slug:i,title:"",body:""}}}),a.clear(),s}function i(n){var t=[],o=[];Object.keys(g).forEach(function(e){o=o.concat(Object.keys(g[e]).map(function(n){return g[e][n]}))}),n=n.trim();var i=n.split(/[\s\-\\\\/]+/);1!==i.length&&(i=[].concat(n,i));for(var r=0;r<o.length;r++)!function(n){var r=o[n],a=!1,s="",c=r.title&&r.title.trim(),l=r.body&&r.body.trim(),f=r.slug||"";if(c&&l&&(i.forEach(function(n,t){var o=new RegExp(n,"gi"),i=-1,r=-1;if(i=c&&c.search(o),r=l&&l.search(o),i<0&&r<0)a=!1;else{a=!0,r<0&&(r=0);var f=0,d=0;f=r<11?0:r-10,d=0===f?70:r+n.length+60,d>l.length&&(d=l.length);var p="..."+e(l).substring(f,d).replace(o,'<em class="search-keyword">'+n+"</em>")+"...";s+=p}}),a)){var d={title:e(c),content:s,url:f};t.push(d)}}(r);return t}function r(e,i){h=Docsify;var r="auto"===e.paths,a=localStorage.getItem("docsify.search.expires")<Date.now();if(g=JSON.parse(localStorage.getItem("docsify.search.index")),a)g={};else if(!r)return;var s=r?n(i.router):e.paths,c=s.length,l=0;s.forEach(function(n){if(g[n])return l++;h.get(i.router.getFile(n)).then(function(r){g[n]=o(n,r,i.router,e.depth),c===++l&&t(e.maxAge)})})}function a(){Docsify.dom.style("\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 .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: 7px;\n line-height: 22px;\n font-size: 14px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\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}")}function s(e,n){void 0===n&&(n="");var t='<input type="search" value="'+n+'" /><div class="results-panel"></div></div>',o=Docsify.dom.create("div",t),i=Docsify.dom.find("aside");Docsify.dom.toggleClass(o,"search"),Docsify.dom.before(i,o)}function c(e){var n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,".results-panel");if(!e)return t.classList.remove("show"),void(t.innerHTML="");var o=i(e),r="";o.forEach(function(e){r+='<div class="matching-post">\n<a href="'+e.url+'"> \n<h2>'+e.title+"</h2>\n<p>"+e.content+"</p>\n</a>\n</div>"}),t.classList.add("show"),t.innerHTML=r||'<p class="empty">'+y+"</p>"}function l(){var e,n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,"input");Docsify.dom.on(n,"click",function(e){return"A"!==e.target.tagName&&e.stopPropagation()}),Docsify.dom.on(t,"input",function(n){clearTimeout(e),e=setTimeout(function(e){return c(n.target.value.trim())},100)})}function f(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var o=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];t.placeholder=e[o]}}function d(e,n){if("string"==typeof e)y=e;else{var t=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];y=e[t]}}function p(e,n){var t=n.router.parse().query.s;a(),s(e,t),l(),t&&setTimeout(function(e){return c(t)},500)}function u(e,n){f(e.placeholder,n.route.path),d(e.noData,n.route.path)}var h,g={},y="",m={placeholder:"Type to search",noData:"No Results!",paths:"auto",depth:2,maxAge:864e5},v=function(e,n){var t=Docsify.util,o=n.config.search||m;Array.isArray(o)?m.paths=o:"object"==typeof o&&(m.paths=Array.isArray(o.paths)?o.paths:"auto",m.maxAge=t.isPrimitive(o.maxAge)?o.maxAge:m.maxAge,m.placeholder=o.placeholder||m.placeholder,m.noData=o.noData||m.noData,m.depth=o.depth||m.depth);var i="auto"===m.paths;e.mounted(function(e){p(m,n),!i&&r(m,n)}),e.doneEach(function(e){u(m,n),i&&r(m,n)})};$docsify.plugins=[].concat(v,$docsify.plugins)}();
+11 -289
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2727 -458
View File
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "4.2.0",
"version": "4.5.6",
"description": "A magical documentation generator.",
"author": {
"name": "qingwei-li",
@@ -20,7 +20,7 @@
"themes"
],
"scripts": {
"bootstrap": "npm i && lerna bootstrap",
"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'",
@@ -31,11 +31,13 @@
},
"dependencies": {
"marked": "^0.3.6",
"medium-zoom": "^0.2.0",
"prismjs": "^1.6.0",
"tinydate": "^1.0.0",
"zoom-image": "^0.1.4"
"tweezer.js": "^1.4.0"
},
"devDependencies": {
"conventional-changelog-cli": "^1.3.2",
"cssnano": "^3.10.0",
"eslint": "^3.18.0",
"eslint-config-vue": "^2.0.2",
+1 -1
View File
@@ -3,7 +3,7 @@
## Install
```bash
yarn add docsify-server-render
yarn add docsify-server-renderer
```
## Usage
+11 -11
View File
@@ -13,7 +13,9 @@ function cwd (...args) {
}
function mainTpl (config) {
let html = `<nav class="app-nav${config.repo ? '' : ' no-badge'}"><!--navbar--></nav>`
let html = `<nav class="app-nav${config.repo
? ''
: ' no-badge'}"><!--navbar--></nav>`
if (config.repo) {
html += tpl.corner(config.repo)
@@ -28,11 +30,7 @@ function mainTpl (config) {
}
export default class Renderer {
constructor ({
template,
config,
cache
}) {
constructor ({ template, config, cache }) {
this.html = template
this.config = config = Object.assign({}, config, {
routerMode: 'history'
@@ -43,7 +41,10 @@ export default class Renderer {
this.compiler = new Compiler(config, this.router)
this.router.getCurrentPath = () => this.url
this._renderHtml('inject-config', `<script>window.$docsify = ${JSON.stringify(config)}</script>`)
this._renderHtml(
'inject-config',
`<script>window.$docsify = ${JSON.stringify(config)}</script>`
)
this._renderHtml('inject-app', mainTpl(config))
this.template = this.html
@@ -52,9 +53,7 @@ export default class Renderer {
_getPath (url) {
const file = this.router.getFile(url)
return isAbsolutePath(file)
? file
: cwd(`./${file}`)
return isAbsolutePath(file) ? file : cwd(`./${file}`)
}
async renderToString (url) {
@@ -94,7 +93,8 @@ export default class Renderer {
switch (type) {
case 'sidebar':
html = this.compiler.sidebar(html, maxLevel) +
html =
this.compiler.sidebar(html, maxLevel) +
`<script>window.__SUB_SIDEBAR__ = ${JSON.stringify(
this.compiler.subSidebar(subMaxLevel)
)}</script>`
+41
View File
@@ -0,0 +1,41 @@
{
"lockfileVersion": 1,
"dependencies": {
"debug": {
"version": "2.6.8",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
"integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw="
},
"encoding": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s="
},
"iconv-lite": {
"version": "0.4.18",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.18.tgz",
"integrity": "sha512-sr1ZQph3UwHTR0XftSbK85OvBbxe/abLGzEnPENCQwmHf7sck8Oyu4ob3LgBxWWxRoM+QszeUyl7jbqapu2TqA=="
},
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"node-fetch": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.1.tgz",
"integrity": "sha512-j8XsFGCLw79vWXkZtMSmmLaOk9z5SQ9bV/tkbZVCqvgwzrjAGq66igobLofHtF63NvMTp2WjytpsNTGKa+XRIQ=="
},
"resolve-pathname": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-2.1.0.tgz",
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
}
},
"version": "4.5.6"
}
@@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
"version": "4.2.0",
"version": "4.5.6",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",
+31 -26
View File
@@ -1,32 +1,37 @@
import { merge, hyphenate, isPrimitive } from './util/core'
const config = merge({
el: '#app',
repo: '',
maxLevel: 6,
subMaxLevel: 0,
loadSidebar: null,
loadNavbar: null,
homepage: 'README.md',
coverpage: '',
basePath: '',
auto2top: false,
name: '',
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: '',
mergeNavbar: false,
formatUpdated: '',
externalLinkTarget: '_blank',
routerModel: 'hash',
noCompileLinks: []
}, window.$docsify)
const config = merge(
{
el: '#app',
repo: '',
maxLevel: 6,
subMaxLevel: 0,
loadSidebar: null,
loadNavbar: null,
homepage: 'README.md',
coverpage: '',
basePath: '',
auto2top: false,
name: '',
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: '',
mergeNavbar: false,
formatUpdated: '',
externalLinkTarget: '_blank',
routerMode: 'hash',
noCompileLinks: []
},
window.$docsify
)
const script = document.currentScript ||
[].slice.call(document.getElementsByTagName('script'))
const script =
document.currentScript ||
[].slice
.call(document.getElementsByTagName('script'))
.filter(n => /docsify\./.test(n.src))[0]
if (script) {
+1 -1
View File
@@ -5,7 +5,7 @@ import { scrollIntoView } from './scroll'
export function eventMixin (proto) {
proto.$resetEvents = function () {
scrollIntoView(this.route.query.id)
scrollIntoView(this.route.path, this.route.query.id)
sidebar.getAndActive(this.router, 'nav')
}
}
+57 -21
View File
@@ -1,15 +1,37 @@
import { isMobile } from '../util/env'
import * as dom from '../util/dom'
import Tweezer from 'tweezer.js'
const nav = {}
let hoverOver = false
let scroller = null
let enableScrollEvent = true
let coverHeight = 0
function highlight () {
function scrollTo (el) {
if (scroller) scroller.stop()
enableScrollEvent = false
scroller = new Tweezer({
start: window.pageYOffset,
end: el.getBoundingClientRect().top + window.pageYOffset,
duration: 500
})
.on('tick', v => window.scrollTo(0, v))
.on('done', () => {
enableScrollEvent = true
scroller = null
})
.begin()
}
function highlight (path) {
if (!enableScrollEvent) return
const sidebar = dom.getNode('.sidebar')
const anchors = dom.findAll('.anchor')
const wrap = dom.find(sidebar, '.sidebar-nav')
let active = dom.find(sidebar, 'li.active')
const top = dom.body.scrollTop
const doc = document.documentElement
const top = ((doc && doc.scrollTop) || document.body.scrollTop) - coverHeight
let last
for (let i = 0, len = anchors.length; i < len; i += 1) {
@@ -23,7 +45,7 @@ function highlight () {
}
}
if (!last) return
const li = nav[last.getAttribute('data-id')]
const li = nav[getNavKey(path, last.getAttribute('data-id'))]
if (!li || li === active) return
@@ -37,23 +59,22 @@ function highlight () {
const height = sidebar.clientHeight
const curOffset = 0
const cur = active.offsetTop + active.clientHeight + 40
const isInView = (
active.offsetTop >= wrap.scrollTop &&
cur <= wrap.scrollTop + height
)
const isInView =
active.offsetTop >= wrap.scrollTop && cur <= wrap.scrollTop + height
const notThan = cur - curOffset < height
const top = isInView
? wrap.scrollTop
: notThan
? curOffset
: cur - height
const top = isInView ? wrap.scrollTop : notThan ? curOffset : cur - height
sidebar.scrollTop = top
}
}
function getNavKey (path, id) {
return `${path}?id=${id}`
}
export function scrollActiveSidebar (router) {
if (isMobile) return
const cover = dom.find('.cover.show')
coverHeight = cover ? cover.offsetHeight : 0
const sidebar = dom.getNode('.sidebar')
const lis = dom.findAll(sidebar, 'li')
@@ -65,21 +86,36 @@ export function scrollActiveSidebar (router) {
let href = a.getAttribute('href')
if (href !== '/') {
href = router.parse(href).query.id
const { query: { id }, path } = router.parse(href)
if (id) href = getNavKey(path, id)
}
nav[decodeURIComponent(href)] = li
if (href) nav[decodeURIComponent(href)] = li
}
dom.off('scroll', highlight)
dom.on('scroll', highlight)
dom.on(sidebar, 'mouseover', () => { hoverOver = true })
dom.on(sidebar, 'mouseleave', () => { hoverOver = false })
if (isMobile) return
const path = router.getCurrentPath()
dom.off('scroll', () => highlight(path))
dom.on('scroll', () => highlight(path))
dom.on(sidebar, 'mouseover', () => {
hoverOver = true
})
dom.on(sidebar, 'mouseleave', () => {
hoverOver = false
})
}
export function scrollIntoView (id) {
export function scrollIntoView (path, id) {
if (!id) return
const section = dom.find('#' + id)
section && section.scrollIntoView()
section && scrollTo(section)
const li = nav[getNavKey(path, id)]
const sidebar = dom.getNode('.sidebar')
const active = dom.find(sidebar, 'li.active')
active && active.classList.remove('active')
li && li.classList.add('active')
}
const scrollEl = dom.$.scrollingElement || dom.$.documentElement
+16 -15
View File
@@ -16,9 +16,12 @@ export function btn (el, router) {
const sidebar = dom.getNode('.sidebar')
isMobile && dom.on(dom.body, 'click', _ =>
dom.body.classList.contains('close') && toggle()
)
isMobile &&
dom.on(
dom.body,
'click',
_ => dom.body.classList.contains('close') && toggle()
)
dom.on(sidebar, 'click', _ =>
setTimeout((_ => getAndActive(router, sidebar, true, true), 0))
)
@@ -51,19 +54,17 @@ export function getAndActive (router, el, isParent, autoTitle) {
const hash = router.toURL(router.getCurrentPath())
let target
links
.sort((a, b) => b.href.length - a.href.length)
.forEach(a => {
const href = a.getAttribute('href')
const node = isParent ? a.parentNode : a
links.sort((a, b) => b.href.length - a.href.length).forEach(a => {
const href = a.getAttribute('href')
const node = isParent ? a.parentNode : a
if (hash.indexOf(href) === 0 && !target) {
target = a
dom.toggleClass(node, 'add', 'active')
} else {
dom.toggleClass(node, 'remove', 'active')
}
})
if (hash.indexOf(href) === 0 && !target) {
target = a
dom.toggleClass(node, 'add', 'active')
} else {
dom.toggleClass(node, 'remove', 'active')
}
})
if (autoTitle) {
dom.$.title = target ? `${target.innerText} - ${title}` : title
+9 -5
View File
@@ -26,9 +26,13 @@ export function get (url, hasBar = false) {
return {
then: function (success, error = noop) {
if (hasBar) {
const id = setInterval(_ => progressbar({
step: Math.floor(Math.random() * 5 + 1)
}), 500)
const id = setInterval(
_ =>
progressbar({
step: Math.floor(Math.random() * 5 + 1)
}),
500
)
on('progress', progressbar)
on('loadend', evt => {
@@ -42,12 +46,12 @@ export function get (url, hasBar = false) {
if (target.status >= 400) {
error(target)
} else {
const result = cache[url] = {
const result = (cache[url] = {
content: target.response,
opt: {
updatedAt: xhr.getResponseHeader('last-modified')
}
}
})
success(result.content, result.opt)
}
+35 -19
View File
@@ -1,29 +1,31 @@
import { get } from './ajax'
import { callHook } from '../init/lifecycle'
import { getParentPath } from '../router/util'
import { getParentPath, stringifyQuery } from '../router/util'
import { noop } from '../util/core'
import { getAndActive } from '../event/sidebar'
function loadNested (path, file, next, vm, first) {
function loadNested (path, qs, file, next, vm, first) {
path = first ? path : path.replace(/\/$/, '')
path = getParentPath(path)
if (!path) return
get(vm.router.getFile(path + file))
.then(next, _ => loadNested(path, file, next, vm))
get(vm.router.getFile(path + file) + qs).then(next, _ =>
loadNested(path, qs, file, next, vm)
)
}
export function fetchMixin (proto) {
let last
proto._fetch = function (cb = noop) {
const { path } = this.route
const { path, query } = this.route
const qs = stringifyQuery(query, ['id'])
const { loadNavbar, loadSidebar } = this.config
// Abort last request
last && last.abort && last.abort()
last = get(this.router.getFile(path), true)
last = get(this.router.getFile(path) + qs, true)
// Current page is html
this.isHTML = /\.html$/g.test(path)
@@ -31,29 +33,42 @@ export function fetchMixin (proto) {
const loadSideAndNav = () => {
if (!loadSidebar) return cb()
const fn = result => { this._renderSidebar(result); cb() }
const fn = result => {
this._renderSidebar(result)
cb()
}
// Load sidebar
loadNested(path, loadSidebar, fn, this, true)
loadNested(path, qs, loadSidebar, fn, this, true)
}
// 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()
},
_ => {
this._renderMain(null)
loadSideAndNav()
}
)
// Load nav
loadNavbar &&
loadNested(path, loadNavbar, text => this._renderNav(text), this, true)
loadNested(
path,
qs,
loadNavbar,
text => this._renderNav(text),
this,
true
)
}
proto._fetchCover = function () {
const { coverpage } = this.config
const query = this.route.query
const root = getParentPath(this.route.path)
const path = this.router.getFile(root + coverpage)
@@ -63,8 +78,9 @@ export function fetchMixin (proto) {
}
this.coverIsHTML = /\.html$/g.test(path)
get(path)
.then(text => this._renderCover(text))
get(path + stringifyQuery(query, ['id'])).then(text =>
this._renderCover(text)
)
}
proto.$fetch = function (cb = noop) {
+14 -1
View File
@@ -5,6 +5,19 @@ import { fetchMixin } from './fetch'
import { eventMixin } from './event'
import initGlobalAPI from './global-api'
/**
* Fork https://github.com/bendrucker/document-ready/blob/master/index.js
*/
function ready (callback) {
const state = document.readyState
if (state === 'complete' || state === 'interactive') {
return setTimeout(callback, 0)
}
document.addEventListener('DOMContentLoaded', callback)
}
function Docsify () {
this._init()
}
@@ -30,4 +43,4 @@ Docsify.version = '__VERSION__'
/**
* Run Docsify
*/
setTimeout(_ => new Docsify(), 0)
ready(_ => new Docsify())
+1 -1
View File
@@ -13,7 +13,7 @@ export function initLifecycle (vm) {
vm._hooks = {}
vm._lifecycle = {}
hooks.forEach(hook => {
const arr = vm._hooks[hook] = []
const arr = (vm._hooks[hook] = [])
vm._lifecycle[hook] = fn => arr.push(fn)
})
}
+80 -22
View File
@@ -8,6 +8,20 @@ import { isAbsolutePath, getPath } from '../router/util'
import { isFn, merge, cached } from '../util/core'
const cachedLinks = {}
function getAndRemoveConfig (str = '') {
const config = {}
if (str) {
str = str
.replace(/:([\w-]+)=?([\w-]+)?/g, (m, key, value) => {
config[key] = value || true
return ''
})
.trim()
}
return { str, config }
}
export class Compiler {
constructor (config, router) {
@@ -25,9 +39,11 @@ export class Compiler {
if (isFn(mdConf)) {
compile = mdConf(marked, renderer)
} else {
marked.setOptions(merge(mdConf, {
renderer: merge(renderer, mdConf.renderer)
}))
marked.setOptions(
merge(mdConf, {
renderer: merge(renderer, mdConf.renderer)
})
)
compile = marked
}
@@ -61,11 +77,13 @@ export class Compiler {
const renderer = new marked.Renderer()
const { linkTarget, router, contentBase } = this
const _self = this
const origin = {}
/**
* render anchor tag
* @link https://github.com/chjj/marked#overriding-renderer-methods
*/
renderer.heading = function (text, level) {
origin.heading = renderer.heading = function (text, level) {
const nextToc = { level, title: text }
if (/{docsify-ignore}/g.test(text)) {
@@ -88,29 +106,46 @@ export class Compiler {
return `<h${level} id="${slug}"><a href="${url}" data-id="${slug}" class="anchor"><span>${text}</span></a></h${level}>`
}
// highlight code
renderer.code = function (code, lang = '') {
const hl = Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
origin.code = renderer.code = function (code, lang = '') {
const hl = Prism.highlight(
code,
Prism.languages[lang] || Prism.languages.markup
)
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
}
renderer.link = function (href, title, text) {
let blank = ''
origin.link = renderer.link = function (href, title = '', text) {
let attrs = ''
if (!/:|(\/{2})/.test(href) &&
const { str, config } = getAndRemoveConfig(title)
title = str
if (
!/:|(\/{2})/.test(href) &&
!_self.matchNotCompileLink(href) &&
!/(\s?:ignore)(\s\S+)?$/.test(title)) {
!config.ignore
) {
href = router.toURL(href, null, router.getCurrentPath())
} else {
blank = ` target="${linkTarget}"`
title = title && title.replace(/:ignore/g, '').trim()
attrs += ` target="${linkTarget}"`
}
if (config.target) {
attrs += ' target=' + config.target
}
if (config.disabled) {
attrs += ' disabled'
href = 'javascript:void(0)'
}
if (title) {
title = ` title="${title}"`
attrs += ` title="${title}"`
}
return `<a href="${href}"${title || ''}${blank}>${text}</a>`
return `<a href="${href}"${attrs}>${text}</a>`
}
renderer.paragraph = function (text) {
origin.paragraph = renderer.paragraph = function (text) {
if (/^!&gt;/.test(text)) {
return helperTpl('tip', text)
} else if (/^\?&gt;/.test(text)) {
@@ -118,17 +153,39 @@ export class Compiler {
}
return `<p>${text}</p>`
}
renderer.image = function (href, title, text) {
origin.image = renderer.image = function (href, title, text) {
let url = href
const titleHTML = title ? ` title="${title}"` : ''
let attrs = ''
const { str, config } = getAndRemoveConfig(title)
title = str
if (config['no-zoom']) {
attrs += ' data-no-zoom'
}
if (title) {
attrs += ` title="${title}"`
}
if (!isAbsolutePath(href)) {
url = getPath(contentBase, href)
}
return `<img src="${url}" data-origin="${href}" alt="${text}"${titleHTML}>`
return `<img src="${url}"data-origin="${href}" alt="${text}"${attrs}>`
}
const CHECKED_RE = /^\[([ x])\] +/
origin.listitem = renderer.listitem = function (text) {
const checked = CHECKED_RE.exec(text)
if (checked) {
text = text.replace(CHECKED_RE, `<input type="checkbox" ${checked[1] === 'x' ? 'checked' : ''} />`)
}
return `<li${checked ? ` class="task-list-item"` : ''}>${text}</li>\n`
}
renderer.origin = origin
return renderer
}
@@ -162,11 +219,12 @@ export class Compiler {
const currentPath = this.router.getCurrentPath()
const { cacheTree, toc } = this
toc[0] && toc[0].ignoreAllSubs && (this.toc = [])
toc[0] && toc[0].ignoreAllSubs && toc.splice(0)
toc[0] && toc[0].level === 1 && toc.shift()
toc.forEach((node, i) => {
node.ignoreSubHeading && toc.splice(i, 1)
})
for (let i = 0; i < toc.length; i++) {
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--
}
const tree = cacheTree[currentPath] || genTree(toc, level)
+3 -1
View File
@@ -211,7 +211,9 @@ export function initRender (vm) {
dom.before(navAppendToTarget, navEl)
if (config.themeColor) {
dom.$.head.innerHTML += tpl.theme(config.themeColor)
dom.$.head.appendChild(
dom.create('div', tpl.theme(config.themeColor)).firstElementChild
)
// Polyfll
cssVars(config.themeColor)
}
+8 -2
View File
@@ -1,10 +1,16 @@
let cache = {}
const re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g
function lower (string) {
return string.toLowerCase()
}
export function slugify (str) {
if (typeof str !== 'string') return ''
let slug = str.toLowerCase().trim()
let slug = str
.trim()
.replace(/[A-Z]+/g, lower)
.replace(/<[^>\d]+>/g, '')
.replace(re, '')
.replace(/\s/g, '-')
@@ -12,7 +18,7 @@ export function slugify (str) {
.replace(/^(\d)/, '_$1')
let count = cache[slug]
count = cache.hasOwnProperty(slug) ? (count + 1) : 0
count = cache.hasOwnProperty(slug) ? count + 1 : 0
cache[slug] = count
if (count) {
+29 -23
View File
@@ -10,37 +10,40 @@ export function corner (data) {
data = data.replace(/^git\+/, '')
return (
`<a href="${data}" class="github-corner" aria-label="View source on Github">` +
`<a href="${data}" class="github-corner" aria-label="View source on Github">` +
'<svg viewBox="0 0 250 250" aria-hidden="true">' +
'<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>' +
'<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>' +
'<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>' +
'<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>' +
'<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>' +
'<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>' +
'</svg>' +
'</a>')
'</a>'
)
}
/**
* Render main content
*/
export function main (config) {
const aside = (
const aside =
'<button class="sidebar-toggle">' +
'<div class="sidebar-toggle-button">' +
'<span></span><span></span><span></span>' +
'</div>' +
'<div class="sidebar-toggle-button">' +
'<span></span><span></span><span></span>' +
'</div>' +
'</button>' +
'<aside class="sidebar">' +
(config.name
? `<h1><a class="app-name-link" data-nosearch>${config.name}</a></h1>`
: '') +
'<div class="sidebar-nav"><!--sidebar--></div>' +
'</aside>')
(config.name
? `<h1><a class="app-name-link" data-nosearch>${config.name}</a></h1>`
: '') +
'<div class="sidebar-nav"><!--sidebar--></div>' +
'</aside>'
return (isMobile ? `${aside}<main>` : `<main>${aside}`) +
'<section class="content">' +
'<article class="markdown-section" id="main"><!--main--></article>' +
'</section>' +
return (
(isMobile ? `${aside}<main>` : `<main>${aside}`) +
'<section class="content">' +
'<article class="markdown-section" id="main"><!--main--></article>' +
'</section>' +
'</main>'
)
}
/**
@@ -48,14 +51,17 @@ export function main (config) {
*/
export function cover () {
const SL = ', 100%, 85%'
const bgc = 'linear-gradient(to left bottom, ' +
`hsl(${Math.floor(Math.random() * 255) + SL}) 0%,` +
`hsl(${Math.floor(Math.random() * 255) + SL}) 100%)`
const bgc =
'linear-gradient(to left bottom, ' +
`hsl(${Math.floor(Math.random() * 255) + SL}) 0%,` +
`hsl(${Math.floor(Math.random() * 255) + SL}) 100%)`
return `<section class="cover" style="background: ${bgc}">` +
return (
`<section class="cover" style="background: ${bgc}">` +
'<div class="cover-main"></div>' +
'<div class="mask"></div>' +
'</section>'
'</section>'
)
}
/**
+6 -6
View File
@@ -4,20 +4,20 @@ import { noop } from '../../util/core'
const cached = {}
function getAlias (path, alias, last) {
const match = Object.keys(alias).filter((key) => {
const match = Object.keys(alias).filter(key => {
const re = cached[key] || (cached[key] = new RegExp(`^${key}$`))
return re.test(path) && path !== last
})[0]
return match ? getAlias(path.replace(cached[match], alias[match]), alias, path) : path
return match
? getAlias(path.replace(cached[match], alias[match]), alias, path)
: path
}
function getFileName (path) {
return /\.(md|html)$/g.test(path)
? path
: /\/$/g.test(path)
? `${path}README.md`
: `${path}.md`
: /\/$/g.test(path) ? `${path}README.md` : `${path}.md`
}
export class History {
@@ -37,7 +37,7 @@ export class History {
path = config.alias ? getAlias(path, config.alias) : path
path = getFileName(path)
path = path === '/README.md' ? (config.homepage || path) : path
path = path === '/README.md' ? config.homepage || path : path
path = isAbsolutePath(path) ? path : getPath(base, path)
if (isRelative) {
+8 -8
View File
@@ -5,9 +5,7 @@ import { parseQuery, stringifyQuery, cleanPath } from '../util'
function replaceHash (path) {
const i = location.href.indexOf('#')
location.replace(
location.href.slice(0, i >= 0 ? i : 0) + '#' + path
)
location.replace(location.href.slice(0, i >= 0 ? i : 0) + '#' + path)
}
const replaceSlug = cached(path => {
@@ -24,9 +22,7 @@ export class HashHistory extends History {
const path = window.location.pathname || ''
const base = this.config.basePath
return /^(\/|https?:)/g.test(base)
? base
: cleanPath(path + '/' + base)
return /^(\/|https?:)/g.test(base) ? base : cleanPath(path + '/' + base)
}
getCurrentPath () {
@@ -59,7 +55,7 @@ export class HashHistory extends History {
let query = ''
const hashIndex = path.indexOf('#')
if (hashIndex) {
if (hashIndex >= 0) {
path = path.slice(hashIndex + 1)
}
@@ -84,7 +80,11 @@ export class HashHistory extends History {
path = route.path + stringifyQuery(route.query)
path = path.replace(/\.md(\?)|\.md$/, '$1')
if (local) path = currentRoute + path
if (local) {
const idIndex = currentRoute.indexOf('?')
path =
(idIndex > 0 ? currentRoute.substr(0, idIndex) : currentRoute) + path
}
return cleanPath('#/' + path)
}
+1 -3
View File
@@ -22,9 +22,7 @@ export class HTML5History extends History {
onchange (cb = noop) {
on('click', e => {
const el = e.target.tagName === 'A'
? e.target
: e.target.parentNode
const el = e.target.tagName === 'A' ? e.target : e.target.parentNode
if (el.tagName === 'A' && !/_blank/.test(el.target)) {
e.preventDefault()
+9 -10
View File
@@ -22,13 +22,16 @@ export function parseQuery (query) {
return res
}
export function stringifyQuery (obj) {
export function stringifyQuery (obj, ignores = []) {
const qs = []
for (const key in obj) {
qs.push(obj[key]
? `${encode(key)}=${encode(obj[key])}`.toLowerCase()
: encode(key))
if (ignores.indexOf(key) > -1) continue
qs.push(
obj[key]
? `${encode(key)}=${encode(obj[key])}`.toLowerCase()
: encode(key)
)
}
return qs.length ? `?${qs.join('&')}` : ''
@@ -45,13 +48,9 @@ export const isAbsolutePath = cached(path => {
export const getParentPath = cached(path => {
return /\/$/g.test(path)
? path
: (path = path.match(/(\S*\/)[^\/]+$/))
? path[1]
: ''
: (path = path.match(/(\S*\/)[^\/]+$/)) ? path[1] : ''
})
export const cleanPath = cached(path => {
return path
.replace(/^\/+/, '/')
.replace(/([^:])\/{2,}/g, '$1/')
return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/')
})
+12 -10
View File
@@ -19,21 +19,23 @@ export const hyphenate = cached(str => {
/**
* Simple Object.assign polyfill
*/
export const merge = Object.assign || function (to) {
const hasOwn = Object.prototype.hasOwnProperty
export const merge =
Object.assign ||
function (to) {
const hasOwn = Object.prototype.hasOwnProperty
for (let i = 1; i < arguments.length; i++) {
const from = Object(arguments[i])
for (let i = 1; i < arguments.length; i++) {
const from = Object(arguments[i])
for (const key in from) {
if (hasOwn.call(from, key)) {
to[key] = from[key]
for (const key in from) {
if (hasOwn.call(from, key)) {
to[key] = from[key]
}
}
}
}
return to
}
return to
}
/**
* Check if value is primitive
+5
View File
@@ -81,3 +81,8 @@ export function off (el, type, handler) {
export function toggleClass (el, type, val) {
el && el.classList[val ? type : 'toggle'](val || type)
}
export function style (content) {
appendTo(head, create('style', content))
}
+14 -8
View File
@@ -5,11 +5,17 @@ export const isMobile = inBrowser && document.body.clientWidth <= 600
/**
* @see https://github.com/MoOx/pjax/blob/master/lib/is-supported.js
*/
export const supportsPushState = inBrowser && (function () {
// Borrowed wholesale from https://github.com/defunkt/jquery-pjax
return window.history &&
window.history.pushState &&
window.history.replaceState &&
// pushState isnt reliable on iOS until 5.
!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/)
})()
export const supportsPushState =
inBrowser &&
(function () {
// Borrowed wholesale from https://github.com/defunkt/jquery-pjax
return (
window.history &&
window.history.pushState &&
window.history.replaceState &&
// pushState isnt reliable on iOS until 5.
!navigator.userAgent.match(
/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/
)
)
})()
+5 -6
View File
@@ -2,18 +2,17 @@ import * as dom from '../dom'
import { get } from '../../fetch/ajax'
function replaceVar (block, color) {
block.innerHTML = block.innerHTML
.replace(/var\(\s*--theme-color.*?\)/g, color)
block.innerHTML = block.innerHTML.replace(
/var\(\s*--theme-color.*?\)/g,
color
)
}
export default function (color) {
// Variable support
if (window.CSS &&
window.CSS.supports &&
window.CSS.supports('(--v:red)')) return
if (window.CSS && window.CSS.supports && window.CSS.supports('(--v:red)')) { return }
const styleBlocks = dom.findAll('style:not(.inserted),link')
;[].forEach.call(styleBlocks, block => {
if (block.nodeName === 'STYLE') {
replaceVar(block, color)
+51
View File
@@ -0,0 +1,51 @@
const fixedPath = location.href.replace('/-/', '/#/')
if (fixedPath !== location.href) {
location.href = fixedPath
}
function install (hook, vm) {
const dom = Docsify.dom
const disqus = vm.config.disqus
if (!disqus) {
throw Error('$docsify.disqus is required')
}
hook.init(_ => {
const script = dom.create('script')
script.async = true
script.src = `https://${disqus}.disqus.com/embed.js`
script.setAttribute('data-timestamp', +new Date())
dom.appendTo(dom.body, script)
})
hook.mounted(_ => {
const div = dom.create('div')
div.id = 'disqus_thread'
const 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(_ => {
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)
+893 -146
View File
File diff suppressed because it is too large Load Diff
+6 -5
View File
@@ -5,7 +5,8 @@
import parser from './yaml'
var optionalByteOrderMark = '\\ufeff?'
var pattern = '^(' +
var pattern =
'^(' +
optionalByteOrderMark +
'(= yaml =|---)' +
'$([\\s\\S]*?)' +
@@ -17,7 +18,7 @@ var pattern = '^(' +
// need to be moved down into the functions that use it.
var regex = new RegExp(pattern, 'm')
function extractor (string) {
function extractor(string) {
string = string || ''
var lines = string.split(/(\r?\n)/)
@@ -28,7 +29,7 @@ function extractor (string) {
}
}
function parse (string) {
function parse(string) {
var match = regex.exec(string)
if (!match) {
@@ -45,10 +46,10 @@ function parse (string) {
return { attributes: attributes, body: body, frontmatter: yaml }
}
function test (string) {
function test(string) {
string = string || ''
return regex.test(string)
}
export default extractor
export default extractor
+350 -353
View File
@@ -29,415 +29,412 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* @namespace
*/
var errors = [],
reference_blocks = [],
processing_time = 0,
regex =
{
"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("([^\\\'\\\"#]+([\\\'\\\"][^\\\'\\\"]*[\\\'\\\"])*)*(#.*)?")
};
reference_blocks = [],
processing_time = 0,
regex = {
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;
}
};
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 to create an XMLHttpClient in a cross-browser manner
function createXMLHTTPRequest() {
var xmlhttp;
var xmlhttp
try {
// Mozilla / Safari / IE7
xmlhttp = new XMLHttpRequest();
} catch (e) {
// IE
var XMLHTTP_IDS = new Array('MSXML2.XMLHTTP.5.0',
'MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0',
'MSXML2.XMLHTTP',
'Microsoft.XMLHTTP' );
var success = false;
for (var i=0;i < XMLHTTP_IDS.length && !success; i++) {
try {
xmlhttp = new ActiveXObject(XMLHTTP_IDS[i]);
success = true;
} catch (e) {}
}
if (!success) {
throw new Error('Unable to create XMLHttpRequest.');
}
try {
// Mozilla / Safari / IE7
xmlhttp = new XMLHttpRequest()
} catch (e) {
// IE
var XMLHTTP_IDS = new Array(
'MSXML2.XMLHTTP.5.0',
'MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0',
'MSXML2.XMLHTTP',
'Microsoft.XMLHTTP'
)
var success = false
for (var i = 0; i < XMLHTTP_IDS.length && !success; i++) {
try {
xmlhttp = new ActiveXObject(XMLHTTP_IDS[i])
success = true
} catch (e) {}
}
if (!success) {
throw new Error('Unable to create XMLHttpRequest.')
}
}
return xmlhttp;
return xmlhttp
}
function parser(str) {
var regLevel = regex["regLevel"];
var invalidLine = regex["invalidLine"];
var lines = str.split("\n");
var m;
var level = 0, curLevel = 0;
var regLevel = regex['regLevel']
var invalidLine = regex['invalidLine']
var lines = str.split('\n')
var m
var level = 0,
curLevel = 0
var blocks = [];
var blocks = []
var result = new Block(-1);
var currentBlock = new Block(0);
result.addChild(currentBlock);
var levels = [];
var line = "";
var result = new Block(-1)
var currentBlock = new Block(0)
result.addChild(currentBlock)
var levels = []
var line = ''
blocks.push(currentBlock);
levels.push(level);
blocks.push(currentBlock)
levels.push(level)
for(var i = 0, len = lines.length; i < len; ++i) {
line = lines[i];
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["trim"], ""));
curLevel = level;
if (line.match(invalidLine)) {
continue
}
return result;
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['trim'], ''))
curLevel = level
}
return result
}
function processValue(val) {
val = val.replace(regex["trim"], "");
var m = null;
val = val.replace(regex['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["dashesString"])) {
return m[1];
} else if(m = val.match(regex["quotesString"])) {
return m[1];
} else if(m = val.match(regex["float"])) {
return parseFloat(m[0]);
} else if(m = val.match(regex["integer"])) {
return parseInt(m[0]);
} else if( !isNaN(m = Date.parse(val))) {
return new Date(m);
} else if(m = val.match(regex["single_key_value"])) {
var res = {};
res[m[1]] = processValue(m[2]);
return res;
} else if(m = val.match(regex["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 (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['dashesString']))) {
return m[1]
} else if ((m = val.match(regex['quotesString']))) {
return m[1]
} else if ((m = val.match(regex['float']))) {
return parseFloat(m[0])
} else if ((m = val.match(regex['integer']))) {
return parseInt(m[0])
} else if (!isNaN((m = Date.parse(val)))) {
return new Date(m)
} else if ((m = val.match(regex['single_key_value']))) {
var res = {}
res[m[1]] = processValue(m[2])
return res
} else if ((m = val.match(regex['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
}
if(content.length > 0)
res.push(processValue(content));
return res;
} else if(m = val.match(regex["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
}
content += c;
if (content.length > 0) res.push(processValue(content))
return res
} else if ((m = val.match(regex['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
}
if(content.length > 0)
res.push(content);
content += c
}
var newRes = {};
for(var j = 0, lenJ = res.length; j < lenJ; ++j) {
if(m = res[j].match(regex["key_value"])) {
newRes[m[1]] = processValue(m[2]);
}
}
if (content.length > 0) res.push(content)
return newRes;
} else
return val;
var newRes = {}
for (var j = 0, lenJ = res.length; j < lenJ; ++j) {
if ((m = res[j].match(regex['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");
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;
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 m = null
var res = {}
var lines = null
var children = null
var currentObj = null
var level = -1;
var level = -1
var processedBlocks = [];
var processedBlocks = []
var isMap = true;
var isMap = true
for(var j = 0, lenJ = blocks.length; j < lenJ; ++j) {
for (var j = 0, lenJ = blocks.length; j < lenJ; ++j) {
if (level != -1 && level != blocks[j].level) continue
if(level != -1 && level != blocks[j].level)
continue;
processedBlocks.push(j)
processedBlocks.push(j);
level = blocks[j].level
lines = blocks[j].lines
children = blocks[j].children
currentObj = null
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]
for(var i = 0, len = lines.length; i < len; ++i) {
var line = lines[i];
if ((m = line.match(regex['key']))) {
var key = m[1]
if(m = line.match(regex["key"])) {
var key = m[1];
if(key[0] == '-') {
key = key.replace(regex["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["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 (key[0] == '-') {
key = key.replace(regex['item'], '')
if (isMap) {
isMap = false
if (typeof res.length === 'undefined') {
res = []
}
}
if (currentObj != null) res.push(currentObj)
currentObj = {}
isMap = true
}
if(currentObj != null) {
if (isMap) {
isMap = false;
if (typeof(res.length) === "undefined") {
res = [];
}
if (typeof m[2] != 'undefined') {
var value = m[2].replace(regex['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
}
res.push(currentObj);
} 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
}
}
for(var j = processedBlocks.length - 1; j >= 0; --j) {
blocks.splice.call(blocks, processedBlocks[j], 1);
if (currentObj != null) {
if (isMap) {
isMap = false
if (typeof res.length === 'undefined') {
res = []
}
}
res.push(currentObj)
}
}
return res;
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;
var res = processBlock(blocks.children)
return res
}
function preProcess(src) {
var m;
var lines = src.split("\n");
var m
var lines = src.split('\n')
var r = regex["comment"];
var r = regex['comment']
for(var i in lines) {
if(m = lines[i].match(r)) {
/* var cmt = "";
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")
@@ -445,25 +442,25 @@ function preProcess(src) {
else
lines[i] = "";
*/
if(typeof m[3] !== "undefined") {
lines[i] = m[0].substr(0, m[0].length - m[3].length);
}
}
if (typeof m[3] !== 'undefined') {
lines[i] = m[0].substr(0, m[0].length - m[3].length)
}
}
}
return lines.join("\n");
return lines.join('\n')
}
function load(str) {
errors = [];
reference_blocks = [];
processing_time = (new Date()).getTime();
var pre = preProcess(str)
var doc = parser(pre);
var res = semanticAnalysis(doc);
processing_time = (new Date()).getTime() - processing_time;
errors = []
reference_blocks = []
processing_time = new Date().getTime()
var pre = preProcess(str)
var doc = parser(pre)
var res = semanticAnalysis(doc)
processing_time = new Date().getTime() - processing_time
return res;
return res
}
export default load
export default load
+5 -3
View File
@@ -8,9 +8,11 @@ function appendScript () {
function init (id) {
appendScript()
window.ga = window.ga || function () {
(window.ga.q = window.ga.q || []).push(arguments)
}
window.ga =
window.ga ||
function () {
;(window.ga.q = window.ga.q || []).push(arguments)
}
window.ga.l = Number(new Date())
window.ga('create', id, 'auto')
}
+17
View File
@@ -0,0 +1,17 @@
function install (hook, vm) {
const dom = Docsify.dom
hook.mounted(_ => {
const div = dom.create('div')
div.id = 'gitalk-container'
const main = dom.getNode('#main')
div.style = `width: ${main.clientWidth}px; margin: 0 auto 20px;`
dom.appendTo(dom.find('.content'), div)
const script = dom.create('script')
const content = `gitalk.render('gitalk-container')`
script.textContent = content
dom.appendTo(dom.body, script)
})
}
$docsify.plugins = [].concat(install, $docsify.plugins)
+11 -7
View File
@@ -64,14 +64,14 @@ function style () {
.search p.empty {
text-align: center;
}`
const style = Docsify.dom.create('style', code)
Docsify.dom.appendTo(Docsify.dom.head, style)
Docsify.dom.style(code)
}
function tpl (opts, defaultValue = '') {
const html =
`<input type="search" value="${defaultValue}" />` +
'<div class="results-panel"></div>' +
'<div class="results-panel"></div>' +
'</div>'
const el = Docsify.dom.create('div', html)
const aside = Docsify.dom.find('aside')
@@ -94,8 +94,10 @@ function doSearch (value) {
let html = ''
matchs.forEach(post => {
html += `<div class="matching-post">
<h2><a href="${post.url}">${post.title}</a></h2>
<a href="${post.url}">
<h2>${post.title}</h2>
<p>${post.content}</p>
</a>
</div>`
})
@@ -109,8 +111,11 @@ function bindEvents () {
let timeId
// Prevent to Fold sidebar
Docsify.dom.on($search, 'click',
e => e.target.tagName !== 'A' && e.stopPropagation())
Docsify.dom.on(
$search,
'click',
e => e.target.tagName !== 'A' && e.stopPropagation()
)
Docsify.dom.on($input, 'input', e => {
clearTimeout(timeId)
timeId = setTimeout(_ => doSearch(e.target.value.trim()), 100)
@@ -151,4 +156,3 @@ export function update (opts, vm) {
updatePlaceholder(opts.placeholder, vm.route.path)
updateNoData(opts.noData, vm.route.path)
}
+2
View File
@@ -5,6 +5,7 @@ const CONFIG = {
placeholder: 'Type to search',
noData: 'No Results!',
paths: 'auto',
depth: 2,
maxAge: 86400000 // 1 day
}
@@ -19,6 +20,7 @@ const install = function (hook, vm) {
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
}
const isAuto = CONFIG.paths === 'auto'
+13 -5
View File
@@ -38,14 +38,14 @@ function saveData (maxAge) {
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS))
}
export function genIndex (path, content = '', router) {
export function genIndex (path, content = '', router, depth) {
const tokens = window.marked.lexer(content)
const slugify = window.Docsify.slugify
const index = {}
let slug
tokens.forEach(token => {
if (token.type === 'heading' && token.depth <= 2) {
if (token.type === 'heading' && token.depth <= depth) {
slug = router.toURL(path, { id: slugify(token.text) })
index[slug] = { slug, title: token.text, body: '' }
} else {
@@ -65,14 +65,22 @@ export function genIndex (path, content = '', router) {
return index
}
export function search (keywords) {
/**
* @param {String} query
* @returns {Array}
*/
export function search (query) {
const matchingResults = []
let data = []
Object.keys(INDEXS).forEach(key => {
data = data.concat(Object.keys(INDEXS[key]).map(page => INDEXS[key][page]))
})
keywords = [].concat(keywords, keywords.trim().split(/[\s\-\\\/]+/))
query = query.trim()
let keywords = query.split(/[\s\-\\\/]+/)
if (keywords.length !== 1) {
keywords = [].concat(query, keywords)
}
for (let i = 0; i < data.length; i++) {
const post = data[i]
@@ -154,7 +162,7 @@ export function init (config, vm) {
helper
.get(vm.router.getFile(path))
.then(result => {
INDEXS[path] = genIndex(path, result, vm.router)
INDEXS[path] = genIndex(path, result, vm.router, config.depth)
len === ++count && saveData(config.maxAge)
})
})
+5 -13
View File
@@ -1,22 +1,14 @@
import zoom from 'zoom-image'
import style from 'zoom-image/css/zoom-image.css'
import mediumZoom from 'medium-zoom'
function install (hook) {
const dom = Docsify.dom
let destroys
// add style
dom.appendTo(dom.head, dom.create('style', style))
let zoom
hook.doneEach(_ => {
const images = dom.findAll('img:not(.emoji)')
if (Array.isArray(destroys) && destroys.length) {
destroys.forEach(o => o())
destroys = []
if (zoom) {
zoom.detach()
}
destroys = images.map(zoom)
zoom = mediumZoom('img:not(.emoji):not([data-no-zoom])')
})
}
+4 -4
View File
@@ -12,7 +12,7 @@ section.cover {
&.has-mask .mask {
background-color: $color-bg;
opacity: .8;
opacity: 0.8;
position: absolute;
size: 100%;
}
@@ -42,7 +42,7 @@ section.cover {
color: inherit;
font-size: 2.5rem;
font-weight: 300;
margin: .625rem 0 2.5rem;
margin: 0.625rem 0 2.5rem;
position: relative;
text-align: center;
@@ -92,7 +92,7 @@ section.cover {
&:hover {
color: inherit;
opacity: .8;
opacity: 0.8;
}
}
@@ -103,7 +103,7 @@ section.cover {
blockquote > p > a {
border-bottom: 2px solid var(--theme-color, $color-primary);
transition: color .3s;
transition: color 0.3s;
&:hover {
color: var(--theme-color, $color-primary);
+74 -32
View File
@@ -10,7 +10,9 @@
body:not(.ready) {
overflow: hidden;
[data-cloak], .app-nav {
[data-cloak],
.app-nav,
> nav {
display: none;
}
}
@@ -22,7 +24,7 @@ div#app {
text-align: center;
&:empty::before {
content: "Loading...";
content: 'Loading...';
}
}
@@ -50,9 +52,11 @@ div#app {
.search .search-keyword {
color: var(--theme-color, $color-primary);
font-style: normal;
font-weight: bold;
}
html, body {
html,
body {
height: 100%;
}
@@ -71,17 +75,31 @@ img {
max-width: 100%;
}
a[disabled] {
cursor: not-allowed;
opacity: 0.6;
}
kbd {
border: solid 1px #ccc;
border-radius: 3px;
display: inline-block;
font-size: 12px !important;
line-height: 12px;
margin-bottom : 3px;
margin-bottom: 3px;
padding: 3px 5px;
vertical-align: middle;
}
.task-list-item {
list-style-type: none;
}
li input[type=checkbox] {
margin: 0 0.2em 0.25em -1.6em;
vertical-align: middle;
}
/* navbar */
.app-nav {
left: 0;
@@ -99,12 +117,13 @@ kbd {
margin: 0;
}
>a {
> a {
margin: 0 1rem;
padding: 5px 0;
}
ul, li {
ul,
li {
display: inline-block;
list-style: none;
margin: 0;
@@ -114,7 +133,7 @@ kbd {
color: inherit;
font-size: 16px;
text-decoration: none;
transition: color .3s;
transition: color 0.3s;
&:hover {
color: var(--theme-color, $color-primary);
@@ -186,7 +205,7 @@ kbd {
z-index: 1;
&:hover .octo-arm {
animation:octocat-wave 560ms ease-in-out;
animation: octocat-wave 560ms ease-in-out;
}
svg {
@@ -202,12 +221,13 @@ main {
display: block;
position: relative;
size: 100vw 100%;
z-index: 0;
}
.anchor {
display: inline-block;
text-decoration: none;
transition: all .3s;
transition: all 0.3s;
span {
color: $color-text;
@@ -220,9 +240,9 @@ main {
/* sidebar */
.sidebar {
border-right: 1px solid rgba(0, 0, 0, .07);
border-right: 1px solid rgba(0, 0, 0, 0.07);
overflow-y: auto;
padding: 40px 0;
padding: 40px 0 0;
position: absolute 0 * 0 0;
transition: transform 250ms ease-out;
width: $sidebar-width;
@@ -245,17 +265,23 @@ main {
}
}
.sidebar-nav {
line-height: 2em;
padding-bottom: 40px;
}
ul {
margin: 0;
padding: 0;
}
li>p {
li > p {
font-weight: 700;
margin: 0;
}
ul, ul li {
ul,
ul li {
list-style: none;
}
@@ -289,20 +315,20 @@ main {
/* sidebar toggle */
.sidebar-toggle {
background-color: transparent;
background-color: rgba($color-bg, .8);
background-color: rgba($color-bg, 0.8);
border: 0;
outline: none;
outline: none;
padding: 10px;
position: absolute * * 0 0;
text-align: center;
transition: opacity .3s;
transition: opacity 0.3s;
width: 30px;
width: calc($sidebar-width - 16px);
z-index: 30;
.sidebar-toggle-button:hover {
opacity: .4;
opacity: 0.4;
}
span {
@@ -314,14 +340,15 @@ main {
}
body.sticky {
.sidebar, .sidebar-toggle {
.sidebar,
.sidebar-toggle {
position: fixed;
}
}
/* main content */
.content {
padding-top: 20px;
padding-top: 60px;
position: absolute 0 0 0 $sidebar-width;
transition: left 250ms ease;
}
@@ -338,8 +365,8 @@ body.sticky {
font-size: inherit;
}
>:first-child {
margin-top: 0!important;
> :first-child {
margin-top: 0 !important;
}
}
@@ -389,7 +416,7 @@ body.sticky {
background-color: #f66;
border-radius: 100%;
color: $color-bg;
content: "!";
content: '!';
font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
font-size: 14px;
font-weight: bold;
@@ -431,17 +458,18 @@ body.close {
}
@media print {
.github-corner, .sidebar-toggle, .sidebar {
display: none;
}
.github-corner,
.sidebar-toggle,
.sidebar,
.app-nav {
display: none;
}
}
@media screen and (max-width: 768px) {
.github-corner, .sidebar-toggle, .sidebar {
.github-corner,
.sidebar-toggle,
.sidebar {
position: fixed;
}
@@ -467,16 +495,19 @@ body.close {
left: 0;
max-width: 100vw;
position: static;
padding-top: 20px;
transition: transform 250ms ease;
}
.app-nav, .github-corner {
.app-nav,
.github-corner {
transition: transform 250ms ease-out;
}
.sidebar-toggle {
background-color: transparent;
width: auto;
padding: 30px 30px 10px 10px;
}
body.close {
@@ -485,16 +516,18 @@ body.close {
}
.sidebar-toggle {
background-color: rgba($color-bg, .8);
background-color: rgba($color-bg, 0.8);
transition: 1s background-color;
width: calc($sidebar-width - 16px);
padding: 10px;
}
.content {
transform: translateX($sidebar-width);
}
.app-nav, .github-corner {
.app-nav,
.github-corner {
display: none;
}
}
@@ -510,7 +543,16 @@ body.close {
}
@keyframes octocat-wave {
0%,100% { transform: rotate(0); }
20%,60% { transform: rotate(-25deg); }
40%,80% { transform: rotate(10deg); }
0%,
100% {
transform: rotate(0);
}
20%,
60% {
transform: rotate(-25deg);
}
40%,
80% {
transform: rotate(10deg);
}
}
+9 -7
View File
@@ -1,12 +1,12 @@
@import url('https://fonts.googleapis.com/css?family=Inconsolata|Inconsolata-Bold');
$color-primary: #0074D9;
$color-primary: #0074d9;
$color-bg: #fff;
$color-text: #34495e;
$sidebar-width: 16rem;
@import "basic/layout";
@import "basic/coverpage";
@import 'basic/layout';
@import 'basic/coverpage';
/* sidebar */
.sidebar {
@@ -132,7 +132,7 @@ $sidebar-width: 16rem;
border-radius: 3px;
font-family: Inconsolata;
padding: 0.2em 0.4rem;
white-space: pre;
white-space: nowrap;
}
.markdown-section pre {
@@ -160,7 +160,7 @@ $sidebar-width: 16rem;
}
.namespace {
opacity: .7;
opacity: 0.7;
}
.token.property,
@@ -216,7 +216,7 @@ $sidebar-width: 16rem;
cursor: help;
}
.markdown-section pre>code {
.markdown-section pre > code {
background-color: #f8f8f8;
border-radius: 2px;
display: block;
@@ -226,9 +226,11 @@ $sidebar-width: 16rem;
overflow: inherit;
padding: 20px 0.8em 20px;
position: relative;
white-space: inherit;
}
.markdown-section code::after, .markdown-section code::before {
.markdown-section code::after,
.markdown-section code::before {
letter-spacing: 0.05rem;
}
+10 -9
View File
@@ -5,8 +5,8 @@ $color-bg: #3f3f3f;
$color-text: #c8c8c8;
$sidebar-width: 300px;
@import "basic/layout";
@import "basic/coverpage";
@import 'basic/layout';
@import 'basic/coverpage';
body {
background-color: $color-bg;
@@ -38,7 +38,7 @@ body {
padding: 0;
}
ul li.active>a {
ul li.active > a {
color: var(--theme-color, $color-primary);
font-weight: 600;
}
@@ -71,7 +71,7 @@ body {
.markdown-section h3 {
font-size: 1.5rem;
margin: 40px 0 .6rem;
margin: 40px 0 0.6rem;
}
.markdown-section h4 {
@@ -134,7 +134,7 @@ body {
font-size: 0.8rem;
margin: 0 2px;
padding: 3px 5px;
white-space: nowrap;
white-space: pre-wrap;
}
.markdown-section pre {
@@ -159,7 +159,7 @@ body {
}
.token.namespace {
opacity: .7;
opacity: 0.7;
}
.token.boolean,
@@ -246,7 +246,7 @@ body {
cursor: help;
}
.markdown-section pre>code {
.markdown-section pre > code {
-moz-osx-font-smoothing: initial;
-webkit-font-smoothing: initial;
background-color: #282828;
@@ -263,7 +263,8 @@ body {
white-space: inherit;
}
.markdown-section code::after, .markdown-section code::before {
.markdown-section code::after,
.markdown-section code::before {
letter-spacing: 0.05rem;
}
@@ -292,7 +293,7 @@ pre::after {
color: #657b83;
}
input[type="search"] {
input[type='search'] {
background: #4f4f4f;
border-color: #4f4f4f;
color: #c8c8c8;
+2 -2
View File
@@ -2,5 +2,5 @@ $color-primary: #000;
$color-bg: #fff;
$color-text: #000;
$sidebar-width: 300px;
@import "basic/layout";
@import "basic/coverpage";
@import 'basic/layout';
@import 'basic/coverpage';
+12 -12
View File
@@ -5,8 +5,8 @@ $color-bg: #fff;
$color-text: #34495e;
$sidebar-width: 300px;
@import "basic/layout";
@import "basic/coverpage";
@import 'basic/layout';
@import 'basic/coverpage';
body {
background-color: $color-bg;
@@ -39,7 +39,7 @@ body {
padding: 0;
}
ul li.active>a {
ul li.active > a {
border-right: 2px solid;
color: var(--theme-color, $color-primary);
font-weight: 600;
@@ -47,10 +47,11 @@ body {
}
.app-sub-sidebar {
.section-link {
li {
&::before {
content: '-';
padding-right: 4px;
float: left;
}
}
}
@@ -82,7 +83,7 @@ body {
.markdown-section h3 {
font-size: 1.5rem;
margin: 40px 0 .6rem;
margin: 40px 0 0.6rem;
}
.markdown-section h4 {
@@ -99,9 +100,7 @@ body {
}
.markdown-section figure,
.markdown-section p,
.markdown-section ul,
.markdown-section ol {
.markdown-section p {
margin: 1.2em 0;
}
@@ -145,7 +144,7 @@ body {
font-size: 0.8rem;
margin: 0 2px;
padding: 3px 5px;
white-space: nowrap;
white-space: pre-wrap;
}
.markdown-section pre {
@@ -170,7 +169,7 @@ body {
}
.token.namespace {
opacity: .7;
opacity: 0.7;
}
.token.boolean,
@@ -257,7 +256,7 @@ body {
cursor: help;
}
.markdown-section pre>code {
.markdown-section pre > code {
-moz-osx-font-smoothing: initial;
-webkit-font-smoothing: initial;
background-color: #f8f8f8;
@@ -274,7 +273,8 @@ body {
white-space: inherit;
}
.markdown-section code::after, .markdown-section code::before {
.markdown-section code::after,
.markdown-section code::before {
letter-spacing: 0.05rem;
}

Some files were not shown because too many files have changed in this diff Show More