From 84f7b5c7c2c6a06f817d359756fdb1496bcf8e60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jingjie=20Yang=20=E6=9D=A8=E7=AB=9E=E9=A2=89?=
Date: Thu, 15 Feb 2018 01:57:17 +0100
Subject: [PATCH 001/180] chore: typo (#392)
> Only coverpage is loaded when ~~When~~ visiting the home page.
---
docs/configuration.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/configuration.md b/docs/configuration.md
index 7c0f0e7..828ea61 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -380,7 +380,7 @@ window.$docsify = {
* type: `Boolean`
-Only coverpage is loaded when When visiting the home page.
+Only coverpage is loaded when visiting the home page.
```js
window.$docsify = {
From e5c64a3d8f2e6e02a5aff555e243f6c9cc58cfbc Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Fri, 23 Feb 2018 11:56:12 +0800
Subject: [PATCH 002/180] fix typo
---
docs/_sidebar.md | 2 +-
docs/de-de/_sidebar.md | 2 +-
lib/docsify.js | 2 +-
src/core/fetch/index.js | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
index 565a649..8dc8c9e 100644
--- a/docs/_sidebar.md
+++ b/docs/_sidebar.md
@@ -21,7 +21,7 @@
* [Vue compatibility](vue.md)
* [CDN](cdn.md)
* [Offline Mode(PWA)](pwa.md)
- * [Server-client renderer(SSR)](ssr.md)
+ * [Server-Side Rendering(SSR)](ssr.md)
* [Embed Files (new)](embed-files.md)
* [Awesome docsify](awesome.md)
diff --git a/docs/de-de/_sidebar.md b/docs/de-de/_sidebar.md
index 168a46f..b99eeb5 100644
--- a/docs/de-de/_sidebar.md
+++ b/docs/de-de/_sidebar.md
@@ -21,7 +21,7 @@
* [Vue Kompatibilität](de-de/vue.md)
* [CDN](de-de/cdn.md)
* [Offline Modus (PWA)](de-de/pwa.md)
- * [Server-client renderer (SSR)](de-de/ssr.md)
+ * [Server-Side Rendering (SSR)](de-de/ssr.md)
* [Embed Files (new)](de-de/embed-files.md)
* [Awesome docsify](de-de/awesome.md)
diff --git a/lib/docsify.js b/lib/docsify.js
index e197891..18ef550 100644
--- a/lib/docsify.js
+++ b/lib/docsify.js
@@ -4283,7 +4283,7 @@ function initFetch (vm) {
var ref = vm.config;
var loadSidebar = ref.loadSidebar;
- // server-client renderer
+ // Server-Side Rendering
if (vm.rendered) {
var activeEl = getAndActive(vm.router, '.sidebar-nav', true, true);
if (loadSidebar && activeEl) {
diff --git a/src/core/fetch/index.js b/src/core/fetch/index.js
index c23e8d5..a7f4803 100644
--- a/src/core/fetch/index.js
+++ b/src/core/fetch/index.js
@@ -121,7 +121,7 @@ export function fetchMixin (proto) {
export function initFetch (vm) {
const { loadSidebar } = vm.config
- // server-client renderer
+ // Server-Side Rendering
if (vm.rendered) {
const activeEl = getAndActive(vm.router, '.sidebar-nav', true, true)
if (loadSidebar && activeEl) {
From 01bbbaaf92e07907a026c1f648a2f4914647708f Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Fri, 23 Feb 2018 11:56:51 +0800
Subject: [PATCH 003/180] fix typo
---
docs/de-de/ssr.md | 2 +-
docs/ssr.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/de-de/ssr.md b/docs/de-de/ssr.md
index c6e5f3a..b7849b3 100644
--- a/docs/de-de/ssr.md
+++ b/docs/de-de/ssr.md
@@ -1,4 +1,4 @@
-# Server client renderer
+# Server-Side Rendering
See https://docsify.now.sh
diff --git a/docs/ssr.md b/docs/ssr.md
index 99fff7e..3b5eaf2 100644
--- a/docs/ssr.md
+++ b/docs/ssr.md
@@ -1,4 +1,4 @@
-# Server client renderer
+# Server-Side Rendering
See https://docsify.now.sh
From b8a4e6ba1b887b4509578d253eff92ba77c1d091 Mon Sep 17 00:00:00 2001
From: Romain Lenzotti
Date: Thu, 1 Mar 2018 15:21:14 +0100
Subject: [PATCH 004/180] chore: Update dev task in package.json (#404)
- Add rimraf to remove file (Windows/Unix/Mac compliant)
- Add concurrently module to run node app and nodemon concurrently
---
.gitignore | 1 +
package-lock.json | 201 +++++++++++++++++++++++++++++++++++-----------
package.json | 11 ++-
3 files changed, 162 insertions(+), 51 deletions(-)
diff --git a/.gitignore b/.gitignore
index aac765d..7b51f83 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
/themes/
node_modules
/lib/
+.idea
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index d35d582..6f9f339 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -150,14 +150,12 @@
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
- "dev": true
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
- "dev": true
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
},
"any-promise": {
"version": "1.3.0",
@@ -651,7 +649,6 @@
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
- "dev": true,
"requires": {
"ansi-styles": "2.2.1",
"escape-string-regexp": "1.0.5",
@@ -663,16 +660,14 @@
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
- "dev": true
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
}
}
},
"chardet": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
- "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
- "dev": true
+ "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I="
},
"chokidar": {
"version": "1.7.0",
@@ -748,7 +743,6 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
"integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
- "dev": true,
"requires": {
"restore-cursor": "2.0.0"
}
@@ -756,8 +750,7 @@
"cli-width": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz",
- "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=",
- "dev": true
+ "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao="
},
"clipboard": {
"version": "1.7.1",
@@ -1156,8 +1149,7 @@
"core-js": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz",
- "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=",
- "dev": true
+ "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4="
},
"core-util-is": {
"version": "1.0.2",
@@ -1629,6 +1621,14 @@
"integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=",
"dev": true
},
+ "encoding": {
+ "version": "0.1.12",
+ "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
+ "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
+ "requires": {
+ "iconv-lite": "0.4.19"
+ }
+ },
"entities": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
@@ -1653,8 +1653,7 @@
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
- "dev": true
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"eslint": {
"version": "4.14.0",
@@ -1917,7 +1916,6 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz",
"integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==",
- "dev": true,
"requires": {
"chardet": "0.4.2",
"iconv-lite": "0.4.19",
@@ -1963,7 +1961,6 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
- "dev": true,
"requires": {
"escape-string-regexp": "1.0.5"
}
@@ -3273,7 +3270,6 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
- "dev": true,
"requires": {
"ansi-regex": "2.1.1"
}
@@ -3337,8 +3333,7 @@
"iconv-lite": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
- "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==",
- "dev": true
+ "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"ignore": {
"version": "3.3.7",
@@ -3678,8 +3673,7 @@
"is-promise": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
- "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
- "dev": true
+ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o="
},
"is-redirect": {
"version": "1.0.0",
@@ -3702,8 +3696,7 @@
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
- "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
- "dev": true
+ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
},
"is-subset": {
"version": "0.1.1",
@@ -4192,8 +4185,7 @@
"lodash": {
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
- "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=",
- "dev": true
+ "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
},
"lodash._reinterpolate": {
"version": "3.0.0",
@@ -4406,8 +4398,7 @@
"mimic-fn": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz",
- "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=",
- "dev": true
+ "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg="
},
"minimatch": {
"version": "3.0.4",
@@ -4454,8 +4445,7 @@
"mute-stream": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
- "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
- "dev": true
+ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s="
},
"mz": {
"version": "2.7.0",
@@ -4481,6 +4471,15 @@
"integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
"dev": true
},
+ "node-fetch": {
+ "version": "1.6.3",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz",
+ "integrity": "sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=",
+ "requires": {
+ "encoding": "0.1.12",
+ "is-stream": "1.1.0"
+ }
+ },
"nodemon": {
"version": "1.14.7",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.14.7.tgz",
@@ -4590,8 +4589,7 @@
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
- "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
- "dev": true
+ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"object.omit": {
"version": "2.0.1",
@@ -4625,11 +4623,119 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
"integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
- "dev": true,
"requires": {
"mimic-fn": "1.1.0"
}
},
+ "opencollective": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz",
+ "integrity": "sha1-ruY3K8KBRFg2kMPKja7PwSDdDvE=",
+ "requires": {
+ "babel-polyfill": "6.23.0",
+ "chalk": "1.1.3",
+ "inquirer": "3.0.6",
+ "minimist": "1.2.0",
+ "node-fetch": "1.6.3",
+ "opn": "4.0.2"
+ },
+ "dependencies": {
+ "ansi-escapes": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz",
+ "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4="
+ },
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
+ },
+ "babel-polyfill": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz",
+ "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=",
+ "requires": {
+ "babel-runtime": "6.26.0",
+ "core-js": "2.5.3",
+ "regenerator-runtime": "0.10.5"
+ }
+ },
+ "babel-runtime": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+ "requires": {
+ "core-js": "2.5.3",
+ "regenerator-runtime": "0.11.1"
+ },
+ "dependencies": {
+ "regenerator-runtime": {
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
+ }
+ }
+ },
+ "inquirer": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz",
+ "integrity": "sha1-4EqqnQW3o8ubD0B9BDdfBEcZA0c=",
+ "requires": {
+ "ansi-escapes": "1.4.0",
+ "chalk": "1.1.3",
+ "cli-cursor": "2.1.0",
+ "cli-width": "2.1.0",
+ "external-editor": "2.1.0",
+ "figures": "2.0.0",
+ "lodash": "4.17.4",
+ "mute-stream": "0.0.7",
+ "run-async": "2.3.0",
+ "rx": "4.1.0",
+ "string-width": "2.1.1",
+ "strip-ansi": "3.0.1",
+ "through": "2.3.8"
+ }
+ },
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
+ },
+ "minimist": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
+ },
+ "string-width": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
+ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+ "requires": {
+ "is-fullwidth-code-point": "2.0.0",
+ "strip-ansi": "4.0.0"
+ },
+ "dependencies": {
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "requires": {
+ "ansi-regex": "3.0.0"
+ }
+ }
+ }
+ }
+ }
+ },
+ "opn": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz",
+ "integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=",
+ "requires": {
+ "object-assign": "4.1.1",
+ "pinkie-promise": "2.0.1"
+ }
+ },
"optimist": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
@@ -4699,8 +4805,7 @@
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
- "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
- "dev": true
+ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
},
"p-finally": {
"version": "1.0.0",
@@ -4862,14 +4967,12 @@
"pinkie": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
- "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
- "dev": true
+ "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
},
"pinkie-promise": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
- "dev": true,
"requires": {
"pinkie": "2.0.4"
}
@@ -7866,6 +7969,11 @@
"balanced-match": "0.4.2"
}
},
+ "regenerator-runtime": {
+ "version": "0.10.5",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
+ "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
+ },
"regex-cache": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz",
@@ -7968,7 +8076,6 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
"integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
- "dev": true,
"requires": {
"onetime": "2.0.1",
"signal-exit": "3.0.2"
@@ -8206,11 +8313,15 @@
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
"integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
- "dev": true,
"requires": {
"is-promise": "2.1.0"
}
},
+ "rx": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
+ "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I="
+ },
"rx-lite": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz",
@@ -8383,8 +8494,7 @@
"signal-exit": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
- "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
- "dev": true
+ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
},
"slice-ansi": {
"version": "1.0.0",
@@ -8514,7 +8624,6 @@
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
- "dev": true,
"requires": {
"ansi-regex": "2.1.1"
}
@@ -8767,8 +8876,7 @@
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
- "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
- "dev": true
+ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"through2": {
"version": "2.0.3",
@@ -8801,7 +8909,6 @@
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
- "dev": true,
"requires": {
"os-tmpdir": "1.0.2"
}
diff --git a/package.json b/package.json
index 706586c..845d870 100644
--- a/package.json
+++ b/package.json
@@ -21,9 +21,10 @@
],
"scripts": {
"bootstrap": "npm i && lerna bootstrap && npm run build:ssr",
- "build": "rm -rf lib themes && node build/build && mkdir lib/themes && mkdir themes && node build/build-css && npm run build:ssr && node build/build-cover",
- "dev:build": "rm -rf lib themes && mkdir themes && node build/build --dev && node build/build-css --dev",
- "dev": "node app & nodemon -w src -e js,css --exec 'npm run dev:build'",
+ "build": "rimraf lib themes && node build/build && mkdir lib/themes && mkdir themes && node build/build-css && npm run build:ssr && node build/build-cover",
+ "dev:build": "rimraf lib themes && mkdir themes && node build/build --dev && node build/build-css --dev",
+ "dev:watch": "nodemon -w ./src/ -e js,css --exec \"npm run dev:build\"",
+ "dev": "concurrently \"node app\" \"npm run dev:watch\"",
"build:ssr": "node build/build-ssr",
"test": "eslint {src,packages} --fix",
"pub:next": "RELEASE_TAG=next sh build/release.sh",
@@ -32,13 +33,14 @@
},
"dependencies": {
"marked": "^0.3.12",
- "opencollective": "^1.0.3",
"medium-zoom": "^0.3.0",
+ "opencollective": "^1.0.3",
"prismjs": "^1.9.0",
"tinydate": "^1.0.0",
"tweezer.js": "^1.4.0"
},
"devDependencies": {
+ "concurrently": "^3.5.1",
"conventional-changelog-cli": "^1.3.5",
"cssnano": "^3.10.0",
"eslint": "^4.14.0",
@@ -48,6 +50,7 @@
"nodemon": "^1.14.7",
"postcss": "^5.2.16",
"postcss-salad": "^1.0.8",
+ "rimraf": "^2.6.2",
"rollup": "^0.53.3",
"rollup-plugin-async": "^1.2.0",
"rollup-plugin-buble": "^0.18.0",
From 278a75ebd5a562fd707e0fe94ae2eb29aaa1e02d Mon Sep 17 00:00:00 2001
From: Romain Lenzotti
Date: Thu, 1 Mar 2018 15:27:30 +0100
Subject: [PATCH 005/180] fix(render): Disable markdown parsing when the file
is an HTML (#403)
---
src/core/fetch/index.js | 6 ++++--
src/core/render/index.js | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/core/fetch/index.js b/src/core/fetch/index.js
index a7f4803..3361581 100644
--- a/src/core/fetch/index.js
+++ b/src/core/fetch/index.js
@@ -27,10 +27,12 @@ export function fetchMixin (proto) {
// Abort last request
last && last.abort && last.abort()
- last = get(this.router.getFile(path) + qs, true, requestHeaders)
+ const file = this.router.getFile(path)
+
+ last = get(file + qs, true, requestHeaders)
// Current page is html
- this.isHTML = /\.html$/g.test(path)
+ this.isHTML = /\.html$/g.test(file)
const loadSideAndNav = () => {
if (!loadSidebar) return cb()
diff --git a/src/core/render/index.js b/src/core/render/index.js
index 2984af1..1bea205 100644
--- a/src/core/render/index.js
+++ b/src/core/render/index.js
@@ -135,7 +135,7 @@ export function renderMixin (proto) {
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
}
if (this.isHTML) {
- html = this.result
+ html = this.result = text
callback()
next()
} else {
From ecc0e04c708a24e6bc688d99cf4add45f12954b2 Mon Sep 17 00:00:00 2001
From: Romain Lenzotti
Date: Thu, 1 Mar 2018 15:37:30 +0100
Subject: [PATCH 006/180] feat(fetch): Add fallback languages configuration.
(#402)
fallbackLanguages give the possibility to configure a list of languages which must used the default language when a page is missing in the requested language.
---
docs/configuration.md | 22 ++++++++++++++++++++
src/core/fetch/index.js | 45 +++++++++++++++++++++++++++++++----------
2 files changed, 56 insertions(+), 11 deletions(-)
diff --git a/docs/configuration.md b/docs/configuration.md
index 828ea61..532eccd 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -413,3 +413,25 @@ window.$docsify = {
ext: '.md'
};
```
+
+## fallbackLanguages
+
+* type: `Array`
+
+List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
+
+Example:
+
+ - try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
+ - then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
+ - then display 404 page.
+
+
+```js
+window.$docsify = {
+ fallbackLanguages: [
+ "fr",
+ "de"
+ ]
+};
+```
diff --git a/src/core/fetch/index.js b/src/core/fetch/index.js
index 3361581..035f2ef 100644
--- a/src/core/fetch/index.js
+++ b/src/core/fetch/index.js
@@ -22,18 +22,40 @@ export function fetchMixin (proto) {
proto._fetch = function (cb = noop) {
const { path, query } = this.route
const qs = stringifyQuery(query, ['id'])
- const { loadNavbar, loadSidebar, requestHeaders } = this.config
-
+ const { loadNavbar, loadSidebar, requestHeaders, fallbackLanguages } = this.config
// Abort last request
last && last.abort && last.abort()
const file = this.router.getFile(path)
-
last = get(file + qs, true, requestHeaders)
// Current page is html
this.isHTML = /\.html$/g.test(file)
+ const getFallBackPage = (file) => {
+ if (!fallbackLanguages) {
+ return false
+ }
+
+ const local = file.split('/')[1]
+
+ if (fallbackLanguages.indexOf(local) === -1) {
+ return false
+ }
+
+ file = file.replace(new RegExp(`^/${local}`), '')
+
+ return get(file + qs, true, requestHeaders)
+ .then(
+ (text, opt) => {
+ this._renderMain(text, opt, loadSideAndNav)
+ },
+ _ => {
+ return this._renderMain(null, {}, loadSideAndNav)
+ }
+ )
+ }
+
const loadSideAndNav = () => {
if (!loadSidebar) return cb()
@@ -47,14 +69,15 @@ export function fetchMixin (proto) {
}
// Load main content
- last.then(
- (text, opt) => {
- this._renderMain(text, opt, loadSideAndNav)
- },
- _ => {
- this._renderMain(null, {}, loadSideAndNav)
- }
- )
+ last
+ .then(
+ (text, opt) => {
+ this._renderMain(text, opt, loadSideAndNav)
+ },
+ _ => {
+ return getFallBackPage(file) || this._renderMain(null, {}, loadSideAndNav)
+ }
+ )
// Load nav
loadNavbar &&
From 123c516836b06dc0c6cea9a4fd46a2105b757b6e Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Thu, 1 Mar 2018 22:40:55 +0800
Subject: [PATCH 007/180] docs: add fallbackLanguages
---
docs/de-de/configuration.md | 18 ++++++++++++++++++
docs/zh-cn/configuration.md | 18 ++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/docs/de-de/configuration.md b/docs/de-de/configuration.md
index 076c015..87e4869 100644
--- a/docs/de-de/configuration.md
+++ b/docs/de-de/configuration.md
@@ -401,3 +401,21 @@ window.$docsify = {
ext: '.md'
};
```
+
+## fallbackLanguages
+
+* type: `Array`
+
+List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
+
+Example:
+
+* try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
+* then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
+* then display 404 page.
+
+```js
+window.$docsify = {
+ fallbackLanguages: ['fr', 'de']
+};
+```
diff --git a/docs/zh-cn/configuration.md b/docs/zh-cn/configuration.md
index ef80b9f..f91355f 100644
--- a/docs/zh-cn/configuration.md
+++ b/docs/zh-cn/configuration.md
@@ -413,3 +413,21 @@ window.$docsify = {
ext: '.md'
};
```
+
+## fallbackLanguages
+
+* type: `Array`
+
+List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
+
+Example:
+
+* try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
+* then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
+* then display 404 page.
+
+```js
+window.$docsify = {
+ fallbackLanguages: ['fr', 'de']
+};
+```
From 1335baa22fdeebd0c67550d67e006a4615a5bd13 Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Thu, 1 Mar 2018 22:42:48 +0800
Subject: [PATCH 008/180] [build] 4.6.4
---
docs/_coverpage.md | 2 +-
lib/docsify.js | 52 ++++++++++++++-----
lib/docsify.min.js | 2 +-
.../docsify-server-renderer/package-lock.json | 2 +-
packages/docsify-server-renderer/package.json | 2 +-
5 files changed, 43 insertions(+), 17 deletions(-)
diff --git a/docs/_coverpage.md b/docs/_coverpage.md
index 3ac8927..183d669 100644
--- a/docs/_coverpage.md
+++ b/docs/_coverpage.md
@@ -1,6 +1,6 @@

-# docsify 4.6.3
+# docsify 4.6.4
> A magical documentation site generator.
diff --git a/lib/docsify.js b/lib/docsify.js
index 18ef550..467a10e 100644
--- a/lib/docsify.js
+++ b/lib/docsify.js
@@ -3747,7 +3747,7 @@ function renderMixin (proto) {
callHook(this$1, 'afterEach', html, function (text) { return renderMain.call(this$1, text); });
};
if (this$1.isHTML) {
- html = this$1.result;
+ html = this$1.result = text;
callback();
next();
} else {
@@ -4177,14 +4177,39 @@ function fetchMixin (proto) {
var loadNavbar = ref$1.loadNavbar;
var loadSidebar = ref$1.loadSidebar;
var requestHeaders = ref$1.requestHeaders;
-
+ var fallbackLanguages = ref$1.fallbackLanguages;
// Abort last request
last && last.abort && last.abort();
- last = get(this.router.getFile(path) + qs, true, requestHeaders);
+ var file = this.router.getFile(path);
+ last = get(file + qs, true, requestHeaders);
// Current page is html
- this.isHTML = /\.html$/g.test(path);
+ this.isHTML = /\.html$/g.test(file);
+
+ var getFallBackPage = function (file) {
+ if (!fallbackLanguages) {
+ return false
+ }
+
+ var local = file.split('/')[1];
+
+ if (fallbackLanguages.indexOf(local) === -1) {
+ return false
+ }
+
+ file = file.replace(new RegExp(("^/" + local)), '');
+
+ return get(file + qs, true, requestHeaders)
+ .then(
+ function (text, opt) {
+ this$1._renderMain(text, opt, loadSideAndNav);
+ },
+ function (_) {
+ return this$1._renderMain(null, {}, loadSideAndNav)
+ }
+ )
+ };
var loadSideAndNav = function () {
if (!loadSidebar) { return cb() }
@@ -4199,14 +4224,15 @@ function fetchMixin (proto) {
};
// Load main content
- last.then(
- function (text, opt) {
- this$1._renderMain(text, opt, loadSideAndNav);
- },
- function (_) {
- this$1._renderMain(null, {}, loadSideAndNav);
- }
- );
+ last
+ .then(
+ function (text, opt) {
+ this$1._renderMain(text, opt, loadSideAndNav);
+ },
+ function (_) {
+ return getFallBackPage(file) || this$1._renderMain(null, {}, loadSideAndNav)
+ }
+ );
// Load nav
loadNavbar &&
@@ -4379,7 +4405,7 @@ initGlobalAPI();
/**
* Version
*/
-Docsify.version = '4.6.3';
+Docsify.version = '4.6.4';
/**
* Run Docsify
diff --git a/lib/docsify.min.js b/lib/docsify.min.js
index de7cb5f..a660b5d 100644
--- a/lib/docsify.min.js
+++ b/lib/docsify.min.js
@@ -1 +1 @@
-!function(){function e(e){var t=Object.create(null);return function(n){var i=r(n)?n:JSON.stringify(n);return t[i]||(t[i]=e(n))}}var t=e(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),n=Object.assign||function(e){for(var t=arguments,n=Object.prototype.hasOwnProperty,r=1;r=o.length)r(n);else if("function"==typeof t)if(2===t.length)t(n,function(t){n=t,a(e+1)});else{var i=t(n);n=void 0!==i?i:n,a(e+1)}else a(e+1)};a(0)}var h=!0,p=h&&document.body.clientWidth<=600,d=h&&window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),g={};function f(e,t){if(void 0===t&&(t=!1),"string"==typeof e){if(void 0!==window.Vue)return y(e);e=t?y(e):g[e]||(g[e]=y(e))}return e}var m=h&&document,v=h&&m.body,b=h&&m.head;function y(e,t){return t?e.querySelector(t):m.querySelector(e)}function k(e,t){return[].slice.call(t?e.querySelectorAll(t):m.querySelectorAll(e))}function w(e,t){return e=m.createElement(e),t&&(e.innerHTML=t),e}function x(e,t){return e.appendChild(t)}function _(e,t){return e.insertBefore(t,e.children[0])}function S(e,t,n){o(t)?window.addEventListener(e,t):e.addEventListener(t,n)}function C(e,t,n){o(t)?window.removeEventListener(e,t):e.removeEventListener(t,n)}function L(e,t,n){e&&e.classList[n?t:"toggle"](n||t)}var E=Object.freeze({getNode:f,$:m,body:v,head:b,find:y,findAll:k,create:w,appendTo:x,before:_,on:S,off:C,toggleClass:L,style:function(e){x(b,w("style",e))}});function $(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+=''+e.title+"",e.children&&(t+='")}),t):""}function A(e,t){return''+t.slice(5).trim()+"
"}var T,P;function O(e){var t,n=e.loaded,r=e.total,i=e.step;!T&&function(){var e=w("div");e.classList.add("progress"),x(v,e),T=e}(),t=i?(t=parseInt(T.style.width||0,10)+i)>80?80:t:Math.floor(n/r*100),T.style.opacity=1,T.style.width=t>=95?"100%":t+"%",t>=95&&(clearTimeout(P),P=setTimeout(function(e){T.style.opacity=0,T.style.width="0%"},200))}var F={};function M(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});var r=new XMLHttpRequest,o=function(){r.addEventListener.apply(r,arguments)},a=F[e];if(a)return{then:function(e){return e(a.content,a.opt)},abort:i};r.open("GET",e);for(var s in n)r.setRequestHeader(s,n[s]);return r.send(),{then:function(n,a){if(void 0===a&&(a=i),t){var s=setInterval(function(e){return O({step:Math.floor(5*Math.random()+1)})},500);o("progress",O),o("loadend",function(e){O(e),clearInterval(s)})}o("error",a),o("load",function(t){var i=t.target;if(i.status>=400)a(i);else{var o=F[e]={content:i.response,opt:{updatedAt:r.getResponseHeader("last-modified")}};n(o.content,o.opt)}})},abort:function(e){return 4!==r.readyState&&r.abort()}}}function j(e,t){e.innerHTML=e.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,t)}var N=/([^{]*?)\w(?=\})/g,q={YYYY:"getFullYear",YY:"getYear",MM:function(e){return e.getMonth()+1},DD:"getDate",HH:"getHours",mm:"getMinutes",ss:"getSeconds"};var R="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function H(e,t){return e(t={exports:{}},t.exports),t.exports}var z=H(function(e,t){(function(){var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:p,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:p,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:p,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=l(t.item,"gm")(/bull/g,t.bullet)(),t.list=l(t.list)(/bull/g,t.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+t.def.source+")")(),t.blockquote=l(t.blockquote)("def",t.def)(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",t.html=l(t.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,t._tag)(),t.paragraph=l(t.paragraph)("hr",t.hr)("heading",t.heading)("lheading",t.lheading)("blockquote",t.blockquote)("tag","<"+t._tag)("def",t.def)(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=l(t.paragraph)("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|")(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function n(e){this.tokens=[],this.tokens.links={},this.options=e||g.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n,r){var i,o,a,s,l,c,u,h,p;for(e=e.replace(/^ +$/gm,"");e;)if((a=this.rules.newline.exec(e))&&(e=e.substring(a[0].length),a[0].length>1&&this.tokens.push({type:"space"})),a=this.rules.code.exec(e))e=e.substring(a[0].length),a=a[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?a:a.replace(/\n+$/,"")});else if(a=this.rules.fences.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"code",lang:a[2],text:a[3]||""});else if(a=this.rules.heading.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"heading",depth:a[1].length,text:a[2]});else if(n&&(a=this.rules.nptable.exec(e))){for(e=e.substring(a[0].length),c={type:"table",header:a[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3].replace(/\n$/,"").split("\n")},h=0;h ?/gm,""),this.token(a,n,!0),this.tokens.push({type:"blockquote_end"});else if(a=this.rules.list.exec(e)){for(e=e.substring(a[0].length),s=a[2],this.tokens.push({type:"list_start",ordered:s.length>1}),i=!1,p=(a=a[0].match(this.rules.item)).length,h=0;h1&&l.length>1||(e=a.slice(h+1).join("\n")+e,h=p-1)),o=i||/\n\n(?!\s*$)/.test(c),h!==p-1&&(i="\n"===c.charAt(c.length-1),o||(o=i)),this.tokens.push({type:o?"loose_item_start":"list_item_start"}),this.token(c,!1,r),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(a=this.rules.html.exec(e))e=e.substring(a[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===a[1]||"script"===a[1]||"style"===a[1]),text:a[0]});else if(!r&&n&&(a=this.rules.def.exec(e)))e=e.substring(a[0].length),this.tokens.links[a[1].toLowerCase()]={href:a[2],title:a[3]};else if(n&&(a=this.rules.table.exec(e))){for(e=e.substring(a[0].length),c={type:"table",header:a[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3].replace(/(?: *\| *)?\n$/,"").split("\n")},h=0;h])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,url:p,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:p,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=l(r.link)("inside",r._inside)("href",r._href)(),r.reflink=l(r.reflink)("inside",r._inside)(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:l(r.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(r.text)("]|","~]|")("|","|https?://|")()}),r.breaks=d({},r.gfm,{br:l(r.br)("{2,}","*")(),text:l(r.gfm.text)("{2,}","*")()});function i(e,t){if(this.options=t||g.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new o,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=r.breaks:this.rules=r.gfm:this.options.pedantic&&(this.rules=r.pedantic)}i.rules=r,i.output=function(e,t,n){return new i(t,n).output(e)},i.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1])),r=this.mangle("mailto:")+n):r=n=s(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),r=n=s(i[1]),o+=this.renderer.link(r,null,n);return o},i.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+=""+t+";";return n};function o(e){this.options=e||{}}o.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?''+(n?e:s(e,!0))+"\n
\n":""+(n?e:s(e,!0))+"\n
"},o.prototype.blockquote=function(e){return"\n"+e+"
\n"},o.prototype.html=function(e){return e},o.prototype.heading=function(e,t,n){return"\n"},o.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},o.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+""+n+">\n"},o.prototype.listitem=function(e){return""+e+"\n"},o.prototype.paragraph=function(e){return""+e+"
\n"},o.prototype.table=function(e,t){return"\n"},o.prototype.tablerow=function(e){return"\n"+e+"
\n"},o.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+""+n+">\n"},o.prototype.strong=function(e){return""+e+""},o.prototype.em=function(e){return""+e+""},o.prototype.codespan=function(e){return""+e+""},o.prototype.br=function(){return this.options.xhtml?"
":"
"},o.prototype.del=function(e){return""+e+""},o.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent((i=e,i.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}var i;this.options.baseUrl&&!h.test(e)&&(e=c(this.options.baseUrl,e));var o='"+n+""},o.prototype.image=function(e,t,n){this.options.baseUrl&&!h.test(e)&&(e=c(this.options.baseUrl,e));var r='
":">"},o.prototype.text=function(e){return e};function a(e){this.tokens=[],this.token=null,this.options=e||g.defaults,this.options.renderer=this.options.renderer||new o,this.renderer=this.options.renderer,this.renderer.options=this.options}a.parse=function(e,t,n){return new a(t,n).parse(e)},a.prototype.parse=function(e){this.inline=new i(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},a.prototype.next=function(){return this.token=this.tokens.pop()},a.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},a.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},a.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",o="";for(n="",e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=(i=i.source||i).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function c(e,t){return u[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?u[" "+e]=e+"/":u[" "+e]=e.replace(/[^/]*$/,"")),e=u[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}var u={},h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(){}p.exec=p;function d(e){for(var t,n,r=arguments,i=1;iAn error occurred:
"+s(e.message+"",!0)+"
";throw e}}g.options=g.setOptions=function(e){return d(g.defaults,e),g},g.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new o,xhtml:!1,baseUrl:null},g.Parser=a,g.parser=a.parse,g.Renderer=o,g.Lexer=n,g.lexer=n.lex,g.InlineLexer=i,g.inlineLexer=i.output,g.parse=g,e.exports=g}).call(function(){return this||("undefined"!=typeof window?window:R)}())}),I=H(function(e){var t="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},n=function(){var e=/\blang(?:uage)?-(\w+)\b/i,n=0,r=t.Prism={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof i?new i(e.type,r.util.encode(e.content),e.alias):"Array"===r.util.type(e)?e.map(r.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof l)){p.lastIndex=0;var x=1;if(!($=p.exec(w))&&f&&y!=t.length-1){if(p.lastIndex=k,!($=p.exec(e)))break;for(var _=$.index+(g?$[1].length:0),S=$.index+$[0].length,C=y,L=k,E=t.length;C=(L+=t[C].length)&&(++y,k=L);if(t[y]instanceof l||t[C-1].greedy)continue;x=C-y,w=e.slice(k,L),$.index-=k}if($){g&&(m=$[1].length);S=(_=$.index+m)+($=$[0].slice(m)).length;var $,A=w.slice(0,_),T=w.slice(S),P=[y,x];A&&(++y,k+=A.length,P.push(A));var O=new l(c,d?r.tokenize($,d):$,v,$,f);if(P.push(O),T&&P.push(T),Array.prototype.splice.apply(t,P),1!=x&&r.matchGrammar(e,t,n,y,k,!0,c),a)break}else if(a)break}}}}},tokenize:function(e,t,n){var i=[e],o=t.rest;if(o){for(var a in o)t[a]=o[a];delete t.rest}return r.matchGrammar(e,i,t,0,0,!1),i},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,o=0;i=n[o++];)i(t)}}},i=r.Token=function(e,t,n,r,i){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!i};if(i.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join("");var o={type:e.type,content:i.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if(e.alias){var a="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(o.classes,a)}r.hooks.run("wrap",o);var s=Object.keys(o.attributes).map(function(e){return e+'="'+(o.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+(s?" "+s:"")+">"+o.content+""+o.tag+">"},!t.document)return t.addEventListener?(r.disableWorkerMessageHandler||t.addEventListener("message",function(e){var n=JSON.parse(e.data),i=n.language,o=n.code,a=n.immediateClose;t.postMessage(r.highlight(o,r.languages[i],i)),a&&t.close()},!1),t.Prism):t.Prism;var o=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return o&&(r.filename=o.src,r.manual||o.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(r.highlightAll):window.setTimeout(r.highlightAll,16):document.addEventListener("DOMContentLoaded",r.highlightAll))),t.Prism}();e.exports&&(e.exports=n),void 0!==R&&(R.Prism=n),n.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),n.languages.xml=n.languages.markup,n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},n.languages.css.atrule.inside.rest=n.util.clone(n.languages.css),n.languages.markup&&(n.languages.insertBefore("markup","tag",{style:{pattern:/(")).firstElementChild),function(e){if(!(window.CSS&&window.CSS.supports&&window.CSS.supports("(--v:red)"))){var t=k("style:not(.inserted),link");[].forEach.call(t,function(t){if("STYLE"===t.nodeName)j(t,e);else if("LINK"===t.nodeName){var n=t.getAttribute("href");if(!/\.css$/.test(n))return;M(n).then(function(t){var n=w("style",t);b.appendChild(n),j(n,e)})}})}}(t.themeColor));var l;e._updateRender(),L(v,"ready")}var Ee={};var $e=function(e){this.config=e};$e.prototype.getBasePath=function(){return this.config.basePath},$e.prototype.getFile=function(e,t){void 0===e&&(e=this.getCurrentPath());var n=this.config,r=this.getBasePath(),i="string"!=typeof n.ext?".md":n.ext;e=n.alias?function e(t,n,r){var i=Object.keys(n).filter(function(e){return(Ee[e]||(Ee[e]=new RegExp("^"+e+"$"))).test(t)&&t!==r})[0];return i?e(t.replace(Ee[i],n[i]),n,t):t}(e,n.alias):e,o=e,a=i;var o,a;return e=(e=new RegExp("\\.("+a.replace(/^\./,"")+"|html)$","g").test(o)?o:/\/$/g.test(o)?o+"README"+a:""+o+a)==="/README"+i?n.homepage||e:e,e=K(e)?e:J(r,e),t&&(e=e.replace(new RegExp("^"+r),"")),e},$e.prototype.onchange=function(e){void 0===e&&(e=i),e()},$e.prototype.getCurrentPath=function(){},$e.prototype.normalize=function(){},$e.prototype.parse=function(){},$e.prototype.toURL=function(e,t,r){var i=r&&"#"===e[0],o=this.parse(ne(e));if(o.query=n({},o.query,t),e=(e=o.path+Z(o.query)).replace(/\.md(\?)|\.md$/,"$1"),i){var a=r.indexOf("?");e=(a>0?r.substr(0,a):r)+e}return te("/"+e)};function Ae(e){var t=location.href.indexOf("#");location.replace(location.href.slice(0,t>=0?t:0)+"#"+e)}var Te=function(e){function t(t){e.call(this,t),this.mode="hash"}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getBasePath=function(){var e=window.location.pathname||"",t=this.config.basePath;return/^(\/|https?:)/g.test(t)?t:te(e+"/"+t)},t.prototype.getCurrentPath=function(){var e=location.href,t=e.indexOf("#");return-1===t?"":e.slice(t+1)},t.prototype.onchange=function(e){void 0===e&&(e=i),S("hashchange",e)},t.prototype.normalize=function(){var e=this.getCurrentPath();if("/"===(e=ne(e)).charAt(0))return Ae(e);Ae("/"+e)},t.prototype.parse=function(e){void 0===e&&(e=location.href);var t="",n=e.indexOf("#");n>=0&&(e=e.slice(n+1));var r=e.indexOf("?");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{path:e,file:this.getFile(e,!0),query:V(t)}},t.prototype.toURL=function(t,n,r){return"#"+e.prototype.toURL.call(this,t,n,r)},t}($e),Pe=function(e){function t(t){e.call(this,t),this.mode="history"}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCurrentPath=function(){var e=this.getBasePath(),t=window.location.pathname;return e&&0===t.indexOf(e)&&(t=t.slice(e.length)),(t||"/")+window.location.search+window.location.hash},t.prototype.onchange=function(e){void 0===e&&(e=i),S("click",function(t){var n="A"===t.target.tagName?t.target:t.target.parentNode;if("A"===n.tagName&&!/_blank/.test(n.target)){t.preventDefault();var r=n.href;window.history.pushState({key:r},"",r),e()}}),S("popstate",e)},t.prototype.parse=function(e){void 0===e&&(e=location.href);var t="",n=e.indexOf("?");n>=0&&(t=e.slice(n+1),e=e.slice(0,n));var r=J(location.origin),i=e.indexOf(r);return i>-1&&(e=e.slice(i+r.length)),{path:e,file:this.getFile(e),query:V(t)}},t}($e);var Oe={};function Fe(e){e.router.normalize(),e.route=e.router.parse(),v.setAttribute("data-page",e.route.file)}function Me(e){!function(e,t){var n=function(e){return v.classList.toggle("close")};S(e=f(e),"click",function(e){e.stopPropagation(),n()}),p&&S(v,"click",function(e){return v.classList.contains("close")&&n()})}("button.sidebar-toggle",e.router),t=".sidebar",e.router,S(t=f(t),"click",function(e){var t=e.target;"A"===t.nodeName&&t.nextSibling&&t.nextSibling.classList.contains("app-sub-sidebar")&&L(t.parentNode,"collapse")});var t;e.config.coverpage?!p&&S("scroll",le):v.classList.add("sticky")}function je(e,t,n,r,i,o){e=o?e:e.replace(/\/$/,""),(e=ee(e))&&M(i.router.getFile(e+n)+t,!1,i.config.requestHeaders).then(r,function(o){return je(e,t,n,r,i)})}var Ne=Object.freeze({cached:e,hyphenate:t,merge:n,isPrimitive:r,noop:i,isFn:o,inBrowser:h,isMobile:p,supportsPushState:d,parseQuery:V,stringifyQuery:Z,getPath:J,isAbsolutePath:K,getParentPath:ee,cleanPath:te,replaceSlug:ne});function qe(){this._init()}var Re=qe.prototype;Re._init=function(){this.config=a||{},(e=this)._hooks={},e._lifecycle={},["init","mounted","beforeEach","afterEach","doneEach","ready"].forEach(function(t){var n=e._hooks[t]=[];e._lifecycle[t]=function(e){return n.push(e)}});var e;[].concat((t=this).config.plugins).forEach(function(e){return o(e)&&e(t._lifecycle,t)});var t;u(this,"init"),function(e){var t,n=e.config;t="history"===(n.routerMode||"hash")&&d?new Pe(n):new Te(n),e.router=t,Fe(e),Oe=e.route,t.onchange(function(t){Fe(e),e._updateRender(),Oe.path!==e.route.path?(e.$fetch(),Oe=e.route):e.$resetEvents()})}(this),Le(this),Me(this),function(e){var t=e.config.loadSidebar;if(e.rendered){var n=ce(e.router,".sidebar-nav",!0,!0);t&&n&&(n.parentNode.innerHTML+=window.__SUB_SIDEBAR__),e._bindEventOnRendered(n),e.$resetEvents(),u(e,"doneEach"),u(e,"ready")}else e.$fetch(function(t){return u(e,"ready")})}(this),u(this,"mounted")};Re.route={};(He=Re)._renderTo=function(e,t,n){var r=f(e);r&&(r[n?"outerHTML":"innerHTML"]=t)},He._renderSidebar=function(e){var t=this.config,n=t.maxLevel,r=t.subMaxLevel,i=t.loadSidebar;this._renderTo(".sidebar-nav",this.compiler.sidebar(e,n));var o=ce(this.router,".sidebar-nav",!0,!0);i&&o?o.parentNode.innerHTML+=this.compiler.subSidebar(r)||"":this.compiler.subSidebar(),this._bindEventOnRendered(o)},He._bindEventOnRendered=function(e){var t=this.config,n=t.autoHeader,r=t.auto2top;if(function(e){var t=y(".cover.show");me=t?t.offsetHeight:0;for(var n=f(".sidebar"),r=k(n,"li"),i=0,o=r.length;i([^<]*?)
$');if(i){if("color"===i[2])n.style.background=i[1]+(i[3]||"");else{var o=i[1];L(n,"add","has-mask"),K(i[1])||(o=J(this.router.getBasePath(),i[1])),n.style.backgroundImage="url("+o+")",n.style.backgroundSize="cover",n.style.backgroundPosition="center center"}r=r.replace(i[0],"")}this._renderTo(".cover-main",r),le()}else L(n,"remove","show")},He._updateRender=function(){!function(e){var t=f(".app-name-link"),n=e.config.nameLink,i=e.route.path;if(t)if(r(e.config.nameLink))t.setAttribute("href",n);else if("object"==typeof n){var o=Object.keys(n).filter(function(e){return i.indexOf(e)>-1})[0];t.setAttribute("href",n[o])}}(this)};var He;!function(e){var t;e._fetch=function(e){var n=this;void 0===e&&(e=i);var r=this.route,o=r.path,a=Z(r.query,["id"]),s=this.config,l=s.loadNavbar,c=s.loadSidebar,u=s.requestHeaders;t&&t.abort&&t.abort(),t=M(this.router.getFile(o)+a,!0,u),this.isHTML=/\.html$/g.test(o);var h=function(){if(!c)return e();je(o,a,c,function(t){n._renderSidebar(t),e()},n,!0)};t.then(function(e,t){n._renderMain(e,t,h)},function(e){n._renderMain(null,{},h)}),l&&je(o,a,l,function(e){return n._renderNav(e)},this,!0)},e._fetchCover=function(){var e=this,t=this.config,n=t.coverpage,r=t.requestHeaders,i=this.route.query,o=ee(this.route.path);if(n){var a=null,s=this.route.path;if("string"==typeof n)"/"===s&&(a=n);else if(Array.isArray(n))a=n.indexOf(s)>-1&&"_coverpage";else{var l=n[s];a=!0===l?"_coverpage":l}var c=!!a&&this.config.onlyCover;return a?(a=this.router.getFile(o+a),this.coverIsHTML=/\.html$/g.test(a),M(a+Z(i,["id"]),!1,r).then(function(t){return e._renderCover(t,c)})):this._renderCover(null,c),c}},e.$fetch=function(e){var t=this;void 0===e&&(e=i);var n=function(){u(t,"doneEach"),e()};this._fetchCover()?n():this._fetch(function(e){t.$resetEvents(),n()})}}(Re),Re.$resetEvents=function(){ye(this.route.path,this.route.query.id),ce(this.router,"nav")};window.Docsify={util:Ne,dom:E,get:M,slugify:W},window.DocsifyCompiler=ae,window.marked=z,window.Prism=I,qe.version="4.6.3",function(e){var t=document.readyState;if("complete"===t||"interactive"===t)return setTimeout(e,0);document.addEventListener("DOMContentLoaded",e)}(function(e){return new qe})}();
+!function(){function e(e){var t=Object.create(null);return function(n){var i=r(n)?n:JSON.stringify(n);return t[i]||(t[i]=e(n))}}var t=e(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),n=Object.assign||function(e){for(var t=arguments,n=Object.prototype.hasOwnProperty,r=1;r=a.length)r(n);else if("function"==typeof t)if(2===t.length)t(n,function(t){n=t,o(e+1)});else{var i=t(n);n=void 0!==i?i:n,o(e+1)}else o(e+1)};o(0)}var h=!0,p=h&&document.body.clientWidth<=600,d=h&&window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),g={};function f(e,t){if(void 0===t&&(t=!1),"string"==typeof e){if(void 0!==window.Vue)return y(e);e=t?y(e):g[e]||(g[e]=y(e))}return e}var m=h&&document,v=h&&m.body,b=h&&m.head;function y(e,t){return t?e.querySelector(t):m.querySelector(e)}function k(e,t){return[].slice.call(t?e.querySelectorAll(t):m.querySelectorAll(e))}function w(e,t){return e=m.createElement(e),t&&(e.innerHTML=t),e}function x(e,t){return e.appendChild(t)}function _(e,t){return e.insertBefore(t,e.children[0])}function S(e,t,n){a(t)?window.addEventListener(e,t):e.addEventListener(t,n)}function C(e,t,n){a(t)?window.removeEventListener(e,t):e.removeEventListener(t,n)}function L(e,t,n){e&&e.classList[n?t:"toggle"](n||t)}var E=Object.freeze({getNode:f,$:m,body:v,head:b,find:y,findAll:k,create:w,appendTo:x,before:_,on:S,off:C,toggleClass:L,style:function(e){x(b,w("style",e))}});function $(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+=''+e.title+"",e.children&&(t+='")}),t):""}function A(e,t){return''+t.slice(5).trim()+"
"}var T,P;function O(e){var t,n=e.loaded,r=e.total,i=e.step;!T&&function(){var e=w("div");e.classList.add("progress"),x(v,e),T=e}(),t=i?(t=parseInt(T.style.width||0,10)+i)>80?80:t:Math.floor(n/r*100),T.style.opacity=1,T.style.width=t>=95?"100%":t+"%",t>=95&&(clearTimeout(P),P=setTimeout(function(e){T.style.opacity=0,T.style.width="0%"},200))}var F={};function M(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});var r=new XMLHttpRequest,a=function(){r.addEventListener.apply(r,arguments)},o=F[e];if(o)return{then:function(e){return e(o.content,o.opt)},abort:i};r.open("GET",e);for(var s in n)r.setRequestHeader(s,n[s]);return r.send(),{then:function(n,o){if(void 0===o&&(o=i),t){var s=setInterval(function(e){return O({step:Math.floor(5*Math.random()+1)})},500);a("progress",O),a("loadend",function(e){O(e),clearInterval(s)})}a("error",o),a("load",function(t){var i=t.target;if(i.status>=400)o(i);else{var a=F[e]={content:i.response,opt:{updatedAt:r.getResponseHeader("last-modified")}};n(a.content,a.opt)}})},abort:function(e){return 4!==r.readyState&&r.abort()}}}function j(e,t){e.innerHTML=e.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,t)}var N=/([^{]*?)\w(?=\})/g,R={YYYY:"getFullYear",YY:"getYear",MM:function(e){return e.getMonth()+1},DD:"getDate",HH:"getHours",mm:"getMinutes",ss:"getSeconds"};var q="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function H(e,t){return e(t={exports:{}},t.exports),t.exports}var z=H(function(e,t){(function(){var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:p,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:p,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:p,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=l(t.item,"gm")(/bull/g,t.bullet)(),t.list=l(t.list)(/bull/g,t.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+t.def.source+")")(),t.blockquote=l(t.blockquote)("def",t.def)(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",t.html=l(t.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,t._tag)(),t.paragraph=l(t.paragraph)("hr",t.hr)("heading",t.heading)("lheading",t.lheading)("blockquote",t.blockquote)("tag","<"+t._tag)("def",t.def)(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=l(t.paragraph)("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|")(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function n(e){this.tokens=[],this.tokens.links={},this.options=e||g.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n,r){var i,a,o,s,l,c,u,h,p;for(e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(n&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),c={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},h=0;h ?/gm,""),this.token(o,n,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),s=o[2],this.tokens.push({type:"list_start",ordered:s.length>1}),i=!1,p=(o=o[0].match(this.rules.item)).length,h=0;h1&&l.length>1||(e=o.slice(h+1).join("\n")+e,h=p-1)),a=i||/\n\n(?!\s*$)/.test(c),h!==p-1&&(i="\n"===c.charAt(c.length-1),a||(a=i)),this.tokens.push({type:a?"loose_item_start":"list_item_start"}),this.token(c,!1,r),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!r&&n&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(n&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),c={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},h=0;h])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,url:p,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:p,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=l(r.link)("inside",r._inside)("href",r._href)(),r.reflink=l(r.reflink)("inside",r._inside)(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:l(r.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(r.text)("]|","~]|")("|","|https?://|")()}),r.breaks=d({},r.gfm,{br:l(r.br)("{2,}","*")(),text:l(r.gfm.text)("{2,}","*")()});function i(e,t){if(this.options=t||g.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new a,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=r.breaks:this.rules=r.gfm:this.options.pedantic&&(this.rules=r.pedantic)}i.rules=r,i.output=function(e,t,n){return new i(t,n).output(e)},i.prototype.output=function(e){for(var t,n,r,i,a="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),a+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1])),r=this.mangle("mailto:")+n):r=n=s(i[1]),a+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),a+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,a+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){a+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,a+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),a+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),a+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),a+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),a+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),a+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),a+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),r=n=s(i[1]),a+=this.renderer.link(r,null,n);return a},i.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+=""+t+";";return n};function a(e){this.options=e||{}}a.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?''+(n?e:s(e,!0))+"\n
\n":""+(n?e:s(e,!0))+"\n
"},a.prototype.blockquote=function(e){return"\n"+e+"
\n"},a.prototype.html=function(e){return e},a.prototype.heading=function(e,t,n){return"\n"},a.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},a.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+""+n+">\n"},a.prototype.listitem=function(e){return""+e+"\n"},a.prototype.paragraph=function(e){return""+e+"
\n"},a.prototype.table=function(e,t){return"\n"},a.prototype.tablerow=function(e){return"\n"+e+"
\n"},a.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+""+n+">\n"},a.prototype.strong=function(e){return""+e+""},a.prototype.em=function(e){return""+e+""},a.prototype.codespan=function(e){return""+e+""},a.prototype.br=function(){return this.options.xhtml?"
":"
"},a.prototype.del=function(e){return""+e+""},a.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent((i=e,i.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}var i;this.options.baseUrl&&!h.test(e)&&(e=c(this.options.baseUrl,e));var a='"+n+""},a.prototype.image=function(e,t,n){this.options.baseUrl&&!h.test(e)&&(e=c(this.options.baseUrl,e));var r='
":">"},a.prototype.text=function(e){return e};function o(e){this.tokens=[],this.token=null,this.options=e||g.defaults,this.options.renderer=this.options.renderer||new a,this.renderer=this.options.renderer,this.renderer.options=this.options}o.parse=function(e,t,n){return new o(t,n).parse(e)},o.prototype.parse=function(e){this.inline=new i(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",a="";for(n="",e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=(i=i.source||i).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function c(e,t){return u[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?u[" "+e]=e+"/":u[" "+e]=e.replace(/[^/]*$/,"")),e=u[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}var u={},h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(){}p.exec=p;function d(e){for(var t,n,r=arguments,i=1;iAn error occurred:
"+s(e.message+"",!0)+"
";throw e}}g.options=g.setOptions=function(e){return d(g.defaults,e),g},g.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new a,xhtml:!1,baseUrl:null},g.Parser=o,g.parser=o.parse,g.Renderer=a,g.Lexer=n,g.lexer=n.lex,g.InlineLexer=i,g.inlineLexer=i.output,g.parse=g,e.exports=g}).call(function(){return this||("undefined"!=typeof window?window:q)}())}),I=H(function(e){var t="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},n=function(){var e=/\blang(?:uage)?-(\w+)\b/i,n=0,r=t.Prism={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof i?new i(e.type,r.util.encode(e.content),e.alias):"Array"===r.util.type(e)?e.map(r.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof l)){p.lastIndex=0;var x=1;if(!($=p.exec(w))&&f&&y!=t.length-1){if(p.lastIndex=k,!($=p.exec(e)))break;for(var _=$.index+(g?$[1].length:0),S=$.index+$[0].length,C=y,L=k,E=t.length;C=(L+=t[C].length)&&(++y,k=L);if(t[y]instanceof l||t[C-1].greedy)continue;x=C-y,w=e.slice(k,L),$.index-=k}if($){g&&(m=$[1].length);S=(_=$.index+m)+($=$[0].slice(m)).length;var $,A=w.slice(0,_),T=w.slice(S),P=[y,x];A&&(++y,k+=A.length,P.push(A));var O=new l(c,d?r.tokenize($,d):$,v,$,f);if(P.push(O),T&&P.push(T),Array.prototype.splice.apply(t,P),1!=x&&r.matchGrammar(e,t,n,y,k,!0,c),o)break}else if(o)break}}}}},tokenize:function(e,t,n){var i=[e],a=t.rest;if(a){for(var o in a)t[o]=a[o];delete t.rest}return r.matchGrammar(e,i,t,0,0,!1),i},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,a=0;i=n[a++];)i(t)}}},i=r.Token=function(e,t,n,r,i){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!i};if(i.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join("");var a={type:e.type,content:i.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if(e.alias){var o="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(a.classes,o)}r.hooks.run("wrap",a);var s=Object.keys(a.attributes).map(function(e){return e+'="'+(a.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+a.tag+' class="'+a.classes.join(" ")+'"'+(s?" "+s:"")+">"+a.content+""+a.tag+">"},!t.document)return t.addEventListener?(r.disableWorkerMessageHandler||t.addEventListener("message",function(e){var n=JSON.parse(e.data),i=n.language,a=n.code,o=n.immediateClose;t.postMessage(r.highlight(a,r.languages[i],i)),o&&t.close()},!1),t.Prism):t.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(r.filename=a.src,r.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(r.highlightAll):window.setTimeout(r.highlightAll,16):document.addEventListener("DOMContentLoaded",r.highlightAll))),t.Prism}();e.exports&&(e.exports=n),void 0!==q&&(q.Prism=n),n.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),n.languages.xml=n.languages.markup,n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},n.languages.css.atrule.inside.rest=n.util.clone(n.languages.css),n.languages.markup&&(n.languages.insertBefore("markup","tag",{style:{pattern:/(")).firstElementChild),function(e){if(!(window.CSS&&window.CSS.supports&&window.CSS.supports("(--v:red)"))){var t=k("style:not(.inserted),link");[].forEach.call(t,function(t){if("STYLE"===t.nodeName)j(t,e);else if("LINK"===t.nodeName){var n=t.getAttribute("href");if(!/\.css$/.test(n))return;M(n).then(function(t){var n=w("style",t);b.appendChild(n),j(n,e)})}})}}(t.themeColor));var l;e._updateRender(),L(v,"ready")}var Ee={};var $e=function(e){this.config=e};$e.prototype.getBasePath=function(){return this.config.basePath},$e.prototype.getFile=function(e,t){void 0===e&&(e=this.getCurrentPath());var n=this.config,r=this.getBasePath(),i="string"!=typeof n.ext?".md":n.ext;e=n.alias?function e(t,n,r){var i=Object.keys(n).filter(function(e){return(Ee[e]||(Ee[e]=new RegExp("^"+e+"$"))).test(t)&&t!==r})[0];return i?e(t.replace(Ee[i],n[i]),n,t):t}(e,n.alias):e,a=e,o=i;var a,o;return e=(e=new RegExp("\\.("+o.replace(/^\./,"")+"|html)$","g").test(a)?a:/\/$/g.test(a)?a+"README"+o:""+a+o)==="/README"+i?n.homepage||e:e,e=K(e)?e:J(r,e),t&&(e=e.replace(new RegExp("^"+r),"")),e},$e.prototype.onchange=function(e){void 0===e&&(e=i),e()},$e.prototype.getCurrentPath=function(){},$e.prototype.normalize=function(){},$e.prototype.parse=function(){},$e.prototype.toURL=function(e,t,r){var i=r&&"#"===e[0],a=this.parse(ne(e));if(a.query=n({},a.query,t),e=(e=a.path+Z(a.query)).replace(/\.md(\?)|\.md$/,"$1"),i){var o=r.indexOf("?");e=(o>0?r.substr(0,o):r)+e}return te("/"+e)};function Ae(e){var t=location.href.indexOf("#");location.replace(location.href.slice(0,t>=0?t:0)+"#"+e)}var Te=function(e){function t(t){e.call(this,t),this.mode="hash"}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getBasePath=function(){var e=window.location.pathname||"",t=this.config.basePath;return/^(\/|https?:)/g.test(t)?t:te(e+"/"+t)},t.prototype.getCurrentPath=function(){var e=location.href,t=e.indexOf("#");return-1===t?"":e.slice(t+1)},t.prototype.onchange=function(e){void 0===e&&(e=i),S("hashchange",e)},t.prototype.normalize=function(){var e=this.getCurrentPath();if("/"===(e=ne(e)).charAt(0))return Ae(e);Ae("/"+e)},t.prototype.parse=function(e){void 0===e&&(e=location.href);var t="",n=e.indexOf("#");n>=0&&(e=e.slice(n+1));var r=e.indexOf("?");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{path:e,file:this.getFile(e,!0),query:V(t)}},t.prototype.toURL=function(t,n,r){return"#"+e.prototype.toURL.call(this,t,n,r)},t}($e),Pe=function(e){function t(t){e.call(this,t),this.mode="history"}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCurrentPath=function(){var e=this.getBasePath(),t=window.location.pathname;return e&&0===t.indexOf(e)&&(t=t.slice(e.length)),(t||"/")+window.location.search+window.location.hash},t.prototype.onchange=function(e){void 0===e&&(e=i),S("click",function(t){var n="A"===t.target.tagName?t.target:t.target.parentNode;if("A"===n.tagName&&!/_blank/.test(n.target)){t.preventDefault();var r=n.href;window.history.pushState({key:r},"",r),e()}}),S("popstate",e)},t.prototype.parse=function(e){void 0===e&&(e=location.href);var t="",n=e.indexOf("?");n>=0&&(t=e.slice(n+1),e=e.slice(0,n));var r=J(location.origin),i=e.indexOf(r);return i>-1&&(e=e.slice(i+r.length)),{path:e,file:this.getFile(e),query:V(t)}},t}($e);var Oe={};function Fe(e){e.router.normalize(),e.route=e.router.parse(),v.setAttribute("data-page",e.route.file)}function Me(e){!function(e,t){var n=function(e){return v.classList.toggle("close")};S(e=f(e),"click",function(e){e.stopPropagation(),n()}),p&&S(v,"click",function(e){return v.classList.contains("close")&&n()})}("button.sidebar-toggle",e.router),t=".sidebar",e.router,S(t=f(t),"click",function(e){var t=e.target;"A"===t.nodeName&&t.nextSibling&&t.nextSibling.classList.contains("app-sub-sidebar")&&L(t.parentNode,"collapse")});var t;e.config.coverpage?!p&&S("scroll",le):v.classList.add("sticky")}function je(e,t,n,r,i,a){e=a?e:e.replace(/\/$/,""),(e=ee(e))&&M(i.router.getFile(e+n)+t,!1,i.config.requestHeaders).then(r,function(a){return je(e,t,n,r,i)})}var Ne=Object.freeze({cached:e,hyphenate:t,merge:n,isPrimitive:r,noop:i,isFn:a,inBrowser:h,isMobile:p,supportsPushState:d,parseQuery:V,stringifyQuery:Z,getPath:J,isAbsolutePath:K,getParentPath:ee,cleanPath:te,replaceSlug:ne});function Re(){this._init()}var qe=Re.prototype;qe._init=function(){this.config=o||{},(e=this)._hooks={},e._lifecycle={},["init","mounted","beforeEach","afterEach","doneEach","ready"].forEach(function(t){var n=e._hooks[t]=[];e._lifecycle[t]=function(e){return n.push(e)}});var e;[].concat((t=this).config.plugins).forEach(function(e){return a(e)&&e(t._lifecycle,t)});var t;u(this,"init"),function(e){var t,n=e.config;t="history"===(n.routerMode||"hash")&&d?new Pe(n):new Te(n),e.router=t,Fe(e),Oe=e.route,t.onchange(function(t){Fe(e),e._updateRender(),Oe.path!==e.route.path?(e.$fetch(),Oe=e.route):e.$resetEvents()})}(this),Le(this),Me(this),function(e){var t=e.config.loadSidebar;if(e.rendered){var n=ce(e.router,".sidebar-nav",!0,!0);t&&n&&(n.parentNode.innerHTML+=window.__SUB_SIDEBAR__),e._bindEventOnRendered(n),e.$resetEvents(),u(e,"doneEach"),u(e,"ready")}else e.$fetch(function(t){return u(e,"ready")})}(this),u(this,"mounted")};qe.route={};(He=qe)._renderTo=function(e,t,n){var r=f(e);r&&(r[n?"outerHTML":"innerHTML"]=t)},He._renderSidebar=function(e){var t=this.config,n=t.maxLevel,r=t.subMaxLevel,i=t.loadSidebar;this._renderTo(".sidebar-nav",this.compiler.sidebar(e,n));var a=ce(this.router,".sidebar-nav",!0,!0);i&&a?a.parentNode.innerHTML+=this.compiler.subSidebar(r)||"":this.compiler.subSidebar(),this._bindEventOnRendered(a)},He._bindEventOnRendered=function(e){var t=this.config,n=t.autoHeader,r=t.auto2top;if(function(e){var t=y(".cover.show");me=t?t.offsetHeight:0;for(var n=f(".sidebar"),r=k(n,"li"),i=0,a=r.length;i([^<]*?)$');if(i){if("color"===i[2])n.style.background=i[1]+(i[3]||"");else{var a=i[1];L(n,"add","has-mask"),K(i[1])||(a=J(this.router.getBasePath(),i[1])),n.style.backgroundImage="url("+a+")",n.style.backgroundSize="cover",n.style.backgroundPosition="center center"}r=r.replace(i[0],"")}this._renderTo(".cover-main",r),le()}else L(n,"remove","show")},He._updateRender=function(){!function(e){var t=f(".app-name-link"),n=e.config.nameLink,i=e.route.path;if(t)if(r(e.config.nameLink))t.setAttribute("href",n);else if("object"==typeof n){var a=Object.keys(n).filter(function(e){return i.indexOf(e)>-1})[0];t.setAttribute("href",n[a])}}(this)};var He;!function(e){var t;e._fetch=function(e){var n=this;void 0===e&&(e=i);var r=this.route,a=r.path,o=Z(r.query,["id"]),s=this.config,l=s.loadNavbar,c=s.loadSidebar,u=s.requestHeaders,h=s.fallbackLanguages;t&&t.abort&&t.abort();var p=this.router.getFile(a);t=M(p+o,!0,u),this.isHTML=/\.html$/g.test(p);var d=function(){if(!c)return e();je(a,o,c,function(t){n._renderSidebar(t),e()},n,!0)};t.then(function(e,t){n._renderMain(e,t,d)},function(e){return function(e){if(!h)return!1;var t=e.split("/")[1];return-1!==h.indexOf(t)&&M((e=e.replace(new RegExp("^/"+t),""))+o,!0,u).then(function(e,t){n._renderMain(e,t,d)},function(e){return n._renderMain(null,{},d)})}(p)||n._renderMain(null,{},d)}),l&&je(a,o,l,function(e){return n._renderNav(e)},this,!0)},e._fetchCover=function(){var e=this,t=this.config,n=t.coverpage,r=t.requestHeaders,i=this.route.query,a=ee(this.route.path);if(n){var o=null,s=this.route.path;if("string"==typeof n)"/"===s&&(o=n);else if(Array.isArray(n))o=n.indexOf(s)>-1&&"_coverpage";else{var l=n[s];o=!0===l?"_coverpage":l}var c=!!o&&this.config.onlyCover;return o?(o=this.router.getFile(a+o),this.coverIsHTML=/\.html$/g.test(o),M(o+Z(i,["id"]),!1,r).then(function(t){return e._renderCover(t,c)})):this._renderCover(null,c),c}},e.$fetch=function(e){var t=this;void 0===e&&(e=i);var n=function(){u(t,"doneEach"),e()};this._fetchCover()?n():this._fetch(function(e){t.$resetEvents(),n()})}}(qe),qe.$resetEvents=function(){ye(this.route.path,this.route.query.id),ce(this.router,"nav")};window.Docsify={util:Ne,dom:E,get:M,slugify:W},window.DocsifyCompiler=oe,window.marked=z,window.Prism=I,Re.version="4.6.4",function(e){var t=document.readyState;if("complete"===t||"interactive"===t)return setTimeout(e,0);document.addEventListener("DOMContentLoaded",e)}(function(e){return new Re})}();
diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json
index 50b7bc6..aa90403 100644
--- a/packages/docsify-server-renderer/package-lock.json
+++ b/packages/docsify-server-renderer/package-lock.json
@@ -37,5 +37,5 @@
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
}
},
- "version": "4.6.3"
+ "version": "4.6.4"
}
diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json
index e780e6b..1b5a575 100644
--- a/packages/docsify-server-renderer/package.json
+++ b/packages/docsify-server-renderer/package.json
@@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
- "version": "4.6.3",
+ "version": "4.6.4",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",
From ec8daca3ecea6a92fd10d525a7d8c094e8d4567a Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Thu, 1 Mar 2018 22:42:48 +0800
Subject: [PATCH 009/180] chore: add changelog 4.6.4
---
CHANGELOG.md | 15 +++++++++++++++
package-lock.json | 2 +-
package.json | 2 +-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f90be0..6001e14 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,18 @@
+
+## [4.6.4](https://github.com/QingWei-Li/docsify/compare/v4.6.3...v4.6.4) (2018-03-01)
+
+
+### Bug Fixes
+
+* **render:** Disable markdown parsing when the file is an HTML ([#403](https://github.com/QingWei-Li/docsify/issues/403)) ([278a75e](https://github.com/QingWei-Li/docsify/commit/278a75e))
+
+
+### Features
+
+* **fetch:** Add fallback languages configuration. ([#402](https://github.com/QingWei-Li/docsify/issues/402)) ([ecc0e04](https://github.com/QingWei-Li/docsify/commit/ecc0e04))
+
+
+
## [4.6.3](https://github.com/QingWei-Li/docsify/compare/v4.6.2...v4.6.3) (2018-02-15)
diff --git a/package-lock.json b/package-lock.json
index 6f9f339..600cb93 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "docsify",
- "version": "4.6.3",
+ "version": "4.6.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 845d870..c4609ca 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "docsify",
- "version": "4.6.3",
+ "version": "4.6.4",
"description": "A magical documentation generator.",
"author": {
"name": "qingwei-li",
From 0933445e8960ca7d5d63c6286823fbac2c0c8f4b Mon Sep 17 00:00:00 2001
From: Romain Lenzotti
Date: Sat, 3 Mar 2018 14:34:42 +0100
Subject: [PATCH 010/180] fix(navbar): Now Navbar isn't append to DOM when
loadNavbar is falsy (#407)
---
src/core/event/index.js | 5 ++++-
src/core/render/index.js | 8 ++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/core/event/index.js b/src/core/event/index.js
index dec4fcb..79923fd 100644
--- a/src/core/event/index.js
+++ b/src/core/event/index.js
@@ -6,7 +6,10 @@ import { scrollIntoView } from './scroll'
export function eventMixin (proto) {
proto.$resetEvents = function () {
scrollIntoView(this.route.path, this.route.query.id)
- sidebar.getAndActive(this.router, 'nav')
+
+ if (this.config.loadNavbar) {
+ sidebar.getAndActive(this.router, 'nav')
+ }
}
}
diff --git a/src/core/render/index.js b/src/core/render/index.js
index 1bea205..481ec98 100644
--- a/src/core/render/index.js
+++ b/src/core/render/index.js
@@ -117,7 +117,9 @@ export function renderMixin (proto) {
proto._renderNav = function (text) {
text && this._renderTo('nav', this.compiler.compile(text))
- getAndActive(this.router, 'nav')
+ if (this.config.loadNavbar) {
+ getAndActive(this.router, 'nav')
+ }
}
proto._renderMain = function (text, opt = {}, next) {
@@ -238,7 +240,9 @@ export function initRender (vm) {
}
// Add nav
- dom.before(navAppendToTarget, navEl)
+ if (config.loadNavbar) {
+ dom.before(navAppendToTarget, navEl)
+ }
if (config.themeColor) {
dom.$.head.appendChild(
From 9b3b4454de43340d1c0cc7125f7246858cfe9efe Mon Sep 17 00:00:00 2001
From: Romain Lenzotti
Date: Sat, 3 Mar 2018 15:09:01 +0100
Subject: [PATCH 011/180] feat(config): Add 404 page options. (#406)
This feature add the notFoundPage options to customize the default 404 page
with a markdown file. It also support the localisation.
---
docs/configuration.md | 31 ++++++++
docs/de-de/configuration.md | 29 ++++++++
docs/zh-cn/configuration.md | 31 ++++++++
src/core/fetch/index.js | 140 ++++++++++++++++++++++++------------
src/core/render/index.js | 3 +-
5 files changed, 187 insertions(+), 47 deletions(-)
diff --git a/docs/configuration.md b/docs/configuration.md
index 532eccd..e4078ed 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -435,3 +435,34 @@ window.$docsify = {
]
};
```
+
+
+## notFoundPage
+
+* type: `Boolean` | `String` | `Object`
+
+Load the `_404.md` file:
+```js
+window.$docsify = {
+ notFoundPage: true
+};
+```
+
+Load the customised path of the 404 page:
+```js
+window.$docsify = {
+ notFoundPage: 'my404.md'
+};
+```
+
+Load the right 404 page according to the localisation:
+```js
+window.$docsify = {
+ notFoundPage: {
+ '/': '_404.md',
+ '/de': 'de/_404.md',
+ }
+};
+```
+> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
+
diff --git a/docs/de-de/configuration.md b/docs/de-de/configuration.md
index 87e4869..2f5ebdc 100644
--- a/docs/de-de/configuration.md
+++ b/docs/de-de/configuration.md
@@ -419,3 +419,32 @@ window.$docsify = {
fallbackLanguages: ['fr', 'de']
};
```
+
+## notFoundPage
+
+* type: `Boolean` | `String` | `Object`
+
+Load the `_404.md` file:
+```js
+window.$docsify = {
+ notFoundPage: true
+};
+```
+
+Load the customised path of the 404 page:
+```js
+window.$docsify = {
+ notFoundPage: 'my404.md'
+};
+```
+
+Load the right 404 page according to the localisation:
+```js
+window.$docsify = {
+ notFoundPage: {
+ '/': '_404.md',
+ '/de': 'de/_404.md',
+ }
+};
+```
+> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
diff --git a/docs/zh-cn/configuration.md b/docs/zh-cn/configuration.md
index f91355f..3b8a0da 100644
--- a/docs/zh-cn/configuration.md
+++ b/docs/zh-cn/configuration.md
@@ -431,3 +431,34 @@ window.$docsify = {
fallbackLanguages: ['fr', 'de']
};
```
+
+## notFoundPage
+
+* type: `Boolean` | `String` | `Object`
+
+Load the `_404.md` file:
+```js
+window.$docsify = {
+ notFoundPage: true
+};
+```
+
+Load the customised path of the 404 page:
+```js
+window.$docsify = {
+ notFoundPage: 'my404.md'
+};
+```
+
+Load the right 404 page according to the localisation:
+```js
+window.$docsify = {
+ notFoundPage: {
+ '/': '_404.md',
+ '/de': 'de/_404.md',
+ }
+};
+```
+> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
+
+
diff --git a/src/core/fetch/index.js b/src/core/fetch/index.js
index 035f2ef..1b3db8f 100644
--- a/src/core/fetch/index.js
+++ b/src/core/fetch/index.js
@@ -19,44 +19,35 @@ function loadNested (path, qs, file, next, vm, first) {
export function fetchMixin (proto) {
let last
- proto._fetch = function (cb = noop) {
- const { path, query } = this.route
- const qs = stringifyQuery(query, ['id'])
- const { loadNavbar, loadSidebar, requestHeaders, fallbackLanguages } = this.config
- // Abort last request
- last && last.abort && last.abort()
- const file = this.router.getFile(path)
- last = get(file + qs, true, requestHeaders)
+ const abort = () => last && last.abort && last.abort()
+ const request = (url, hasbar, requestHeaders) => {
+ abort()
+ last = get(url, true, requestHeaders)
+ return last
+ }
- // Current page is html
- this.isHTML = /\.html$/g.test(file)
+ const get404Path = (path, config) => {
+ const { notFoundPage, ext } = config
+ const defaultPath = '_404' + (ext || '.md')
- const getFallBackPage = (file) => {
- if (!fallbackLanguages) {
- return false
- }
+ switch (typeof notFoundPage) {
+ case 'boolean':
+ return defaultPath
+ case 'string':
+ return notFoundPage
+ case 'object':
+ const key = Object
+ .keys(notFoundPage)
+ .sort((a, b) => b.length - a.length)
+ .find((key) => path.match(new RegExp('^' + key)))
- const local = file.split('/')[1]
-
- if (fallbackLanguages.indexOf(local) === -1) {
- return false
- }
-
- file = file.replace(new RegExp(`^/${local}`), '')
-
- return get(file + qs, true, requestHeaders)
- .then(
- (text, opt) => {
- this._renderMain(text, opt, loadSideAndNav)
- },
- _ => {
- return this._renderMain(null, {}, loadSideAndNav)
- }
- )
+ return key && notFoundPage[key] || defaultPath
}
+ }
- const loadSideAndNav = () => {
+ proto._loadSideAndNav = function (path, qs, loadSidebar, cb) {
+ return () => {
if (!loadSidebar) return cb()
const fn = result => {
@@ -67,28 +58,39 @@ export function fetchMixin (proto) {
// Load sidebar
loadNested(path, qs, loadSidebar, fn, this, true)
}
+ }
+
+ proto._fetch = function (cb = noop) {
+ const { path, query } = this.route
+ const qs = stringifyQuery(query, ['id'])
+ const { loadNavbar, requestHeaders, loadSidebar } = this.config
+ // Abort last request
+
+ const file = this.router.getFile(path)
+ const req = request(file + qs, true, requestHeaders)
+
+ // Current page is html
+ this.isHTML = /\.html$/g.test(file)
// Load main content
- last
+ req
.then(
- (text, opt) => {
- this._renderMain(text, opt, loadSideAndNav)
- },
+ (text, opt) => this._renderMain(text, opt, this._loadSideAndNav(path, qs, loadSidebar, cb)),
_ => {
- return getFallBackPage(file) || this._renderMain(null, {}, loadSideAndNav)
+ this._fetchFallbackPage(file, qs, cb) || this._fetch404(file, qs, cb)
}
)
// Load nav
loadNavbar &&
- loadNested(
- path,
- qs,
- loadNavbar,
- text => this._renderNav(text),
- this,
- true
- )
+ loadNested(
+ path,
+ qs,
+ loadNavbar,
+ text => this._renderNav(text),
+ this,
+ true
+ )
}
proto._fetchCover = function () {
@@ -141,6 +143,54 @@ export function fetchMixin (proto) {
})
}
}
+
+ proto._fetchFallbackPage = function (path, qs, cb = noop) {
+ const { requestHeaders, fallbackLanguages, loadSidebar } = this.config
+
+ if (!fallbackLanguages) {
+ return false
+ }
+
+ const local = path.split('/')[1]
+
+ if (fallbackLanguages.indexOf(local) === -1) {
+ return false
+ }
+ const newPath = path.replace(new RegExp(`^/${local}`), '')
+ const req = request(newPath + qs, true, requestHeaders)
+
+ req.then(
+ (text, opt) => this._renderMain(text, opt, this._loadSideAndNav(path, qs, loadSidebar, cb)),
+ () => this._fetch404(path, qs, cb)
+ )
+
+ return true
+ }
+ /**
+ * Load the 404 page
+ * @param path
+ * @param qs
+ * @param cb
+ * @returns {*}
+ * @private
+ */
+ proto._fetch404 = function (path, qs, cb = noop) {
+ const { loadSidebar, requestHeaders, notFoundPage } = this.config
+
+ const fnLoadSideAndNav = this._loadSideAndNav(path, qs, loadSidebar, cb)
+
+ if (notFoundPage) {
+ request(get404Path(path, this.config), true, requestHeaders)
+ .then(
+ (text, opt) => this._renderMain(text, opt, fnLoadSideAndNav),
+ () => this._renderMain(null, {}, fnLoadSideAndNav)
+ )
+ return true
+ }
+
+ this._renderMain(null, {}, fnLoadSideAndNav)
+ return false
+ }
}
export function initFetch (vm) {
diff --git a/src/core/render/index.js b/src/core/render/index.js
index 481ec98..af9b915 100644
--- a/src/core/render/index.js
+++ b/src/core/render/index.js
@@ -35,8 +35,7 @@ function formatUpdated (html, updated, fn) {
function renderMain (html) {
if (!html) {
- // TODO: Custom 404 page
- html = 'not found'
+ html = '404 - Not found
'
}
this._renderTo('.markdown-section', html)
From 8352a1e489abc2a7b6361fe02d696e1891a031cd Mon Sep 17 00:00:00 2001
From: "cinwell.li"
Date: Sat, 3 Mar 2018 22:51:27 +0800
Subject: [PATCH 012/180] refactor: build config (#408)
* refactor: build config
* chore: fix conflict
* fix: 404 page path
---
.eslintignore | 6 +-
.eslintrc | 23 +-
README.md | 1 -
app.js | 53 -
build/build-css.js | 50 -
build/build.js | 133 +-
build/{build-cover.js => cover.js} | 0
build/{build-ssr.js => ssr.js} | 0
docs/configuration.md | 4 +-
dev.html => index.html | 10 +-
package-lock.json | 5751 +++++++++------------
package.json | 56 +-
packages/docsify-server-renderer/index.js | 44 +-
server.js | 55 +
src/core/config.js | 30 +-
src/core/event/index.js | 10 +-
src/core/event/scroll.js | 58 +-
src/core/event/sidebar.js | 16 +-
src/core/fetch/ajax.js | 12 +-
src/core/fetch/index.js | 121 +-
src/core/global-api.js | 8 +-
src/core/index.js | 14 +-
src/core/init/index.js | 16 +-
src/core/init/lifecycle.js | 26 +-
src/core/render/compiler.js | 81 +-
src/core/render/embed.js | 14 +-
src/core/render/emojify.js | 6 +-
src/core/render/gen-tree.js | 8 +-
src/core/render/index.js | 64 +-
src/core/render/progressbar.js | 4 +-
src/core/render/slugify.js | 16 +-
src/core/render/tpl.js | 32 +-
src/core/router/history/abstract.js | 8 +-
src/core/router/history/base.js | 38 +-
src/core/router/history/hash.js | 28 +-
src/core/router/history/html5.js | 18 +-
src/core/router/index.js | 12 +-
src/core/router/util.js | 30 +-
src/core/util/core.js | 14 +-
src/core/util/dom.js | 40 +-
src/core/util/env.js | 2 +-
src/core/util/polyfill/css-vars.js | 16 +-
src/plugins/disqus.js | 4 +-
src/plugins/emoji.js | 8 +-
src/plugins/external-script.js | 2 +-
src/plugins/front-matter/index.js | 2 +-
src/plugins/ga.js | 8 +-
src/plugins/gitalk.js | 2 +-
src/plugins/search/component.js | 24 +-
src/plugins/search/index.js | 6 +-
src/plugins/search/search.js | 52 +-
src/plugins/zoom-image.js | 2 +-
src/themes/basic/_coverpage.css | 112 -
src/themes/basic/_coverpage.styl | 95 +
src/themes/basic/_layout.css | 571 --
src/themes/basic/_layout.styl | 467 ++
src/themes/buble.css | 241 -
src/themes/buble.styl | 172 +
src/themes/dark.css | 300 --
src/themes/dark.styl | 225 +
src/themes/pure.css | 6 -
src/themes/pure.styl | 7 +
src/themes/vue.css | 299 --
src/themes/vue.styl | 225 +
64 files changed, 4246 insertions(+), 5512 deletions(-)
delete mode 100644 app.js
delete mode 100644 build/build-css.js
rename build/{build-cover.js => cover.js} (100%)
rename build/{build-ssr.js => ssr.js} (100%)
rename dev.html => index.html (95%)
create mode 100644 server.js
delete mode 100644 src/themes/basic/_coverpage.css
create mode 100644 src/themes/basic/_coverpage.styl
delete mode 100644 src/themes/basic/_layout.css
create mode 100644 src/themes/basic/_layout.styl
delete mode 100644 src/themes/buble.css
create mode 100644 src/themes/buble.styl
delete mode 100644 src/themes/dark.css
create mode 100644 src/themes/dark.styl
delete mode 100644 src/themes/pure.css
create mode 100644 src/themes/pure.styl
delete mode 100644 src/themes/vue.css
create mode 100644 src/themes/vue.styl
diff --git a/.eslintignore b/.eslintignore
index 07dc46e..a3b8548 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,3 +1,5 @@
-.git/
+.git
packages/docsify-server-renderer/build.js
-node_modules
\ No newline at end of file
+node_modules
+build
+server.js
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
index 3a6f901..a8f7cd0 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,15 +1,20 @@
{
- "extends": [
- "vue"
- ],
- "parserOptions": {
- "ecmaVersion": 8
- },
- "env": {
- "browser": true
+ "extends": "xo-space/browser",
+ "rules": {
+ "semi": [2, "never"],
+ "no-return-assign": "off",
+ "no-unused-expressions": "off",
+ "no-new-func": "off",
+ "no-multi-assign": "off",
+ "no-mixed-operators": "off",
+ "max-params": "off",
+ "no-script-url": "off",
+ "camelcase": "off",
+ "no-warning-comments": "off"
},
"globals": {
"Docsify": true,
- "$docsify": true
+ "$docsify": true,
+ "process": true
}
}
diff --git a/README.md b/README.md
index 52ca73c..262869e 100644
--- a/README.md
+++ b/README.md
@@ -71,7 +71,6 @@ Move to [awesome-docsify](https://github.com/QingWei-Li/awesome-docsify)
```bash
npm run bootstrap && npm run dev
-open http://localhost:3000
```
## Backers
diff --git a/app.js b/app.js
deleted file mode 100644
index 63f80f7..0000000
--- a/app.js
+++ /dev/null
@@ -1,53 +0,0 @@
-var serveStatic = require('serve-static')
-var http = require('http')
-var fs = require('fs')
-var Renderer = require('./packages/docsify-server-renderer/build.js')
-
-var renderer = new Renderer({
- template: `
-
-
-
-
- docsify
-
-
-
-
-
-
-
-
-`,
- config: {
- name: 'docsify',
- repo: 'qingwei-li/docsify',
- basePath: 'https://docsify.js.org/',
- loadNavbar: true,
- loadSidebar: true,
- subMaxLevel: 3,
- auto2top: true,
- alias: {
- '/de-de/changelog': '/changelog',
- '/zh-cn/changelog': '/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)
- // .then(html => res.end(html))
-
- res.writeHead(404, { 'Content-Type': 'text/html' })
- res.end(fs.readFileSync('dev.html'))
- })
- })
- .listen(3000, '0.0.0.0')
-
-console.log(`\nListening at http://0.0.0.0:3000\n`)
diff --git a/build/build-css.js b/build/build-css.js
deleted file mode 100644
index b1b239e..0000000
--- a/build/build-css.js
+++ /dev/null
@@ -1,50 +0,0 @@
-var fs = require('fs')
-var cssnano = require('cssnano').process
-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 saveMin = function (file, content) {
- fs.writeFileSync(resolve(__dirname, '../lib/themes/', file), content)
-}
-var save = function (file, content) {
- fs.writeFileSync(resolve(__dirname, '../themes/', file), content)
-}
-var load = function (file) {
- return fs.readFileSync(resolve(__dirname, '../src/themes/', file)).toString()
-}
-var loadLib = function (file) {
- return fs.readFileSync(resolve(__dirname, '../themes/', file)).toString()
-}
-
-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) })
- .then(function (result) {
- save(file, result.css)
- console.log('salad - ' + file)
- isProd &&
- cssnano(loadLib(file)).then(function (result) {
- saveMin(file, result.css)
- console.log('cssnao - ' + file)
- })
- })
- .catch(function (err) {
- console.log(err)
- })
-})
diff --git a/build/build.js b/build/build.js
index 6185f59..c7e8c1b 100644
--- a/build/build.js
+++ b/build/build.js
@@ -1,19 +1,19 @@
-var rollup = require('rollup')
-var buble = require('rollup-plugin-buble')
-var commonjs = require('rollup-plugin-commonjs')
-var nodeResolve = require('rollup-plugin-node-resolve')
-var string = require('rollup-plugin-string')
-var uglify = require('rollup-plugin-uglify')
-var replace = require('rollup-plugin-replace')
-var isProd = process.argv[process.argv.length - 1] !== '--dev'
-var version = process.env.VERSION || require('../package.json').version
+const rollup = require('rollup')
+const buble = require('rollup-plugin-buble')
+const commonjs = require('rollup-plugin-commonjs')
+const nodeResolve = require('rollup-plugin-node-resolve')
+const uglify = require('rollup-plugin-uglify')
+const replace = require('rollup-plugin-replace')
+const isProd = process.env.NODE_ENV === 'production'
+const version = process.env.VERSION || require('../package.json').version
+const chokidar = require('chokidar')
+const path = require('path')
-var build = function (opts) {
+const build = function(opts) {
rollup
.rollup({
- input: 'src/' + opts.entry,
+ input: opts.input,
plugins: (opts.plugins || []).concat([
- string({ include: '**/*.css' }),
buble(),
commonjs(),
nodeResolve(),
@@ -23,8 +23,8 @@ var build = function (opts) {
})
])
})
- .then(function (bundle) {
- var dest = 'lib/' + (opts.output || opts.entry)
+ .then(function(bundle) {
+ var dest = 'lib/' + (opts.output || opts.input)
console.log(dest)
bundle.write({
@@ -33,45 +33,86 @@ var build = function (opts) {
strict: false
})
})
- .catch(function (err) {
+ .catch(function(err) {
console.error(err)
})
}
-
-build({
- entry: 'core/index.js',
- output: 'docsify.js'
-})
-
-var plugins = [
- { 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 => {
+const buildCore = function() {
build({
- entry: 'plugins/' + item.entry,
- output: 'plugins/' + item.name + '.js'
+ input: 'src/core/index.js',
+ output: 'docsify.js'
})
-})
-if (isProd) {
- build({
- entry: 'core/index.js',
- output: 'docsify.min.js',
- plugins: [uglify()]
- })
- plugins.forEach(item => {
+ if (isProd) {
build({
- entry: 'plugins/' + item.entry,
- output: 'plugins/' + item.name + '.min.js',
+ input: 'src/core/index.js',
+ output: 'docsify.min.js',
plugins: [uglify()]
})
- })
+ }
+}
+const buildAllPlugin = function() {
+ var plugins = [
+ {name: 'search', input: 'search/index.js'},
+ {name: 'ga', input: 'ga.js'},
+ {name: 'emoji', input: 'emoji.js'},
+ {name: 'external-script', input: 'external-script.js'},
+ {name: 'front-matter', input: 'front-matter/index.js'},
+ {name: 'zoom-image', input: 'zoom-image.js'},
+ {name: 'disqus', input: 'disqus.js'},
+ {name: 'gitalk', input: 'gitalk.js'}
+ ]
+
+ plugins.forEach(item => {
+ build({
+ input: 'src/plugins/' + item.input,
+ output: 'plugins/' + item.name + '.js'
+ })
+ })
+
+ if (isProd) {
+ plugins.forEach(item => {
+ build({
+ input: 'src/plugins/' + item.input,
+ output: 'plugins/' + item.name + '.min.js',
+ plugins: [uglify()]
+ })
+ })
+ }
+}
+
+if (!isProd) {
+ chokidar
+ .watch(['src/core', 'src/plugins'], {
+ atomic: true,
+ awaitWriteFinish: {
+ stabilityThreshold: 1000,
+ pollInterval: 100
+ }
+ })
+ .on('change', p => {
+ console.log('[watch] ', p)
+ const dirs = p.split(path.sep)
+ if (dirs[1] === 'core') {
+ buildCore()
+ } else if (dirs[2]) {
+ const name = path.basename(dirs[2], '.js')
+ const input = `src/plugins/${name}${
+ /\.js/.test(dirs[2]) ? '' : '/index'
+ }.js`
+
+ build({
+ input,
+ output: 'plugins/' + name + '.js'
+ })
+ }
+ })
+ .on('ready', () => {
+ console.log('[start]')
+ buildCore()
+ buildAllPlugin()
+ })
+} else {
+ buildCore()
+ buildAllPlugin()
}
diff --git a/build/build-cover.js b/build/cover.js
similarity index 100%
rename from build/build-cover.js
rename to build/cover.js
diff --git a/build/build-ssr.js b/build/ssr.js
similarity index 100%
rename from build/build-ssr.js
rename to build/ssr.js
diff --git a/docs/configuration.md b/docs/configuration.md
index e4078ed..3194c10 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -420,8 +420,8 @@ window.$docsify = {
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
-Example:
-
+Example:
+
- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
- then display 404 page.
diff --git a/dev.html b/index.html
similarity index 95%
rename from dev.html
rename to index.html
index f61b9f4..329fae4 100644
--- a/dev.html
+++ b/index.html
@@ -1,5 +1,6 @@
+
docsify
@@ -14,6 +15,7 @@
}
+
-
+
+