mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 13:26:34 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01140ceb54 | ||
|
|
87129c0fb2 | ||
|
|
95e95bd23b | ||
|
|
8974f3964e | ||
|
|
75222209da | ||
|
|
8352a1e489 | ||
|
|
9b3b4454de | ||
|
|
0933445e89 | ||
|
|
ec8daca3ec | ||
|
|
1335baa22f | ||
|
|
123c516836 | ||
|
|
ecc0e04c70 | ||
|
|
278a75ebd5 | ||
|
|
b8a4e6ba1b | ||
|
|
01bbbaaf92 | ||
|
|
e5c64a3d8f | ||
|
|
e5ae6e8d25 | ||
|
|
702bb5b715 | ||
|
|
7cdf751cc5 | ||
|
|
6a09059645 | ||
|
|
84f7b5c7c2 | ||
|
|
fd14e14022 | ||
|
|
4b5185f0d7 | ||
|
|
45a7464d23 | ||
|
|
222cfdbbe4 | ||
|
|
890a7bf9b6 | ||
|
|
edc3201367 | ||
|
|
8dd4378e89 | ||
|
|
149d9929f8 | ||
|
|
50fe22563b | ||
|
|
4aafde85fb | ||
|
|
dc0c3ced4e | ||
|
|
62ce447fc3 | ||
|
|
471e407c73 | ||
|
|
8fb74a2d87 | ||
|
|
a41129425f | ||
|
|
e097f88f0e | ||
|
|
033be4f2d7 | ||
|
|
371fbecfc2 | ||
|
|
e810ba38cb | ||
|
|
df84bc73ee | ||
|
|
a0c60b707c | ||
|
|
7a33ec2133 | ||
|
|
cb900a68e5 | ||
|
|
4bdcee2cb3 | ||
|
|
bd7ee84241 | ||
|
|
bf5d999296 | ||
|
|
56608e4739 | ||
|
|
4d61b1e9a3 | ||
|
|
c4d83f26a4 | ||
|
|
248aa72cd2 | ||
|
|
54ab4c9ff7 | ||
|
|
f960c196bf | ||
|
|
85428ef49e | ||
|
|
342438f2a7 | ||
|
|
9e824a4958 | ||
|
|
ebc10c4e43 | ||
|
|
b265fdd68a | ||
|
|
f68ddf5af0 | ||
|
|
9755439670 | ||
|
|
761ccc2c2b | ||
|
|
524f52f882 | ||
|
|
a90a2e49e1 | ||
|
|
864aa181a1 | ||
|
|
5e161a1420 | ||
|
|
820abeb0fd | ||
|
|
b073dd3ace | ||
|
|
c7892e340b | ||
|
|
21336444f4 | ||
|
|
39dd894650 | ||
|
|
30f07b1d5b | ||
|
|
4157173099 | ||
|
|
b133fde32a | ||
|
|
e3c9040419 | ||
|
|
0e479613bc | ||
|
|
368754ebd9 | ||
|
|
1c5d594228 | ||
|
|
0ecdacc7dc | ||
|
|
bedc262d83 | ||
|
|
9d5f561b28 | ||
|
|
5447e4bd47 | ||
|
|
7cb4b58b67 | ||
|
|
4d9bbb0767 | ||
|
|
fea80b508c | ||
|
|
bdcd9de4a2 | ||
|
|
2ec74e3a8d | ||
|
|
20dabdcdd6 | ||
|
|
2b4863381b | ||
|
|
689d3ddeaf | ||
|
|
adf90350c9 | ||
|
|
a12d3930e4 | ||
|
|
299c2c85c0 | ||
|
|
bc3ed08d06 | ||
|
|
d22ea84783 | ||
|
|
7c8d1cee76 | ||
|
|
3a72074405 | ||
|
|
04beaf7bd7 | ||
|
|
c17d892d30 | ||
|
|
623e9c4239 | ||
|
|
5d1fbdc5c9 | ||
|
|
f78be4c900 | ||
|
|
2ab0d7222c | ||
|
|
178ba64157 | ||
|
|
93a995f5bc | ||
|
|
888f217356 | ||
|
|
6bfc81147f | ||
|
|
3af1641874 | ||
|
|
66c8fd501a | ||
|
|
d60f6f0d03 | ||
|
|
2002cb8b22 | ||
|
|
572ab1afae | ||
|
|
d3dc8bcfb7 | ||
|
|
0e693fcda2 | ||
|
|
041b33e967 | ||
|
|
b34a9375c3 | ||
|
|
a1d2a1f1e3 | ||
|
|
e43ded4ea7 | ||
|
|
88df107c70 | ||
|
|
bc3ef52bbe | ||
|
|
9bed441a0c | ||
|
|
af38fc70fd | ||
|
|
4f164e995e | ||
|
|
b77f46a8e3 | ||
|
|
9208e64939 | ||
|
|
405349102f | ||
|
|
9d6595d04b | ||
|
|
d486eef6cc | ||
|
|
b3c3180bab | ||
|
|
c30af850a1 | ||
|
|
2a2ed96eb8 | ||
|
|
0d54c0cf83 | ||
|
|
f27ce7d2b2 | ||
|
|
2e1a7367a8 | ||
|
|
7510f75968 | ||
|
|
fd7d4e0e4e | ||
|
|
025bc5cddf | ||
|
|
8f1066a035 | ||
|
|
800c0c503a | ||
|
|
d5194b4f6b | ||
|
|
fa772cfa94 | ||
|
|
cc98f56cdd | ||
|
|
752f68e5f8 | ||
|
|
bde17e1f10 | ||
|
|
2db197f6dc | ||
|
|
e8b5b09f2c | ||
|
|
36bfc9d91d | ||
|
|
4ad96f3d12 | ||
|
|
1f04912a8f | ||
|
|
65f17b4753 | ||
|
|
b3419f3842 | ||
|
|
0bb7e18018 | ||
|
|
86583e19ab | ||
|
|
0bef31951c | ||
|
|
a2b8eae8c4 | ||
|
|
63d08369f6 | ||
|
|
142623e87e | ||
|
|
ab682684ca | ||
|
|
e16c89e539 | ||
|
|
f1272a2f1c | ||
|
|
1b912272df | ||
|
|
3476f6ff1f | ||
|
|
fac7ce693f | ||
|
|
470ee474d4 | ||
|
|
f7cf95a771 | ||
|
|
4a9d594f7c | ||
|
|
a3ab37952d | ||
|
|
6949455899 | ||
|
|
4e52315564 | ||
|
|
91d6337936 | ||
|
|
26cc466420 | ||
|
|
6f92a871ca | ||
|
|
538ee3d0dc | ||
|
|
49fd30d73d | ||
|
|
abd885e133 | ||
|
|
69b2040571 | ||
|
|
e8d675c405 | ||
|
|
5cc3e6c469 | ||
|
|
3e94cb6d76 | ||
|
|
641e522779 | ||
|
|
026530de10 | ||
|
|
1b74ef31a9 | ||
|
|
25acd8ce77 | ||
|
|
9b4e6669db | ||
|
|
2e3fe59702 | ||
|
|
7923608bc9 | ||
|
|
e307308a78 | ||
|
|
c195d2d1a6 | ||
|
|
0624e592d8 | ||
|
|
aba2aec0d0 | ||
|
|
a9704b5156 | ||
|
|
16d730ec3d | ||
|
|
08afec7d2a | ||
|
|
fcee316d2c | ||
|
|
1d2b546602 | ||
|
|
97793bfd6c | ||
|
|
ae3f74bfd4 | ||
|
|
04eaf4026b | ||
|
|
46ac4c3fd2 | ||
|
|
44dc68c6b2 | ||
|
|
6c702d3362 | ||
|
|
c476e49164 | ||
|
|
0329bab359 | ||
|
|
62aa161bff | ||
|
|
3854692331 | ||
|
|
2066cb672d | ||
|
|
5b7b60c553 | ||
|
|
388ed3d685 | ||
|
|
e898350a84 | ||
|
|
9c62fb41b8 | ||
|
|
9b73b0bf8a | ||
|
|
9d43051791 | ||
|
|
f0aca1905c | ||
|
|
2959497874 | ||
|
|
5a9921f5e7 | ||
|
|
c9d556d829 | ||
|
|
a0e1ea811a | ||
|
|
f82f41900e | ||
|
|
7a4d9bc5cd | ||
|
|
5e522879dd | ||
|
|
a72e7a3a3f | ||
|
|
26c22a9843 | ||
|
|
4ce118d60f | ||
|
|
3ad1645b90 | ||
|
|
41967fa8fa | ||
|
|
48276db15d | ||
|
|
b67ea62c75 | ||
|
|
f4800e09f1 | ||
|
|
ac10de1c5b | ||
|
|
d6ac7031b0 | ||
|
|
4417f4669d | ||
|
|
b7735066ff | ||
|
|
10045249d3 | ||
|
|
190710733e | ||
|
|
b292d819fc | ||
|
|
7f270f93c6 | ||
|
|
c3a149679a | ||
|
|
5efa763075 | ||
|
|
03a04f7898 | ||
|
|
a88252c6b2 | ||
|
|
2f5f90750a | ||
|
|
709c152950 | ||
|
|
b09a5a317e | ||
|
|
628e2115a3 | ||
|
|
271dde8f5e | ||
|
|
1fa1619278 | ||
|
|
3de3def8a8 | ||
|
|
fb25726426 | ||
|
|
36ddc42e91 | ||
|
|
abb0f6019f | ||
|
|
b8dd346baf | ||
|
|
7191d702e1 | ||
|
|
c039f1bfc0 | ||
|
|
f859d2d0b2 | ||
|
|
9735f4036e | ||
|
|
b8a96b867b | ||
|
|
b7b589b1bf | ||
|
|
761e38f6ad | ||
|
|
78899a0251 | ||
|
|
357631c8b7 | ||
|
|
17ff3d1506 | ||
|
|
f59aac478a | ||
|
|
0dd2497467 | ||
|
|
306136f6a3 | ||
|
|
4aba9d0a25 | ||
|
|
3d2f23bcdc | ||
|
|
b85eb0ff4b | ||
|
|
efa8d25912 | ||
|
|
437737cc5a | ||
|
|
992ff77808 | ||
|
|
4cf13db685 | ||
|
|
e54062f80d | ||
|
|
cee8ac6698 | ||
|
|
d057f66fce | ||
|
|
9b0f1978a4 | ||
|
|
d9848c3384 | ||
|
|
4dabae3bf2 | ||
|
|
b430993f4f | ||
|
|
2e00f4c993 | ||
|
|
7fb5ce6c84 | ||
|
|
c4aa22c56d | ||
|
|
9af855921e | ||
|
|
4492c3e19f | ||
|
|
f598e53098 | ||
|
|
4bde6d685c | ||
|
|
ce0e9acd50 | ||
|
|
e8117e515d | ||
|
|
25e09dfe07 | ||
|
|
a6b46a3e26 | ||
|
|
d469442eae | ||
|
|
9f310bbd7d | ||
|
|
cc8a7c97b6 | ||
|
|
19da658ba2 | ||
|
|
97db30a0b9 | ||
|
|
3a0765e11e | ||
|
|
aaf71b1ac0 | ||
|
|
b37781e949 | ||
|
|
54a48dd3ff | ||
|
|
1aabc41db7 | ||
|
|
d087d5753b | ||
|
|
bb793ec08e | ||
|
|
6a78ae7ddc | ||
|
|
ac28040bd7 | ||
|
|
b12f74b159 | ||
|
|
1304d2ea1a | ||
|
|
ccf4c7c5cc | ||
|
|
9b15d8d577 | ||
|
|
642e7da7ee | ||
|
|
75381cf046 | ||
|
|
7e2e5a7c90 | ||
|
|
6d48ce1266 | ||
|
|
d286963da0 | ||
|
|
8a4cedd962 | ||
|
|
a3b7b66a76 | ||
|
|
5a0d4b7897 | ||
|
|
fcfdb17b8d | ||
|
|
e4d2e7ec12 | ||
|
|
ece00e6b3a | ||
|
|
841829427b | ||
|
|
56c7b9ae2d | ||
|
|
db8400a6ac | ||
|
|
955d3d5988 | ||
|
|
d9b487e67b | ||
|
|
91b66a5cac | ||
|
|
90bba60367 | ||
|
|
d05c4f65a8 | ||
|
|
3380a62142 | ||
|
|
8e418a1681 | ||
|
|
20d60c401f | ||
|
|
1938fd5146 | ||
|
|
3b74c49f00 | ||
|
|
22b50f07c3 | ||
|
|
ec887c1b5f | ||
|
|
036fdac131 | ||
|
|
a64cee1236 | ||
|
|
f943fede99 | ||
|
|
e296439df3 | ||
|
|
0014895c19 | ||
|
|
23590fa7e7 | ||
|
|
8689a37121 | ||
|
|
05a0211861 | ||
|
|
318189a13f | ||
|
|
42795a0483 | ||
|
|
6b9e0922cf | ||
|
|
8cb4189b96 | ||
|
|
7eb6346075 | ||
|
|
238e9633f9 | ||
|
|
6db8c9e6c9 | ||
|
|
e160bcaded | ||
|
|
8cf69754b5 | ||
|
|
79a83bc17d | ||
|
|
81c87f7926 | ||
|
|
67ec128315 | ||
|
|
77657e3b64 | ||
|
|
9825db47af | ||
|
|
1a5593889e | ||
|
|
fc9cdf37c5 | ||
|
|
80dba191d3 | ||
|
|
5a0c37fcd3 | ||
|
|
1462efedcd | ||
|
|
4cb20a5f9d | ||
|
|
490c8a19d3 | ||
|
|
4b838247ea | ||
|
|
b091f3f10d | ||
|
|
0e74e6c15e | ||
|
|
be8358fcdc | ||
|
|
1ae0a9a845 | ||
|
|
7e169ad154 | ||
|
|
8595c99c0b | ||
|
|
43fc8b8ab1 | ||
|
|
ccec23df7f | ||
|
|
fc1cd3f11d | ||
|
|
3f38810774 | ||
|
|
3db4841da3 | ||
|
|
b764b6e32c | ||
|
|
46261572e3 | ||
|
|
d53b8dadb3 | ||
|
|
b9b9d87681 | ||
|
|
d4f6072d10 | ||
|
|
891475e132 | ||
|
|
1acfdd335c | ||
|
|
1f4514dcad | ||
|
|
eba1c987a8 | ||
|
|
3444884905 | ||
|
|
6dea685fee | ||
|
|
f095eb888f | ||
|
|
8741c746df | ||
|
|
2c7041c8fb | ||
|
|
2a21c40f17 | ||
|
|
000194c8da | ||
|
|
fce1e47131 | ||
|
|
6d244139dd | ||
|
|
eca3368152 | ||
|
|
bab76e004d | ||
|
|
eb9dc4671a | ||
|
|
bb815cb2d4 | ||
|
|
26db33dc31 | ||
|
|
6cbed4b4d8 | ||
|
|
b948cb06d7 | ||
|
|
b2b474264f | ||
|
|
a8c73ee2b9 | ||
|
|
eda9bb8343 | ||
|
|
50e771e6a8 | ||
|
|
2d73285de5 | ||
|
|
d2be5aecf8 | ||
|
|
ca0d6182b9 | ||
|
|
dacea8a39b | ||
|
|
da75d70dee |
+5
-1
@@ -1 +1,5 @@
|
||||
.git/
|
||||
.git
|
||||
packages/docsify-server-renderer/build.js
|
||||
node_modules
|
||||
build
|
||||
server.js
|
||||
@@ -1,12 +1,20 @@
|
||||
{
|
||||
"extends": [
|
||||
"vue"
|
||||
],
|
||||
"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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<!-- Love docsify? Please consider supporting our collective:
|
||||
👉 https://opencollective.com/docsify/donate -->
|
||||
@@ -2,4 +2,4 @@ Please makes sure these boxes are checked before submitting your PR, thank you!
|
||||
|
||||
* [ ] Make sure you are merging your commits to `master` branch.
|
||||
* [ ] Add some descriptions and refer relative issues for you PR.
|
||||
* [ ] DO NOT include files inside lib directory.
|
||||
* [ ] DO NOT include files inside `lib` directory.
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
*.log
|
||||
.DS_Store
|
||||
/themes
|
||||
/themes/
|
||||
node_modules
|
||||
/lib/
|
||||
.idea
|
||||
@@ -1,9 +1,3 @@
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.yarn-cache
|
||||
language: node_js
|
||||
node_js: stable
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"prettier.eslintIntegration": true
|
||||
}
|
||||
+524
-83
@@ -1,136 +1,577 @@
|
||||
# Changelog
|
||||
<a name="4.6.6"></a>
|
||||
## [4.6.6](https://github.com/QingWei-Li/docsify/compare/v4.6.5...v4.6.6) (2018-03-03)
|
||||
|
||||
## 3.6.5 / 2017-04-28
|
||||
|
||||
* fix(util): fix crash, fixed ([#154](https://github.com/QingWei-Li/docsify/issues/154)
|
||||
|
||||
## 3.6.4 / 2017-04-28
|
||||
<a name="4.6.5"></a>
|
||||
## [4.6.5](https://github.com/QingWei-Li/docsify/compare/v4.6.4...v4.6.5) (2018-03-03)
|
||||
|
||||
* fix(util): correctly clean up duplicate slashes, fixed ([#153](https://github.com/QingWei-Li/docsify/issues/153)
|
||||
|
||||
## 3.6.3 / 2017-04-25
|
||||
### Bug Fixes
|
||||
|
||||
* fix(external-script): script attrs
|
||||
* **navbar:** Now Navbar isn't append to DOM when loadNavbar is falsy ([#407](https://github.com/QingWei-Li/docsify/issues/407)) ([0933445](https://github.com/QingWei-Li/docsify/commit/0933445))
|
||||
|
||||
## 3.6.2/ 2017-04-12
|
||||
|
||||
* feat(external-script): detect more than one script dom, fixed ([#146](https://github.com/QingWei-Li/docsify/issues/146)
|
||||
* GA: Send hash instead of complete href (#147)
|
||||
### Features
|
||||
|
||||
## 3.6.1 / 2017-04-09
|
||||
* **config:** Add 404 page options. ([#406](https://github.com/QingWei-Li/docsify/issues/406)) ([9b3b445](https://github.com/QingWei-Li/docsify/commit/9b3b445))
|
||||
|
||||
* feat(event): Collapse the sidebar when click outside element in the small screen
|
||||
|
||||
## 3.6.0 / 2017-04-09
|
||||
|
||||
* feat(render): add mergeNavbar option, close ([#125](https://github.com/QingWei-Li/docsify/issues/125)
|
||||
<a name="4.6.4"></a>
|
||||
## [4.6.4](https://github.com/QingWei-Li/docsify/compare/v4.6.3...v4.6.4) (2018-03-01)
|
||||
|
||||
## 3.5.2/ 2017-04-05
|
||||
|
||||
* add optional current route param to toURL and use it to properly compose local anchor links
|
||||
* fix code style by removing semicolons
|
||||
* in toURL test for anchor links and if so prepend the currentPath to the generated path. fixes ([#142](https://github.com/QingWei-Li/docsify/issues/142))
|
||||
### Bug Fixes
|
||||
|
||||
## 3.5.1 / 2017-03-25
|
||||
* **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))
|
||||
|
||||
* fix: .md file extension regex
|
||||
|
||||
## 3.5.0 / 2017-03-25
|
||||
### Features
|
||||
|
||||
* feat(route): auto remove .md extension
|
||||
* fix: adjust display on small screens [@jrappen](https://github.com/jrappen)
|
||||
* fix: navbar labels for German [@jrappen](https://github.com/jrappen)
|
||||
* **fetch:** Add fallback languages configuration. ([#402](https://github.com/QingWei-Li/docsify/issues/402)) ([ecc0e04](https://github.com/QingWei-Li/docsify/commit/ecc0e04))
|
||||
|
||||
## 3.4.4 / 2017-03-17
|
||||
|
||||
* fix(search): fix input style
|
||||
* fix search plugin match bug
|
||||
|
||||
## 3.4.3 / 2017-03-16
|
||||
<a name="4.6.3"></a>
|
||||
## [4.6.3](https://github.com/QingWei-Li/docsify/compare/v4.6.2...v4.6.3) (2018-02-15)
|
||||
|
||||
* Add ability to ignore headers when generating toc ([#127](https://github.com/QingWei-Li/docsify/issues/127) [@christopherwk210](https://github.com/christopherwk210))
|
||||
* fix external-script not inserting script at right place [@Leopoldthecoder](https://github.com/Leopoldthecoder)
|
||||
* add German docs [@jrappen](https://github.com/jrappen)
|
||||
|
||||
## 3.4.2 / 2017-03-11
|
||||
### Bug Fixes
|
||||
|
||||
* feat(emojify): add no-emoji option
|
||||
* **hook:** beforeEach don\'t work, fixed [#393](https://github.com/QingWei-Li/docsify/issues/393) ([6a09059](https://github.com/QingWei-Li/docsify/commit/6a09059))
|
||||
|
||||
## 3.4.1 / 2017-03-10
|
||||
|
||||
* fix(dom): Disable the dom cache when vue is present, fixed [#119](https://github.com/QingWei-Li/docsify/issues/119)
|
||||
* update english docs, [@jrappen](https://github.com/jrappen)
|
||||
|
||||
## 3.4.0 / 2017-03-09
|
||||
<a name="4.6.2"></a>
|
||||
## [4.6.2](https://github.com/QingWei-Li/docsify/compare/v4.6.1...v4.6.2) (2018-02-14)
|
||||
|
||||
* feat(zoom-image): add plugin
|
||||
|
||||
## 3.3.0 / 2017-03-07
|
||||
### Bug Fixes
|
||||
|
||||
* add front-matter plugin
|
||||
* add external-script plugin, [@Leopoldthecoder](https://github.com/Leopoldthecoder)
|
||||
* Fix nav showing while loading ([#112](https://github.com/QingWei-Li/docsify/issues/112))
|
||||
* **embed:** broken in IE, fixed [#389](https://github.com/QingWei-Li/docsify/issues/389), fixed [#391](https://github.com/QingWei-Li/docsify/issues/391) ([45a7464](https://github.com/QingWei-Li/docsify/commit/45a7464))
|
||||
* **embed:** init value ([890a7bf](https://github.com/QingWei-Li/docsify/commit/890a7bf))
|
||||
|
||||
## 3.2.0 / 2017-02-28
|
||||
|
||||
* fix(render): Toc rendering error, fixed [#106](https://github.com/QingWei-Li/docsify/issues/106)
|
||||
* feat(search): Localization for no data tip, close [#103](https://github.com/QingWei-Li/docsify/issues/103)
|
||||
* fix(fetch): load sidebar and navbar for parent path, fixed [#100](https://github.com/QingWei-Li/docsify/issues/100)
|
||||
* feat(render) nameLink for each route, fixed [#99](https://github.com/QingWei-Li/docsify/issues/99)
|
||||
|
||||
## 3.1.2 / 2017-02-27
|
||||
<a name="4.6.1"></a>
|
||||
|
||||
* fix(search): dont search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102)
|
||||
## [4.6.1](https://github.com/QingWei-Li/docsify/compare/v4.6.0...v4.6.1) (2018-02-12)
|
||||
|
||||
## 3.1.1 / 2017-02-24
|
||||
### Bug Fixes
|
||||
|
||||
* fix(search): dont search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102)
|
||||
* fix(render): custom cover background image
|
||||
* fix(tpl): extra character, fixed [#101](https://github.com/QingWei-Li/docsify/issues/101)
|
||||
* **embed** compatible ssr ([dc0c3ce](https://github.com/QingWei-Li/docsify/commit/dc0c3ce))
|
||||
* **embed** async fetch embed files, fixed [#387](https://github.com/QingWei-Li/docsify/issues/387)
|
||||
|
||||
## 3.1.0 / 2017-02-22
|
||||
<a name="4.6.0"></a>
|
||||
|
||||
* fix(search): incorrect anchor link, fixed [#90](https://github.com/QingWei-Li/docsify/issues/90)
|
||||
* feat(emoji): add emoji plugin
|
||||
# [4.6.0](https://github.com/QingWei-Li/docsify/compare/v4.5.9...v4.6.0) (2018-02-11)
|
||||
|
||||
## 3.0.5 / 2017-02-21
|
||||
### Bug Fixes
|
||||
|
||||
* feat(pwa): add sw.js
|
||||
* fix(layout.css): loading style
|
||||
* fix(event): highlight sidebar when clicked, fixed [#86](https://github.com/QingWei-Li/docsify/issues/86)
|
||||
* fix(gen-tree): cache toc list, fixed [#88](https://github.com/QingWei-Li/docsify/issues/88)
|
||||
* **search:** custom clear button, fixed [#271](https://github.com/QingWei-Li/docsify/issues/271) ([864aa18](https://github.com/QingWei-Li/docsify/commit/864aa18))
|
||||
* **search:** escape special characters for search, fixed [#369](https://github.com/QingWei-Li/docsify/issues/369) ([9755439](https://github.com/QingWei-Li/docsify/commit/9755439))
|
||||
* build config ([342438f](https://github.com/QingWei-Li/docsify/commit/342438f))
|
||||
* button style for coverpage, fixed [#362](https://github.com/QingWei-Li/docsify/issues/362) ([85428ef](https://github.com/QingWei-Li/docsify/commit/85428ef))
|
||||
* dropdown scroll style, fixed [#346](https://github.com/QingWei-Li/docsify/issues/346) ([c4d83f2](https://github.com/QingWei-Li/docsify/commit/c4d83f2))
|
||||
* highlight homepage link, fixed [#304](https://github.com/QingWei-Li/docsify/issues/304) ([f960c19](https://github.com/QingWei-Li/docsify/commit/f960c19))
|
||||
* homepage link ([e097f88](https://github.com/QingWei-Li/docsify/commit/e097f88))
|
||||
* onlyCover ([033be4f](https://github.com/QingWei-Li/docsify/commit/033be4f))
|
||||
* ssr compatible embedd ([ebc10c4](https://github.com/QingWei-Li/docsify/commit/ebc10c4))
|
||||
* ssr coverpage, fixed [#273](https://github.com/QingWei-Li/docsify/issues/273) ([9e824a4](https://github.com/QingWei-Li/docsify/commit/9e824a4))
|
||||
|
||||
## 3.0.4 / 2017-02-20
|
||||
### Features
|
||||
|
||||
* fix(render): execute script
|
||||
* fix(render): disable rendering sub list when loadSidebar is false
|
||||
* click sidebar menu add collapse and expand, close [#294](https://github.com/QingWei-Li/docsify/issues/294) ([5e161a1](https://github.com/QingWei-Li/docsify/commit/5e161a1))
|
||||
* **compiler:** support embedded file as code block, close [#134](https://github.com/QingWei-Li/docsify/issues/134) ([761ccc2](https://github.com/QingWei-Li/docsify/commit/761ccc2))
|
||||
* **compiler:** support embedded markdown, html, video, etc files, close [#383](https://github.com/QingWei-Li/docsify/issues/383), close [#333](https://github.com/QingWei-Li/docsify/issues/333) ([524f52f](https://github.com/QingWei-Li/docsify/commit/524f52f))
|
||||
* **cover:** add onlyCover option, close [#382](https://github.com/QingWei-Li/docsify/issues/382) ([b265fdd](https://github.com/QingWei-Li/docsify/commit/b265fdd))
|
||||
* **fetch:** add requestHeaders option, fixed [#336](https://github.com/QingWei-Li/docsify/issues/336) ([54ab4c9](https://github.com/QingWei-Li/docsify/commit/54ab4c9))
|
||||
* **render:** add ext option for custom file extenstion, close [#340](https://github.com/QingWei-Li/docsify/issues/340) ([248aa72](https://github.com/QingWei-Li/docsify/commit/248aa72))
|
||||
* **render:** mutilple coverpage, close [#315](https://github.com/QingWei-Li/docsify/issues/315) ([f68ddf5](https://github.com/QingWei-Li/docsify/commit/f68ddf5))
|
||||
|
||||
## 3.0.3 / 2017-02-19
|
||||
<a name="4.5.9"></a>
|
||||
|
||||
* fixed look of links in blockquote
|
||||
* fix(scroll) highlight bug
|
||||
## [4.5.9](https://github.com/QingWei-Li/docsify/compare/v4.5.8...v4.5.9) (2018-02-07)
|
||||
|
||||
## 3.0.2 / 2017-02-19
|
||||
### Bug Fixes
|
||||
|
||||
* fix(search): add lazy input
|
||||
* fix(compiler): link
|
||||
* upgrade marked ([4157173](https://github.com/QingWei-Li/docsify/commit/4157173))
|
||||
|
||||
## 3.0.1 / 2017-02-19
|
||||
<a name="4.5.8"></a>
|
||||
|
||||
* fix(route): empty alias
|
||||
## [4.5.8](https://github.com/QingWei-Li/docsify/compare/v4.5.6...v4.5.8) (2018-02-07)
|
||||
|
||||
## 3.0.0 / 2017-02-19
|
||||
### Bug Fixes
|
||||
|
||||
##### Breaking change
|
||||
* cover style, fixed [#381](https://github.com/QingWei-Li/docsify/issues/381) ([368754e](https://github.com/QingWei-Li/docsify/commit/368754e))
|
||||
* updated deps ([#337](https://github.com/QingWei-Li/docsify/issues/337)) ([a12d393](https://github.com/QingWei-Li/docsify/commit/a12d393))
|
||||
|
||||
* Not support IE9
|
||||
* The route becomes: `/#/page?id=slug`. The previous route will be redirected
|
||||
<a name="4.5.7"></a>
|
||||
|
||||
##### Features
|
||||
## [4.5.7](https://github.com/QingWei-Li/docsify/compare/v4.5.6...v4.5.7) (2017-12-29)
|
||||
|
||||
* Faster rendering
|
||||
* Clearer source code
|
||||
* More powerful API
|
||||
* Auto header for each page [#78](https://github.com/QingWei-Li/docsify/issues/78)
|
||||
* Localization for search plugin [#80](https://github.com/QingWei-Li/docsify/issues/80)
|
||||
* Execute the script in markdown (see `executeScript`)
|
||||
### Features
|
||||
|
||||
* add navigation plugin, closed [#180](https://github.com/QingWei-Li/docsify/issues/180) ([f78be4c](https://github.com/QingWei-Li/docsify/commit/f78be4c))
|
||||
|
||||
<a name="4.5.6"></a>
|
||||
|
||||
## [4.5.6](https://github.com/QingWei-Li/docsify/compare/v4.5.3...v4.5.6) (2017-12-14)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **style:** increase the tap targets of menu button, fixed [#325](https://github.com/QingWei-Li/docsify/issues/325) ([888f217](https://github.com/QingWei-Li/docsify/commit/888f217))
|
||||
|
||||
<a name="4.5.5"></a>
|
||||
|
||||
## [4.5.5](https://github.com/QingWei-Li/docsify/compare/v4.5.4...v4.5.5) (2017-11-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* disqus plugin issue ([#318](https://github.com/QingWei-Li/docsify/issues/318)) ([041b33e](https://github.com/QingWei-Li/docsify/commit/041b33e)), closes [#317](https://github.com/QingWei-Li/docsify/issues/317)
|
||||
|
||||
<a name="4.5.4"></a>
|
||||
|
||||
## [4.5.4](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.4) (2017-11-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** task lists style, fixed [#215](https://github.com/QingWei-Li/docsify/issues/215) ([e43ded4](https://github.com/QingWei-Li/docsify/commit/e43ded4))
|
||||
|
||||
### Features
|
||||
|
||||
* add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
|
||||
|
||||
<a name="4.5.3"></a>
|
||||
|
||||
## [4.5.3](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.3) (2017-11-11)
|
||||
|
||||
### Features
|
||||
|
||||
* add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
|
||||
|
||||
<a name="4.5.2"></a>
|
||||
|
||||
## [4.5.2](https://github.com/QingWei-Li/docsify/compare/v4.5.1...v4.5.2) (2017-11-09)
|
||||
|
||||
### Features
|
||||
|
||||
* github task lists, close [#215](https://github.com/QingWei-Li/docsify/issues/215) ([#305](https://github.com/QingWei-Li/docsify/issues/305)) ([d486eef](https://github.com/QingWei-Li/docsify/commit/d486eef))
|
||||
|
||||
<a name="4.5.1"></a>
|
||||
|
||||
## [4.5.1](https://github.com/QingWei-Li/docsify/compare/v4.5.0...v4.5.1) (2017-11-07)
|
||||
|
||||
### Features
|
||||
|
||||
* fetch files with the query params, fixed [#303](https://github.com/QingWei-Li/docsify/issues/303) ([2a2ed96](https://github.com/QingWei-Li/docsify/commit/2a2ed96))
|
||||
|
||||
<a name="4.5.0"></a>
|
||||
|
||||
# [4.5.0](https://github.com/QingWei-Li/docsify/compare/v4.4.1...v4.5.0) (2017-11-04)
|
||||
|
||||
### Features
|
||||
|
||||
* add disqus plugin, closed [#123](https://github.com/QingWei-Li/docsify/issues/123) ([fd7d4e0](https://github.com/QingWei-Li/docsify/commit/fd7d4e0))
|
||||
|
||||
<a name="4.4.1"></a>
|
||||
|
||||
## [4.4.1](https://github.com/QingWei-Li/docsify/compare/v4.4.0...v4.4.1) (2017-10-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* {docsify-ignore-all} and {docsify-ignore} bug ([#299](https://github.com/QingWei-Li/docsify/issues/299)) ([cc98f56](https://github.com/QingWei-Li/docsify/commit/cc98f56))
|
||||
* zoom image plugin issue, fixed [#187](https://github.com/QingWei-Li/docsify/issues/187) ([#300](https://github.com/QingWei-Li/docsify/issues/300)) ([fa772cf](https://github.com/QingWei-Li/docsify/commit/fa772cf))
|
||||
|
||||
<a name="4.4.0"></a>
|
||||
|
||||
# [4.4.0](https://github.com/QingWei-Li/docsify/compare/v4.3.15...v4.4.0) (2017-10-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* sidebar style issue on firefox, fixed [#184](https://github.com/QingWei-Li/docsify/issues/184) ([#297](https://github.com/QingWei-Li/docsify/issues/297)) ([36bfc9d](https://github.com/QingWei-Li/docsify/commit/36bfc9d))
|
||||
|
||||
### Features
|
||||
|
||||
* add helper for disabled link, fixed [#295](https://github.com/QingWei-Li/docsify/issues/295) ([#296](https://github.com/QingWei-Li/docsify/issues/296)) ([4ad96f3](https://github.com/QingWei-Li/docsify/commit/4ad96f3))
|
||||
|
||||
<a name="4.3.15"></a>
|
||||
|
||||
## [4.3.15](https://github.com/QingWei-Li/docsify/compare/v4.3.14...v4.3.15) (2017-10-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* scroll active sidebar ([a2b8eae](https://github.com/QingWei-Li/docsify/commit/a2b8eae))
|
||||
|
||||
<a name="4.3.14"></a>
|
||||
|
||||
## [4.3.14](https://github.com/QingWei-Li/docsify/compare/v4.3.13...v4.3.14) (2017-10-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* codesponsor style ([ab68268](https://github.com/QingWei-Li/docsify/commit/ab68268))
|
||||
|
||||
<a name="4.3.13"></a>
|
||||
|
||||
## [4.3.13](https://github.com/QingWei-Li/docsify/compare/v4.3.12...v4.3.13) (2017-10-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* duplicate results in search fixed [#257](https://github.com/QingWei-Li/docsify/issues/257) ([#284](https://github.com/QingWei-Li/docsify/issues/284)) ([3476f6f](https://github.com/QingWei-Li/docsify/commit/3476f6f))
|
||||
|
||||
### Features
|
||||
|
||||
* make whole search result clickable ([#285](https://github.com/QingWei-Li/docsify/issues/285)) ([1b91227](https://github.com/QingWei-Li/docsify/commit/1b91227))
|
||||
|
||||
<a name="4.3.12"></a>
|
||||
|
||||
## [4.3.12](https://github.com/QingWei-Li/docsify/compare/v4.3.11...v4.3.12) (2017-10-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* incorrect active link ([#281](https://github.com/QingWei-Li/docsify/issues/281)) ([a3ab379](https://github.com/QingWei-Li/docsify/commit/a3ab379))
|
||||
|
||||
<a name="4.3.11"></a>
|
||||
|
||||
## [4.3.11](https://github.com/QingWei-Li/docsify/compare/v4.3.10...v4.3.11) (2017-10-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* broken links to same page heading, fix [#278](https://github.com/QingWei-Li/docsify/issues/278), fix [#279](https://github.com/QingWei-Li/docsify/issues/279) ([91d6337](https://github.com/QingWei-Li/docsify/commit/91d6337))
|
||||
|
||||
<a name="4.3.10"></a>
|
||||
|
||||
## [4.3.10](https://github.com/QingWei-Li/docsify/compare/v4.3.9...v4.3.10) (2017-10-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* link render issue after page refreshing ([#276](https://github.com/QingWei-Li/docsify/issues/276)) ([abd885e](https://github.com/QingWei-Li/docsify/commit/abd885e))
|
||||
|
||||
<a name="4.3.9"></a>
|
||||
|
||||
## [4.3.9](https://github.com/QingWei-Li/docsify/compare/v4.3.8...v4.3.9) (2017-10-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* scroll issue in IE ([#275](https://github.com/QingWei-Li/docsify/issues/275)) ([3e94cb6](https://github.com/QingWei-Li/docsify/commit/3e94cb6))
|
||||
|
||||
<a name="4.3.8"></a>
|
||||
|
||||
## [4.3.8](https://github.com/QingWei-Li/docsify/compare/v4.3.7...v4.3.8) (2017-10-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **slugify:** GitHub compatible heading links, fixed [#272](https://github.com/QingWei-Li/docsify/issues/272) ([9b4e666](https://github.com/QingWei-Li/docsify/commit/9b4e666))
|
||||
|
||||
<a name="4.3.7"></a>
|
||||
|
||||
## [4.3.7](https://github.com/QingWei-Li/docsify/compare/v4.3.6...v4.3.7) (2017-10-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **slugify:** GitHub compatible heading links, fixed [#267](https://github.com/QingWei-Li/docsify/issues/267) ([c195d2d](https://github.com/QingWei-Li/docsify/commit/c195d2d))
|
||||
|
||||
<a name="4.3.6"></a>
|
||||
|
||||
## [4.3.6](https://github.com/QingWei-Li/docsify/compare/v4.3.5...v4.3.6) (2017-09-21)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* style for codesponsor plugin ([08afec7](https://github.com/QingWei-Li/docsify/commit/08afec7))
|
||||
|
||||
<a name="4.3.5"></a>
|
||||
|
||||
## [4.3.5](https://github.com/QingWei-Li/docsify/compare/v4.3.4...v4.3.5) (2017-09-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* missed symbol ([#254](https://github.com/QingWei-Li/docsify/issues/254)) ([6c702d3](https://github.com/QingWei-Li/docsify/commit/6c702d3))
|
||||
|
||||
### Features
|
||||
|
||||
* **plugin:** add codesponsor plugin ([46ac4c3](https://github.com/QingWei-Li/docsify/commit/46ac4c3))
|
||||
|
||||
<a name="4.3.4"></a>
|
||||
|
||||
## [4.3.4](https://github.com/QingWei-Li/docsify/compare/v4.3.3...v4.3.4) (2017-09-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* scroll position issue, fixed [#234](https://github.com/QingWei-Li/docsify/issues/234) ([388ed3d](https://github.com/QingWei-Li/docsify/commit/388ed3d))
|
||||
|
||||
<a name="4.3.3"></a>
|
||||
|
||||
## [4.3.3](https://github.com/QingWei-Li/docsify/compare/v4.3.2...v4.3.3) (2017-09-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **buble.css:** tweaks code block style, fixed [#249](https://github.com/QingWei-Li/docsify/issues/249) ([9d43051](https://github.com/QingWei-Li/docsify/commit/9d43051))
|
||||
|
||||
### Features
|
||||
|
||||
* add doc for react and vue demo box plugin ([#247](https://github.com/QingWei-Li/docsify/issues/247)) ([f0aca19](https://github.com/QingWei-Li/docsify/commit/f0aca19))
|
||||
|
||||
<a name="4.3.2"></a>
|
||||
|
||||
## [4.3.2](https://github.com/QingWei-Li/docsify/compare/v4.3.1...v4.3.2) (2017-09-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* sidebar highlight ([f82f419](https://github.com/QingWei-Li/docsify/commit/f82f419))
|
||||
|
||||
### Features
|
||||
|
||||
* add Edit on github plugin (thanks [@njleonzhang](https://github.com/njleonzhang)) ([a0e1ea8](https://github.com/QingWei-Li/docsify/commit/a0e1ea8))
|
||||
|
||||
<a name="4.3.1"></a>
|
||||
|
||||
## [4.3.1](https://github.com/QingWei-Li/docsify/compare/v4.2.9...v4.3.1) (2017-08-30)
|
||||
|
||||
### Features
|
||||
|
||||
* **markdown:** supports mermaid [#137](https://github.com/QingWei-Li/docsify/issues/137) ([f4800e0](https://github.com/QingWei-Li/docsify/commit/f4800e0))
|
||||
|
||||
<a name="4.3.0"></a>
|
||||
|
||||
# [4.3.0](https://github.com/QingWei-Li/docsify/compare/v4.2.9...v4.3.0) (2017-08-17)
|
||||
|
||||
### Features
|
||||
|
||||
* **markdown:** supports mermaid [#137](https://github.com/QingWei-Li/docsify/issues/137) ([f4800e0](https://github.com/QingWei-Li/docsify/commit/f4800e0))
|
||||
|
||||
<a name="4.2.9"></a>
|
||||
|
||||
## [4.2.9](https://github.com/QingWei-Li/docsify/compare/v4.2.8...v4.2.9) (2017-08-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ensure document ready before init Docsify [#233](https://github.com/QingWei-Li/docsify/issues/233)
|
||||
|
||||
<a name="4.2.8"></a>
|
||||
|
||||
## [4.2.8](https://github.com/QingWei-Li/docsify/compare/v4.2.7...v4.2.8) (2017-08-10)
|
||||
|
||||
### Features
|
||||
|
||||
* **compiler:** support for setting target attribute for link, fixed [#230](https://github.com/QingWei-Li/docsify/issues/230) ([7f270f9](https://github.com/QingWei-Li/docsify/commit/7f270f9))
|
||||
|
||||
<a name="4.2.7"></a>
|
||||
|
||||
## [4.2.7](https://github.com/QingWei-Li/docsify/compare/v4.2.4...v4.2.7) (2017-08-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **release:** release shell ([628e211](https://github.com/QingWei-Li/docsify/commit/628e211))
|
||||
* **style:** nowrap => pre-wrap, fixed [#228](https://github.com/QingWei-Li/docsify/issues/228) ([a88252c](https://github.com/QingWei-Li/docsify/commit/a88252c))
|
||||
|
||||
<a name="4.2.6"></a>
|
||||
|
||||
## [4.2.6](https://github.com/QingWei-Li/docsify/compare/v4.2.4...v4.2.6) (2017-07-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **css:** hide the nav when the content has not yet been loaded ([1fa1619](https://github.com/QingWei-Li/docsify/commit/1fa1619))
|
||||
* **release:** release shell ([628e211](https://github.com/QingWei-Li/docsify/commit/628e211))
|
||||
|
||||
<a name="4.2.4"></a>
|
||||
|
||||
## [4.2.4](https://github.com/QingWei-Li/docsify/compare/v4.2.2...v4.2.4) (2017-07-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **render:** Remove getRootNode to be compatible with the lower version of Chrome, fixed [#225](https://github.com/QingWei-Li/docsify/issues/225) ([b8dd346](https://github.com/QingWei-Li/docsify/commit/b8dd346))
|
||||
|
||||
<a name="4.2.3"></a>
|
||||
|
||||
## [4.2.3](https://github.com/QingWei-Li/docsify/compare/v4.2.2...v4.2.3) (2017-07-26)
|
||||
|
||||
### Features
|
||||
|
||||
* **search:** Supports the max depth of the search headline, fixed [#223](https://github.com/QingWei-Li/docsify/issues/223), resolve [#129](https://github.com/QingWei-Li/docsify/issues/129) ([b7b589b](https://github.com/QingWei-Li/docsify/commit/b7b589b))
|
||||
|
||||
<a name="4.2.2"></a>
|
||||
|
||||
## [4.2.2](https://github.com/QingWei-Li/docsify/compare/v4.2.1...v4.2.2) (2017-07-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* style rerender due to setting themeColor ([17ff3d1](https://github.com/QingWei-Li/docsify/commit/17ff3d1))
|
||||
|
||||
<a name="4.2.1"></a>
|
||||
|
||||
## [4.2.1](https://github.com/QingWei-Li/docsify/compare/v4.2.0...v4.2.1) (2017-07-19)
|
||||
|
||||
* give the navbar some line-height (#216)
|
||||
* Remove unnecessary moduleName option from rollup config for plugins (#209)
|
||||
|
||||
<a name="4.2.0"></a>
|
||||
|
||||
# [4.2.0](https://github.com/QingWei-Li/docsify/compare/v4.1.14...v4.2.0) (2017-07-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* not found page ([9af8559](https://github.com/QingWei-Li/docsify/commit/9af8559))
|
||||
|
||||
### Features
|
||||
|
||||
* alias option supports regexp, resolve [#183](https://github.com/QingWei-Li/docsify/issues/183) ([c4aa22c](https://github.com/QingWei-Li/docsify/commit/c4aa22c))
|
||||
* ignore to compiled link, fixed [#203](https://github.com/QingWei-Li/docsify/issues/203) ([#204](https://github.com/QingWei-Li/docsify/issues/204)) ([2e00f4c](https://github.com/QingWei-Li/docsify/commit/2e00f4c))
|
||||
|
||||
<a name="4.1.14"></a>
|
||||
|
||||
## [4.1.14](https://github.com/QingWei-Li/docsify/compare/v4.1.13...v4.1.14) (2017-06-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* get file path, fixed jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070 ([e8117e5](https://github.com/QingWei-Li/docsify/commit/e8117e5)), closes [jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070](https://github.com/jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13/issues/commitcomment-22427070)
|
||||
|
||||
### Features
|
||||
|
||||
* add context attribute, fixed [#191](https://github.com/QingWei-Li/docsify/issues/191) ([ce0e9ac](https://github.com/QingWei-Li/docsify/commit/ce0e9ac))
|
||||
|
||||
<a name="4.1.13"></a>
|
||||
|
||||
## [4.1.13](https://github.com/QingWei-Li/docsify/compare/v4.1.12...v4.1.13) (2017-06-11)
|
||||
|
||||
<a name="4.1.12"></a>
|
||||
|
||||
## [4.1.12](https://github.com/QingWei-Li/docsify/compare/v4.1.11...v4.1.12) (2017-06-03)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **render:** subtitle in side bar shows undefined, fixed [#182](https://github.com/QingWei-Li/docsify/issues/182) ([d087d57](https://github.com/QingWei-Li/docsify/commit/d087d57))
|
||||
|
||||
<a name="4.1.11"></a>
|
||||
|
||||
## [4.1.11](https://github.com/QingWei-Li/docsify/compare/v4.1.10...v4.1.11) (2017-06-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler:** force reset toc when rendering sidebar fixed [#181](https://github.com/QingWei-Li/docsify/issues/181) ([ccf4c7c](https://github.com/QingWei-Li/docsify/commit/ccf4c7c))
|
||||
* **render:** autoHeader does not work ([1304d2e](https://github.com/QingWei-Li/docsify/commit/1304d2e))
|
||||
|
||||
<a name="4.1.10"></a>
|
||||
|
||||
## [4.1.10](https://github.com/QingWei-Li/docsify/compare/v4.1.9...v4.1.10) (2017-06-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **hash:** hash routing crashes when url has querystring ([6d48ce1](https://github.com/QingWei-Li/docsify/commit/6d48ce1))
|
||||
|
||||
<a name="4.1.9"></a>
|
||||
|
||||
## [4.1.9](https://github.com/QingWei-Li/docsify/compare/v4.1.8...v4.1.9) (2017-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* can't render toc on first load ([d9b487e](https://github.com/QingWei-Li/docsify/commit/d9b487e))
|
||||
* **lifecycle:** continue to handle data ([955d3d5](https://github.com/QingWei-Li/docsify/commit/955d3d5))
|
||||
* **render:** broken name link, fixed [#167](https://github.com/QingWei-Li/docsify/issues/167) ([91b66a5](https://github.com/QingWei-Li/docsify/commit/91b66a5))
|
||||
|
||||
<a name="4.1.8"></a>
|
||||
|
||||
## [4.1.8](https://github.com/QingWei-Li/docsify/compare/v4.1.7...v4.1.8) (2017-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* auto replace version ([22b50f0](https://github.com/QingWei-Li/docsify/commit/22b50f0))
|
||||
* update edit button demo ([ec887c1](https://github.com/QingWei-Li/docsify/commit/ec887c1))
|
||||
|
||||
### Features
|
||||
|
||||
* add edit button demo ([a64cee1](https://github.com/QingWei-Li/docsify/commit/a64cee1))
|
||||
* add edit button demo, close [#162](https://github.com/QingWei-Li/docsify/issues/162) ([036fdac](https://github.com/QingWei-Li/docsify/commit/036fdac))
|
||||
|
||||
<a name="4.1.7"></a>
|
||||
|
||||
## [4.1.7](https://github.com/QingWei-Li/docsify/compare/v4.1.6...v4.1.7) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** clean files ([0014895](https://github.com/QingWei-Li/docsify/commit/0014895))
|
||||
|
||||
<a name="4.1.6"></a>
|
||||
|
||||
## [4.1.6](https://github.com/QingWei-Li/docsify/compare/v4.1.5...v4.1.6) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** add debug ([6b9e092](https://github.com/QingWei-Li/docsify/commit/6b9e092))
|
||||
|
||||
<a name="4.1.5"></a>
|
||||
|
||||
## [4.1.5](https://github.com/QingWei-Li/docsify/compare/v4.1.4...v4.1.5) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** missing package ([6db8c9e](https://github.com/QingWei-Li/docsify/commit/6db8c9e))
|
||||
|
||||
<a name="4.1.4"></a>
|
||||
|
||||
## [4.1.4](https://github.com/QingWei-Li/docsify/compare/v4.1.3...v4.1.4) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** file path ([79a83bc](https://github.com/QingWei-Li/docsify/commit/79a83bc))
|
||||
|
||||
<a name="4.1.3"></a>
|
||||
|
||||
## [4.1.3](https://github.com/QingWei-Li/docsify/compare/v4.1.2...v4.1.3) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update babel config ([9825db4](https://github.com/QingWei-Li/docsify/commit/9825db4))
|
||||
|
||||
<a name="4.1.2"></a>
|
||||
|
||||
## [4.1.2](https://github.com/QingWei-Li/docsify/compare/v4.1.1...v4.1.2) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update babel config ([80dba19](https://github.com/QingWei-Li/docsify/commit/80dba19))
|
||||
|
||||
<a name="4.1.1"></a>
|
||||
|
||||
## [4.1.1](https://github.com/QingWei-Li/docsify/compare/v4.1.0...v4.1.1) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* build for ssr package ([4cb20a5](https://github.com/QingWei-Li/docsify/commit/4cb20a5))
|
||||
* remove history mode ([0e74e6c](https://github.com/QingWei-Li/docsify/commit/0e74e6c))
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
|
||||
# [4.1.0](https://github.com/QingWei-Li/docsify/compare/v4.0.2...v4.1.0) (2017-05-30)
|
||||
|
||||
<a name="4.0.2"></a>
|
||||
|
||||
## [4.0.2](https://github.com/QingWei-Li/docsify/compare/v4.0.1...v4.0.2) (2017-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* basePath for history mode ([fc1cd3f](https://github.com/QingWei-Li/docsify/commit/fc1cd3f))
|
||||
|
||||
<a name="4.0.1"></a>
|
||||
|
||||
## [4.0.1](https://github.com/QingWei-Li/docsify/compare/v4.0.0...v4.0.1) (2017-05-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ssr:** remove context ([4626157](https://github.com/QingWei-Li/docsify/commit/4626157))
|
||||
* lint ([b764b6e](https://github.com/QingWei-Li/docsify/commit/b764b6e))
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
|
||||
# [4.0.0](https://github.com/QingWei-Li/docsify/compare/v3.7.3...v4.0.0) (2017-05-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **render:** init event in ssr ([eba1c98](https://github.com/QingWei-Li/docsify/commit/eba1c98))
|
||||
* lint ([1f4514d](https://github.com/QingWei-Li/docsify/commit/1f4514d))
|
||||
|
||||
### Features
|
||||
|
||||
* finish ssr ([3444884](https://github.com/QingWei-Li/docsify/commit/3444884))
|
||||
* init ocsify-server-renderer ([6dea685](https://github.com/QingWei-Li/docsify/commit/6dea685))
|
||||
* support history mode ([f095eb8](https://github.com/QingWei-Li/docsify/commit/f095eb8))
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# Contribute
|
||||
|
||||
## Introduction
|
||||
|
||||
First, thank you for considering contributing to docsify! It's people like you that make the open source community such a great community! 😊
|
||||
|
||||
We welcome any type of contribution, not only code. You can help with
|
||||
- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open)
|
||||
- **Marketing**: writing blog posts, howto's, printing stickers, ...
|
||||
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
|
||||
- **Code**: take a look at the [open issues](issues). Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them.
|
||||
- **Money**: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/docsify).
|
||||
|
||||
## Your First Contribution
|
||||
|
||||
Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
|
||||
|
||||
## Submitting code
|
||||
|
||||
Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests.
|
||||
|
||||
## Code review process
|
||||
|
||||
The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge.
|
||||
It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you?
|
||||
|
||||
## Financial contributions
|
||||
|
||||
We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/docsify).
|
||||
Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.
|
||||
|
||||
## Questions
|
||||
|
||||
If you have any questions, create an [issue](issue) (protip: do a quick search first to see if someone else didn't ask the same question before!).
|
||||
You can also reach us at hello@docsify.opencollective.com.
|
||||
|
||||
## Credits
|
||||
|
||||
### Contributors
|
||||
|
||||
Thank you to all the people who have already contributed to docsify!
|
||||
<a href="graphs/contributors"><img src="https://opencollective.com/docsify/contributors.svg?width=890" /></a>
|
||||
|
||||
|
||||
### Backers
|
||||
|
||||
Thank you to all our backers! [[Become a backer](https://opencollective.com/docsify#backer)]
|
||||
|
||||
<a href="https://opencollective.com/docsify#backers" target="_blank"><img src="https://opencollective.com/docsify/backers.svg?width=890"></a>
|
||||
|
||||
|
||||
### Sponsors
|
||||
|
||||
Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/docsify#sponsor))
|
||||
|
||||
<a href="https://opencollective.com/docsify/sponsor/0/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/1/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/2/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/3/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/4/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/5/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/6/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/7/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/8/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/sponsor/9/website" target="_blank"><img src="https://opencollective.com/docsify/sponsor/9/avatar.svg"></a>
|
||||
|
||||
<!-- This `CONTRIBUTING.md` is based on @nayafia's template https://github.com/nayafia/contributing-template -->
|
||||
+568
-344
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 - 2017 cinwell.li
|
||||
Copyright (c) 2016 - present cinwell.li
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<a href="https://docsify.js.org">
|
||||
<img alt="docsify" src="./media/docsify.png">
|
||||
<img alt="docsify" src="./docs/_media/icon.svg">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -9,87 +9,98 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#backers"><img alt="Backers on Open Collective" src="https://opencollective.com/docsify/backers/badge.svg?style=flat-square"></a>
|
||||
<a href="#sponsors"><img alt="Sponsors on Open Collective" src="https://opencollective.com/docsify/sponsors/badge.svg?style=flat-square"></a>
|
||||
<a href="https://travis-ci.org/QingWei-Li/docsify"><img alt="Travis Status" src="https://img.shields.io/travis/QingWei-Li/docsify/master.svg?style=flat-square"></a>
|
||||
<a href="https://www.npmjs.com/package/docsify"><img alt="npm" src="https://img.shields.io/npm/v/docsify.svg?style=flat-square"></a>
|
||||
<a href="https://github.com/QingWei-Li/donate"><img alt="donate" src="https://img.shields.io/badge/%24-donate-ff69b4.svg?style=flat-square"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">Glod Sponsor via <a href="https://opencollective.com/docsify">Open Collective</a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://opencollective.com/docsify/tiers/gold-sponsor/website">
|
||||
<img src="https://opencollective.com/docsify/tiers/gold-sponsor.svg?avatarHeight=36">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## Links
|
||||
|
||||
- [Documentation](https://docsify.js.org)
|
||||
- [CLI](https://github.com/QingWei-Li/docsify-cli)
|
||||
* [Documentation](https://docsify.js.org)
|
||||
* [CLI](https://github.com/QingWei-Li/docsify-cli)
|
||||
* CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify)
|
||||
* [Awesome docsify](https://github.com/QingWei-Li/awesome-docsify)
|
||||
|
||||
## Features
|
||||
|
||||
- No statically built html files
|
||||
- Simple and lightweight (~16kB gzipped)
|
||||
- Smart full-text search plugin
|
||||
- Multiple themes
|
||||
- Useful plugin API
|
||||
- Compatible with IE10+
|
||||
* No statically built html files
|
||||
* Simple and lightweight (~19kB gzipped)
|
||||
* Smart full-text search plugin
|
||||
* Multiple themes
|
||||
* Useful plugin API
|
||||
* Compatible with IE10+
|
||||
* Support SSR ([example](https://github.com/QingWei-Li/docsify-ssr-demo))
|
||||
* Support embedded files
|
||||
|
||||
## Quick start
|
||||
|
||||
Create an `index.html`.
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
</html>
|
||||
```
|
||||
|
||||
## Browser Support
|
||||
|
||||
Modern browsers and Internet Explorer 10+.
|
||||
Look at [this tutorial](https://docsify.js.org/#/quickstart) or [online demo](https://jsfiddle.net/7ztb8qsr/1/).
|
||||
|
||||
## Showcase
|
||||
|
||||
These open-source projects are using docsify to generate their sites. Pull requests welcome :blush:
|
||||
These projects are using docsify to generate their sites. Pull requests welcome :blush:
|
||||
|
||||
| Project | Description |
|
||||
|---|---|
|
||||
| [Snipaste](https://docs.snipaste.com/) | Snip & Paste |
|
||||
| [puck](https://puck.zz173.com/) | A small & magical php framework. |
|
||||
| [Samaritan](http://samaritan.stockdb.org) | An Algorithmic Trading Framework for Digital Currency. |
|
||||
| [Vudash](http://vudash.github.io/vudash/) | Powerful, Flexible, Open Source dashboards for anything |
|
||||
| [Trilogy](http://trilogy.js.org) | No-hassle SQLite with a Promise-based, document store style API. |
|
||||
| [Mybatis-Plus](http://mp.baomidou.com/) | An enhanced toolkit of Mybatis to simplify development |
|
||||
| [JS MythBusters](https://mythbusters.js.org) | An optimization handbook from a high level point of view. |
|
||||
| [hire-me](https://fvcproductions.github.io/hire-me) | A path to getting an awesome tech gig. |
|
||||
Move to [awesome-docsify](https://github.com/QingWei-Li/awesome-docsify)
|
||||
|
||||
## Similar projects
|
||||
|
||||
| Project | Description |
|
||||
|---|---|
|
||||
| [docute](https://github.com/egoist/docute) | 📜 Effortlessly documentation done right |
|
||||
| [docpress](https://github.com/docpress/docpress) | Documentation website generator |
|
||||
| Project | Description |
|
||||
| ------------------------------------------------ | ---------------------------------------- |
|
||||
| [docute](https://github.com/egoist/docute) | 📜 Effortlessly documentation done right |
|
||||
| [docpress](https://github.com/docpress/docpress) | Documentation website generator |
|
||||
|
||||
## Contributing
|
||||
|
||||
- Fork it!
|
||||
- Create your feature branch: `git checkout -b my-new-feature`
|
||||
- Commit your changes: `git commit -am 'Add some feature'`
|
||||
- Push to the branch: `git push origin my-new-feature`
|
||||
- Submit a pull request
|
||||
|
||||
* Fork it!
|
||||
* Create your feature branch: `git checkout -b my-new-feature`
|
||||
* Commit your changes: `git commit -am 'Add some feature'`
|
||||
* Push to the branch: `git push origin my-new-feature`
|
||||
* Submit a pull request
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
npm i && npm run dev
|
||||
open http://localhost:3000
|
||||
npm run bootstrap && npm run dev
|
||||
```
|
||||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/docsify#backers)]
|
||||
|
||||
<a href="https://opencollective.com/docsify#backers" target="_blank"><img src="https://opencollective.com/docsify/backers.svg?width=890"></a>
|
||||
|
||||
## Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/docsify#silver-sponsors)]
|
||||
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/0/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/1/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/2/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/3/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/4/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/5/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/6/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/7/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/8/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/docsify/silver-sponsors/9/website" target="_blank"><img src="https://opencollective.com/docsify/silver-sponsors/9/avatar.svg"></a>
|
||||
|
||||
## Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
||||
<a href="graphs/contributors"><img src="https://opencollective.com/docsify/contributors.svg?width=890" /></a>
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify?ref=badge_large)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
var serveStatic = require('serve-static')
|
||||
var http = require('http')
|
||||
var fs = require('fs')
|
||||
|
||||
http.createServer(function (req, res) {
|
||||
serveStatic('.')(req, res, function () {
|
||||
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`)
|
||||
@@ -1,47 +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)
|
||||
})
|
||||
})
|
||||
|
||||
+93
-46
@@ -1,71 +1,118 @@
|
||||
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 isProd = process.argv[process.argv.length - 1] !== '--dev'
|
||||
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({
|
||||
entry: 'src/' + opts.entry,
|
||||
input: opts.input,
|
||||
plugins: (opts.plugins || []).concat([
|
||||
string({ include: '**/*.css' }),
|
||||
buble(),
|
||||
commonjs(),
|
||||
nodeResolve()
|
||||
nodeResolve(),
|
||||
replace({
|
||||
__VERSION__: version,
|
||||
'process.env.SSR': false
|
||||
})
|
||||
])
|
||||
})
|
||||
.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({
|
||||
format: 'iife',
|
||||
moduleName: opts.moduleName || 'D',
|
||||
dest: dest
|
||||
file: dest,
|
||||
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', moduleName: 'Search' },
|
||||
{ name: 'ga', entry: 'ga.js', moduleName: 'GA' },
|
||||
{ name: 'emoji', entry: 'emoji.js', moduleName: 'Emoji' },
|
||||
{ name: 'external-script', entry: 'external-script.js', moduleName: 'ExternalScript' },
|
||||
{ name: 'front-matter', entry: 'front-matter/index.js', moduleName: 'FrontMatter' },
|
||||
{ name: 'zoom-image', entry: 'zoom-image.js', moduleName: 'ZoomImage' }
|
||||
]
|
||||
|
||||
plugins.forEach(item => {
|
||||
const buildCore = function() {
|
||||
build({
|
||||
entry: 'plugins/' + item.entry,
|
||||
output: 'plugins/' + item.name + '.js',
|
||||
moduleName: 'D.' + item.moduleName
|
||||
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',
|
||||
moduleName: 'D.' + item.moduleName,
|
||||
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()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
var fs = require('fs')
|
||||
var read = fs.readFileSync
|
||||
var write = fs.writeFileSync
|
||||
var version = process.env.VERSION || require('../package.json').version
|
||||
|
||||
var file = __dirname + '/../docs/_coverpage.md'
|
||||
var cover = read(file, 'utf8').toString()
|
||||
|
||||
console.log('Replace version number in cover page...')
|
||||
cover = cover.replace(
|
||||
/<small>(\S+)?<\/small>/g,
|
||||
'<small>' + version + '</small>'
|
||||
)
|
||||
write(file, cover)
|
||||
@@ -0,0 +1,12 @@
|
||||
const cssnano = require('cssnano').process
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
files = fs.readdirSync(path.resolve('lib/themes'))
|
||||
|
||||
files.forEach(file => {
|
||||
file = path.resolve('lib/themes', file)
|
||||
cssnano(fs.readFileSync(file)).then(result => {
|
||||
fs.writeFileSync(file, result.css)
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,51 @@
|
||||
set -e
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
echo "Enter new version: "
|
||||
read VERSION
|
||||
else
|
||||
VERSION=$1
|
||||
fi
|
||||
|
||||
read -p "Releasing $VERSION $RELEASE_TAG - are you sure? (y/n) " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo "Releasing $VERSION ..."
|
||||
|
||||
npm run test
|
||||
|
||||
# build
|
||||
VERSION=$VERSION npm run build
|
||||
|
||||
# update packages
|
||||
cd packages/docsify-server-renderer
|
||||
npm version $VERSION
|
||||
if [[ -z $RELEASE_TAG ]]; then
|
||||
npm publish
|
||||
else
|
||||
npm publish --tag $RELEASE_TAG
|
||||
fi
|
||||
cd -
|
||||
|
||||
# commit
|
||||
git add -A
|
||||
git add -f lib/ -A
|
||||
git commit -m "[build] $VERSION $RELEASE_TAG"
|
||||
npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG"
|
||||
|
||||
# changelog
|
||||
node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s
|
||||
|
||||
git add .
|
||||
git commit -m "chore: add changelog $VERSION"
|
||||
|
||||
# publish
|
||||
git tag v$VERSION
|
||||
git push origin refs/tags/v$VERSION
|
||||
git push
|
||||
if [[ -z $RELEASE_TAG ]]; then
|
||||
npm publish
|
||||
else
|
||||
npm publish --tag $RELEASE_TAG
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,34 @@
|
||||
var rollup = require('rollup')
|
||||
var buble = require('rollup-plugin-buble')
|
||||
var async = require('rollup-plugin-async')
|
||||
var replace = require('rollup-plugin-replace')
|
||||
|
||||
rollup
|
||||
.rollup({
|
||||
input: 'packages/docsify-server-renderer/index.js',
|
||||
plugins: [
|
||||
async(),
|
||||
replace({
|
||||
__VERSION__: process.env.VERSION || require('../package.json').version,
|
||||
'process.env.SSR': true
|
||||
}),
|
||||
buble({
|
||||
transforms: {
|
||||
generator: false
|
||||
}
|
||||
})
|
||||
],
|
||||
onwarn: function () {}
|
||||
})
|
||||
.then(function (bundle) {
|
||||
var dest = 'packages/docsify-server-renderer/build.js'
|
||||
|
||||
console.log(dest)
|
||||
bundle.write({
|
||||
format: 'cjs',
|
||||
file: dest
|
||||
})
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
})
|
||||
@@ -1,37 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>docsify</title>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="/themes/vue.css" title="vue">
|
||||
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled>
|
||||
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled>
|
||||
<style>
|
||||
nav.app-nav li ul {
|
||||
min-width: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'/de-de/changelog': '/changelog',
|
||||
'/zh-cn/changelog': '/changelog',
|
||||
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
|
||||
},
|
||||
auto2top: true,
|
||||
basePath: '/docs/',
|
||||
executeScript: true,
|
||||
loadNavbar: true,
|
||||
loadSidebar: true,
|
||||
name: 'docsify',
|
||||
subMaxLevel: 2,
|
||||
mergeNavbar: true
|
||||
}
|
||||
</script>
|
||||
<script src="/lib/docsify.js"></script>
|
||||
</html>
|
||||
+3
-1
@@ -11,13 +11,15 @@ See the [Quick start](quickstart.md) for more details.
|
||||
## Features
|
||||
|
||||
* No statically built html files
|
||||
* Simple and lightweight (~16kB gzipped)
|
||||
* Simple and lightweight (~19kB gzipped)
|
||||
* Smart full-text search plugin
|
||||
* Multiple themes
|
||||
* Useful plugin API
|
||||
* Emoji support
|
||||
* Compatible with IE10+
|
||||
|
||||
- Support SSR ([example](https://github.com/QingWei-Li/docsify-ssr-demo))
|
||||
|
||||
## Examples
|
||||
|
||||
Check out the [Showcase](https://github.com/QingWei-Li/docsify/#showcase) to docsify in use.
|
||||
|
||||
+4
-5
@@ -1,13 +1,12 @@
|
||||

|
||||
|
||||
# docsify <small>3.6</small>
|
||||
# docsify <small>4.6.6</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
- Simple and lightweight (~16kB gzipped)
|
||||
- No statically built html files
|
||||
- Multiple themes
|
||||
|
||||
* Simple and lightweight (~19kB gzipped)
|
||||
* No statically built html files
|
||||
* Multiple themes
|
||||
|
||||
[GitHub](https://github.com/QingWei-Li/docsify/)
|
||||
[Get Started](#docsify)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<h1>To infinity and Beyond!</h1>
|
||||
@@ -0,0 +1 @@
|
||||
> This is from the `example.md`
|
||||
+25
-19
@@ -1,22 +1,28 @@
|
||||
- Getting started
|
||||
- [Quick start](quickstart.md)
|
||||
- [Writing more pages](more-pages.md)
|
||||
- [Custom navbar](custom-navbar.md)
|
||||
- [Cover page](cover.md)
|
||||
* Getting started
|
||||
|
||||
- Customization
|
||||
- [Configuration](configuration.md)
|
||||
- [Themes](themes.md)
|
||||
- [List of Plugins](plugins.md)
|
||||
- [Write a Plugin](write-a-plugin.md)
|
||||
- [Markdown configuration](markdown.md)
|
||||
- [Language highlighting](language-highlight.md)
|
||||
* [Quick start](quickstart.md)
|
||||
* [Writing more pages](more-pages.md)
|
||||
* [Custom navbar](custom-navbar.md)
|
||||
* [Cover page](cover.md)
|
||||
|
||||
- Guide
|
||||
- [Deploy](deploy.md)
|
||||
- [Helpers](helpers.md)
|
||||
- [Vue compatibility](vue.md)
|
||||
- [CDN](cdn.md)
|
||||
- [Offline Mode(PWA)](pwa.md)
|
||||
* Customization
|
||||
|
||||
- [Changelog](changelog.md)
|
||||
* [Configuration](configuration.md)
|
||||
* [Themes](themes.md)
|
||||
* [List of Plugins](plugins.md)
|
||||
* [Write a Plugin](write-a-plugin.md)
|
||||
* [Markdown configuration](markdown.md)
|
||||
* [Language highlighting](language-highlight.md)
|
||||
|
||||
* Guide
|
||||
|
||||
* [Deploy](deploy.md)
|
||||
* [Helpers](helpers.md)
|
||||
* [Vue compatibility](vue.md)
|
||||
* [CDN](cdn.md)
|
||||
* [Offline Mode(PWA)](pwa.md)
|
||||
* [Server-Side Rendering(SSR)](ssr.md)
|
||||
* [Embed Files <sup style="color:red">(new)<sup>](embed-files.md)
|
||||
|
||||
* [Awesome docsify](awesome.md)
|
||||
* [Changelog](changelog.md)
|
||||
|
||||
+1
-1
@@ -45,6 +45,6 @@ Alternatively, use [compressed files](#compressed-files).
|
||||
## Other CDN
|
||||
|
||||
- http://www.bootcdn.cn/docsify
|
||||
- http://www.jsdelivr.com/projects/docsify
|
||||
- https://cdn.jsdelivr.net/npm/docsify/
|
||||
- https://cdnjs.com/libraries/docsify
|
||||
|
||||
|
||||
+230
-79
@@ -1,9 +1,8 @@
|
||||
# Configuration
|
||||
|
||||
**docsify** supports two different ways of configuration. You can configure the `window.$docsify` or write configuration on the script tag via `data-*` attributes.
|
||||
You can configure the `window.$docsify`.
|
||||
|
||||
```html
|
||||
<!-- by $docsify -->
|
||||
<script>
|
||||
window.$docsify = {
|
||||
repo: 'QingWei-Li/docsify',
|
||||
@@ -11,37 +10,25 @@
|
||||
coverpage: true
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- or data-* -->
|
||||
<script
|
||||
src="//unpkg.com/docsify"
|
||||
data-repo="QingWei-Li/docsify"
|
||||
data-max-level="3"
|
||||
data-coverpage>
|
||||
</script>
|
||||
```
|
||||
|
||||
Both ways are compatible. However, the first way is recommended. It is clear and can be configured in a separate file.
|
||||
|
||||
!> In `window.$docsfiy`, the options should be written by camelCase.
|
||||
|
||||
## el
|
||||
|
||||
- Type: `String`
|
||||
- Default: `#app`
|
||||
* Type: `String`
|
||||
* Default: `#app`
|
||||
|
||||
The DOM element to be mounted on initialization. It can be a CSS selector string or an actual HTMLElement.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
el: '#app'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## repo
|
||||
|
||||
- Type: `String`
|
||||
- Default: `null`
|
||||
* Type: `String`
|
||||
* Default: `null`
|
||||
|
||||
Configure the repository url or a string of `username/repo` can add the [GitHub Corner](http://tholman.com/github-corners/) widget in the top right corner of the site.
|
||||
|
||||
@@ -50,26 +37,26 @@ window.$docsify = {
|
||||
repo: 'QingWei-Li/docsify',
|
||||
// or
|
||||
repo: 'https://github.com/QingWei-Li/docsify/'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## max-level
|
||||
## maxLevel
|
||||
|
||||
- Type: `Number`
|
||||
- Default: `6`
|
||||
* Type: `Number`
|
||||
* Default: `6`
|
||||
|
||||
Maximum Table of content level.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
maxLevel: 4
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## load-navbar
|
||||
## loadNavbar
|
||||
|
||||
- Type: `Boolean|String`
|
||||
- Default: `false`
|
||||
* Type: `Boolean|String`
|
||||
* Default: `false`
|
||||
|
||||
Loads navbar from the Markdown file `_navbar.md` if **true**, or else from the path specified.
|
||||
|
||||
@@ -80,13 +67,13 @@ window.$docsify = {
|
||||
|
||||
// load from nav.md
|
||||
loadNavbar: 'nav.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## load-sidebar
|
||||
## loadSidebar
|
||||
|
||||
- Type: `Boolean|String`
|
||||
- Default: `false`
|
||||
* Type: `Boolean|String`
|
||||
* Default: `false`
|
||||
|
||||
Loads sidebar from the Markdown file `_sidebar.md` if **true**, or else from the path specified.
|
||||
|
||||
@@ -97,39 +84,39 @@ window.$docsify = {
|
||||
|
||||
// load from summary.md
|
||||
loadSidebar: 'summary.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## sub-max-level
|
||||
## subMaxLevel
|
||||
|
||||
- Type: `Number`
|
||||
- Default: `0`
|
||||
* Type: `Number`
|
||||
* Default: `0`
|
||||
|
||||
Add table of contents (TOC) in custom sidebar.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
subMaxLevel: 2
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## auto2top
|
||||
|
||||
- Type: `Boolean`
|
||||
- Default: `false`
|
||||
* Type: `Boolean`
|
||||
* Default: `false`
|
||||
|
||||
Scrolls to the top of the screen when the route is changed.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
auto2top: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## homepage
|
||||
|
||||
- Type: `String`
|
||||
- Default: `README.md`
|
||||
* Type: `String`
|
||||
* Default: `README.md`
|
||||
|
||||
`README.md` in your docs folder will be treated as homepage for your website, but sometimes you may need to serve another file as your homepage.
|
||||
|
||||
@@ -139,13 +126,14 @@ window.$docsify = {
|
||||
homepage: 'home.md',
|
||||
|
||||
// Or use the readme in your repo
|
||||
homepage: 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/README.md'
|
||||
}
|
||||
homepage:
|
||||
'https://raw.githubusercontent.com/QingWei-Li/docsify/master/README.md'
|
||||
};
|
||||
```
|
||||
|
||||
## base-path
|
||||
## basePath
|
||||
|
||||
- Type: `String`
|
||||
* Type: `String`
|
||||
|
||||
Base path of the website. You can set it to another directory or another domain name.
|
||||
|
||||
@@ -157,14 +145,15 @@ window.$docsify = {
|
||||
basePath: 'https://docsify.js.org/',
|
||||
|
||||
// Even can load files from other repo
|
||||
basePath: 'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
|
||||
}
|
||||
basePath:
|
||||
'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
|
||||
};
|
||||
```
|
||||
|
||||
## coverpage
|
||||
|
||||
- Type: `Boolean|String`
|
||||
- Default: `false`
|
||||
* Type: `Boolean|String|String[]|Object`
|
||||
* Default: `false`
|
||||
|
||||
Activate the [cover feature](cover.md). If true, it will load from `_coverpage.md`.
|
||||
|
||||
@@ -173,26 +162,35 @@ window.$docsify = {
|
||||
coverpage: true,
|
||||
|
||||
// Custom file name
|
||||
coverpage: 'cover.md'
|
||||
}
|
||||
coverpage: 'cover.md',
|
||||
|
||||
// mutiple covers
|
||||
coverpage: ['/', '/zh-cn/'],
|
||||
|
||||
// mutiple covers and custom file name
|
||||
coverpage: {
|
||||
'/': 'cover.md',
|
||||
'/zh-cn/': 'cover.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## name
|
||||
|
||||
- Type: `String`
|
||||
* Type: `String`
|
||||
|
||||
Website name as it appears in the sidebar.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
name: 'docsify'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## name-link
|
||||
## nameLink
|
||||
|
||||
- Type: `String`
|
||||
- Default: `window.location.pathname`
|
||||
* Type: `String`
|
||||
* Default: `window.location.pathname`
|
||||
|
||||
The name of the link.
|
||||
|
||||
@@ -205,12 +203,12 @@ window.$docsify = {
|
||||
'/zh-cn/': '/zh-cn/',
|
||||
'/': '/'
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## markdown
|
||||
|
||||
- Type: `Function`
|
||||
* Type: `Function`
|
||||
|
||||
See [Markdown configuration](markdown.md).
|
||||
|
||||
@@ -227,43 +225,46 @@ window.$docsify = {
|
||||
},
|
||||
|
||||
// function
|
||||
markdown: function (marked, renderer) {
|
||||
markdown: function(marked, renderer) {
|
||||
// ...
|
||||
return marked
|
||||
return marked;
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## theme-color
|
||||
## themeColor
|
||||
|
||||
- Type: `String`
|
||||
* Type: `String`
|
||||
|
||||
Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in old browser.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
themeColor: '#3F51B5'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## alias
|
||||
|
||||
- Type: `Object`
|
||||
* Type: `Object`
|
||||
|
||||
Set the route alias. You can freely manage routing rules.
|
||||
Set the route alias. You can freely manage routing rules. Supports RegExp.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'/foo/(+*)': '/bar/$1', // supports regexp
|
||||
'/zh-cn/changelog': '/changelog',
|
||||
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
|
||||
'/changelog':
|
||||
'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
|
||||
'/.*/_sidebar.md': '/_sidebar.md' // See #301
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## auto-header
|
||||
## autoHeader
|
||||
|
||||
- type: `Boolean`
|
||||
* type: `Boolean`
|
||||
|
||||
If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to html. Compare [#78](https://github.com/QingWei-Li/docsify/issues/78).
|
||||
|
||||
@@ -271,19 +272,19 @@ If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.m
|
||||
window.$docsify = {
|
||||
loadSidebar: true,
|
||||
autoHeader: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## execute-script
|
||||
## executeScript
|
||||
|
||||
- type: `Boolean`
|
||||
* type: `Boolean`
|
||||
|
||||
Execute the script on the page. Only parse the first script tag([demo](themes)). If Vue is present, it is turned on by default.
|
||||
Execute the script on the page. Only parse the first script tag([demo](themes)). If Vue is present, it is turned on by default.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
executeScript: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
```markdown
|
||||
@@ -296,22 +297,172 @@ window.$docsify = {
|
||||
|
||||
Note that if you are running an external script, e.g. an embedded jsfiddle demo, make sure to include the [external-script](plugins.md?id=external-script) plugin.
|
||||
|
||||
## no-emoji
|
||||
## noEmoji
|
||||
|
||||
* type: `Boolean`
|
||||
|
||||
Disabled emoji parse.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
noEmoji: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## merge-navbar
|
||||
## mergeNavbar
|
||||
|
||||
* type: `Boolean`
|
||||
|
||||
Navbar will be merged with the sidebar on smaller screens.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
mergeNavbar: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## formatUpdated
|
||||
|
||||
* type: `String|Function`
|
||||
|
||||
We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
|
||||
See https://github.com/lukeed/tinydate#patterns
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
|
||||
formatUpdated: function(time) {
|
||||
// ...
|
||||
|
||||
return time;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## externalLinkTarget
|
||||
|
||||
* type: `String`
|
||||
* default: `_blank`
|
||||
|
||||
Target to open external links. Default `'_blank'` (new window/tab)
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
externalLinkTarget: '_self' // default: '_blank'
|
||||
};
|
||||
```
|
||||
|
||||
## routerMode
|
||||
|
||||
* type: `String`
|
||||
* default: `history`
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
routerMode: 'history' // default: 'hash'
|
||||
};
|
||||
```
|
||||
|
||||
## noCompileLinks
|
||||
|
||||
* type: `Array`
|
||||
|
||||
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/QingWei-Li/docsify/issues/203)
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
noCompileLinks: ['/foo', '/bar/.*']
|
||||
};
|
||||
```
|
||||
|
||||
## onlyCover
|
||||
|
||||
* type: `Boolean`
|
||||
|
||||
Only coverpage is loaded when visiting the home page.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
onlyCover: false
|
||||
};
|
||||
```
|
||||
|
||||
## requestHeaders
|
||||
|
||||
* type: `Object`
|
||||
|
||||
Set the request resource headers.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
requestHeaders: {
|
||||
'x-token': 'xxx'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## ext
|
||||
|
||||
* type: `String`
|
||||
|
||||
Request file extension.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
ext: '.md'
|
||||
};
|
||||
```
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
|
||||
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
|
||||
|
||||
Example:
|
||||
|
||||
- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
|
||||
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
|
||||
- then display 404 page.
|
||||
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
fallbackLanguages: [
|
||||
"fr",
|
||||
"de"
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
+46
-3
@@ -26,9 +26,9 @@ Set `coverpage` to **true**, and create a `_coverpage.md`:
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
- Simple and lightweight (~16kB gzipped)
|
||||
- No statically built html files
|
||||
- Multiple themes
|
||||
* Simple and lightweight (~19kB gzipped)
|
||||
* No statically built html files
|
||||
* Multiple themes
|
||||
|
||||
[GitHub](https://github.com/QingWei-Li/docsify/)
|
||||
[Get Started](#docsify)
|
||||
@@ -49,8 +49,51 @@ The background color is generated randomly by default. You can customize the bac
|
||||
[Get Started](#quick-start)
|
||||
|
||||
<!-- background image -->
|
||||
|
||||

|
||||
|
||||
<!-- background color -->
|
||||
|
||||

|
||||
```
|
||||
|
||||
## Coverpage as homepage
|
||||
|
||||
Normal, the coverpage and the homepage appear at the same time. Of course, you can also separate the coverpage by [onlyCover option](configuration.md#onlycover).
|
||||
|
||||
## Multiple covers
|
||||
|
||||
If your docs site is in more than one language, it may be useful to set multiple covers.
|
||||
|
||||
For example, your docs structure is like this
|
||||
|
||||
```text
|
||||
.
|
||||
└── docs
|
||||
├── README.md
|
||||
├── guide.md
|
||||
├── _coverpage.md
|
||||
└── zh-cn
|
||||
├── README.md
|
||||
└── guide.md
|
||||
└── _coverpage.md
|
||||
```
|
||||
|
||||
Now, you can set
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
coverpage: ['/', '/zh-cn/']
|
||||
};
|
||||
```
|
||||
|
||||
Or a special file name
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
coverpage: {
|
||||
'/': 'cover.md',
|
||||
'/zh-cn/': 'cover.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
+19
-18
@@ -20,7 +20,7 @@ If you need custom navigation, you can create a HTML-based navigation bar.
|
||||
|
||||
## Markdown
|
||||
|
||||
Alternatively, you can create a custom markdown-based navigation file by setting `loadNavbar` to **true** and creating `_navbar.md`, compare [load-navbar configuration](configuration.md#load-navbar).
|
||||
Alternatively, you can create a custom markdown-based navigation file by setting `loadNavbar` to **true** and creating `_navbar.md`, compare [loadNavbar configuration](configuration.md#loadnavbar).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -36,13 +36,13 @@ Alternatively, you can create a custom markdown-based navigation file by setting
|
||||
```markdown
|
||||
<!-- _navbar.md -->
|
||||
|
||||
- [En](/)
|
||||
- [chinese](/zh-cn/)
|
||||
* [En](/)
|
||||
* [chinese](/zh-cn/)
|
||||
```
|
||||
|
||||
!> You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
|
||||
|
||||
`_navbar.md` is loaded from each level directory. If the current directory doesn't have `_navbar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_navbar.md` will be loaded from `/guide/_navbar.md`.
|
||||
`_navbar.md` is loaded from each level directory. If the current directory doesn't have `_navbar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_navbar.md` will be loaded from `/guide/_navbar.md`.
|
||||
|
||||
## Nesting
|
||||
|
||||
@@ -51,23 +51,24 @@ You can create sub-lists by indenting items that are under a certain parent.
|
||||
```markdown
|
||||
<!-- _navbar.md -->
|
||||
|
||||
- Getting started
|
||||
- [Quick start](quickstart.md)
|
||||
- [Writing more pages](more-pages.md)
|
||||
- [Custom navbar](custom-navbar.md)
|
||||
- [Cover page](cover.md)
|
||||
* Getting started
|
||||
|
||||
- Configuration
|
||||
- [Configuration](configuration.md)
|
||||
- [Themes](themes.md)
|
||||
- [Using plugins](plugins.md)
|
||||
- [Markdown configuration](markdown.md)
|
||||
- [Language highlight](language-highlight.md)
|
||||
* [Quick start](quickstart.md)
|
||||
* [Writing more pages](more-pages.md)
|
||||
* [Custom navbar](custom-navbar.md)
|
||||
* [Cover page](cover.md)
|
||||
|
||||
* Configuration
|
||||
* [Configuration](configuration.md)
|
||||
* [Themes](themes.md)
|
||||
* [Using plugins](plugins.md)
|
||||
* [Markdown configuration](markdown.md)
|
||||
* [Language highlight](language-highlight.md)
|
||||
```
|
||||
|
||||
renders as
|
||||
|
||||

|
||||

|
||||
|
||||
## Combining custom navbars with the emoji plugin
|
||||
|
||||
@@ -90,6 +91,6 @@ you could, for example, use flag emojis in your custom navbar Markdown file:
|
||||
```markdown
|
||||
<!-- _navbar.md -->
|
||||
|
||||
- [:us:, :uk:](/)
|
||||
- [:cn:](/zh-cn/)
|
||||
* [:us:, :uk:](/)
|
||||
* [:cn:](/zh-cn/)
|
||||
```
|
||||
|
||||
@@ -11,13 +11,15 @@ Siehe [Schnellstart](de-de/quickstart.md) für weitere Informationen.
|
||||
## Features
|
||||
|
||||
* keine generierten, statischen HTML Dateien
|
||||
* einfach und klein (~16kB gzipped)
|
||||
* einfach und klein (~19kB gzipped)
|
||||
* smarte Erweiterung mit Volltextsuche
|
||||
* mehrere Themes
|
||||
* praktische API für Erweiterungen
|
||||
* Unterstützung für Emoji
|
||||
* Kompatibel mit IE10+
|
||||
|
||||
- Support SSR ([example](https://github.com/QingWei-Li/docsify-ssr-demo))
|
||||
|
||||
## Beispiele
|
||||
|
||||
Vergleiche die Liste namens [Showcase](https://github.com/QingWei-Li/docsify/#showcase) mit Beispielen, wie **docsify** verwendet wird.
|
||||
|
||||
+25
-19
@@ -1,22 +1,28 @@
|
||||
- Loslegen
|
||||
- [Schnellstart](de-de/quickstart.md)
|
||||
- [Schreiben weiterer Seiten](de-de/more-pages.md)
|
||||
- [Navigationsleiste anpassen](de-de/custom-navbar.md)
|
||||
- [Titelseite](de-de/cover.md)
|
||||
* Loslegen
|
||||
|
||||
- Anpassen
|
||||
- [Einstellungen](de-de/configuration.md)
|
||||
- [Themen](de-de/themes.md)
|
||||
- [Liste der Erweiterungen](de-de/plugins.md)
|
||||
- [Schreiben eigener Erweiterungen](de-de/write-a-plugin.md)
|
||||
- [Markdown-Einstellungen](de-de/markdown.md)
|
||||
- [Hervorheben von Sprachen](de-de/language-highlight.md)
|
||||
* [Schnellstart](de-de/quickstart.md)
|
||||
* [Schreiben weiterer Seiten](de-de/more-pages.md)
|
||||
* [Navigationsleiste anpassen](de-de/custom-navbar.md)
|
||||
* [Titelseite](de-de/cover.md)
|
||||
|
||||
- Guide
|
||||
- [Inbetriebnahme](de-de/deploy.md)
|
||||
- [Helfer](de-de/helpers.md)
|
||||
- [Vue Kompatibilität](de-de/vue.md)
|
||||
- [CDN](de-de/cdn.md)
|
||||
- [Offline Modus (PWA)](de-de/pwa.md)
|
||||
* Anpassen
|
||||
|
||||
- [Changelog](de-de/changelog.md)
|
||||
* [Einstellungen](de-de/configuration.md)
|
||||
* [Themen](de-de/themes.md)
|
||||
* [Liste der Erweiterungen](de-de/plugins.md)
|
||||
* [Schreiben eigener Erweiterungen](de-de/write-a-plugin.md)
|
||||
* [Markdown-Einstellungen](de-de/markdown.md)
|
||||
* [Hervorheben von Sprachen](de-de/language-highlight.md)
|
||||
|
||||
* Guide
|
||||
|
||||
* [Inbetriebnahme](de-de/deploy.md)
|
||||
* [Helfer](de-de/helpers.md)
|
||||
* [Vue Kompatibilität](de-de/vue.md)
|
||||
* [CDN](de-de/cdn.md)
|
||||
* [Offline Modus (PWA)](de-de/pwa.md)
|
||||
* [Server-Side Rendering (SSR)](de-de/ssr.md)
|
||||
* [Embed Files <sup style="color:red">(new)<sup>](de-de/embed-files.md)
|
||||
|
||||
* [Awesome docsify](de-de/awesome.md)
|
||||
* [Changelog](de-de/changelog.md)
|
||||
|
||||
+1
-1
@@ -45,5 +45,5 @@ Alternativ kannst du auch die [komprimierten Dateien](#komprimierte-dateien) ver
|
||||
## Andere CDN
|
||||
|
||||
- http://www.bootcdn.cn/docsify
|
||||
- http://www.jsdelivr.com/projects/docsify
|
||||
- https://cdn.jsdelivr.net/npm/docsify/
|
||||
- https://cdnjs.com/libraries/docsify
|
||||
|
||||
+213
-80
@@ -1,9 +1,8 @@
|
||||
# Einstellungen
|
||||
|
||||
**docsify** unterstützt zwei verschiedene Arten, um die Einstellungen anzupassen. Du kannst das `window.$docsify` anpassen, oder die Einstellungen über das script tag im `data-*` Attribut vornehmen.
|
||||
You can configure the `window.$docsify`.
|
||||
|
||||
```html
|
||||
<!-- über $docsify -->
|
||||
<script>
|
||||
window.$docsify = {
|
||||
repo: 'QingWei-Li/docsify',
|
||||
@@ -11,37 +10,25 @@
|
||||
coverpage: true
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- oder data-* -->
|
||||
<script
|
||||
src="//unpkg.com/docsify"
|
||||
data-repo="QingWei-Li/docsify"
|
||||
data-max-level="3"
|
||||
data-coverpage>
|
||||
</script>
|
||||
```
|
||||
|
||||
Beide Arten sind miteinander kompatibel, wobei die erste jedoch empfohlen wird. Sie ist deutlicher und kann in einer separaten Datei geführt werden.
|
||||
|
||||
!> Innerhalb des `window.$docsfiy` sollten die Optionen mit camelCase geschrieben werden.
|
||||
|
||||
## el
|
||||
|
||||
- Typ: `String`
|
||||
- Standard: `#app`
|
||||
* Typ: `String`
|
||||
* Standard: `#app`
|
||||
|
||||
Das DOM Element kann bei der Initialisierung gesetzt werden. Es kann ein CSS selector string oder ein richtiges HTMLElement sein.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
el: '#app'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## repo
|
||||
|
||||
- Typ: `String`
|
||||
- Standard: `null`
|
||||
* Typ: `String`
|
||||
* Standard: `null`
|
||||
|
||||
Verwende die repository URL oder eine Zeichenfolge aus `Benutzername/repo`, um das [GitHub Corner](http://tholman.com/github-corners/) widget in die obere rechte Ecke der Seite zu implementieren.
|
||||
|
||||
@@ -50,26 +37,26 @@ window.$docsify = {
|
||||
repo: 'QingWei-Li/docsify',
|
||||
// oder
|
||||
repo: 'https://github.com/QingWei-Li/docsify/'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## max-level
|
||||
## maxLevel
|
||||
|
||||
- Typ: `Number`
|
||||
- Standard: `6`
|
||||
* Typ: `Number`
|
||||
* Standard: `6`
|
||||
|
||||
Maximale Anzahl der Inhaltsübersichtebenen.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
maxLevel: 4
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## load-navbar
|
||||
## loadNavbar
|
||||
|
||||
- Typ: `Boolean|String`
|
||||
- Standard: `false`
|
||||
* Typ: `Boolean|String`
|
||||
* Standard: `false`
|
||||
|
||||
Lädt die Navigationsleiste von der Markdown Datei `_navbar.md` falls **true**, oder vom gewählten Pfad.
|
||||
|
||||
@@ -80,13 +67,13 @@ window.$docsify = {
|
||||
|
||||
// lade von nav.md
|
||||
loadNavbar: 'nav.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## load-sidebar
|
||||
## loadSidebar
|
||||
|
||||
- Typ: `Boolean|String`
|
||||
- Standard: `false`
|
||||
* Typ: `Boolean|String`
|
||||
* Standard: `false`
|
||||
|
||||
Lädt das seitliche Inhaltsverzeichnis von der Markdown Datei `_sidebar.md` falls **true**, oder vom gewählten Pfad.
|
||||
|
||||
@@ -97,39 +84,39 @@ window.$docsify = {
|
||||
|
||||
// lade von summary.md
|
||||
loadSidebar: 'summary.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## sub-max-level
|
||||
## subMaxLevel
|
||||
|
||||
- Typ: `Number`
|
||||
- Standard: `0`
|
||||
* Typ: `Number`
|
||||
* Standard: `0`
|
||||
|
||||
Wähle die maximale Anzahl der Unterpunkte pro Datei in der Inhaltsübersicht.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
subMaxLevel: 2
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## auto2top
|
||||
|
||||
- Typ: `Boolean`
|
||||
- Standard: `false`
|
||||
* Typ: `Boolean`
|
||||
* Standard: `false`
|
||||
|
||||
Scrolle zum Anfang der Seite, wenn die Route gewechselt wird.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
auto2top: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## homepage
|
||||
|
||||
- Typ: `String`
|
||||
- Standard: `README.md`
|
||||
* Typ: `String`
|
||||
* Standard: `README.md`
|
||||
|
||||
`README.md` in deinem Ordner für die Dokumentation wird als Startseite für deine Webseite gesetzt, aber manchmal musst du das vielleicht ändern.
|
||||
|
||||
@@ -139,13 +126,14 @@ window.$docsify = {
|
||||
homepage: 'home.md',
|
||||
|
||||
// Oder verwende das README in deinem repo
|
||||
homepage: 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/README.md'
|
||||
}
|
||||
homepage:
|
||||
'https://raw.githubusercontent.com/QingWei-Li/docsify/master/README.md'
|
||||
};
|
||||
```
|
||||
|
||||
## base-path
|
||||
## basePath
|
||||
|
||||
- Typ: `String`
|
||||
* Typ: `String`
|
||||
|
||||
Der Basispfad der Webseite. Du kannst einen anderen Ordner wählen, oder eine andere Domain.
|
||||
|
||||
@@ -157,14 +145,15 @@ window.$docsify = {
|
||||
basePath: 'https://docsify.js.org/',
|
||||
|
||||
// Oder lade Dateien von einem anderen repo
|
||||
basePath: 'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
|
||||
}
|
||||
basePath:
|
||||
'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
|
||||
};
|
||||
```
|
||||
|
||||
## coverpage
|
||||
|
||||
- Typ: `Boolean|String`
|
||||
- Standard: `false`
|
||||
* Typ: `Boolean|String`
|
||||
* Standard: `false`
|
||||
|
||||
Aktiviere das [Titelseitenfeature](de-de/cover.md). Falls `true`, wird sie von `_coverpage.md` geladen.
|
||||
|
||||
@@ -173,26 +162,35 @@ window.$docsify = {
|
||||
coverpage: true,
|
||||
|
||||
// Anderer Dateiname
|
||||
coverpage: 'cover.md'
|
||||
}
|
||||
coverpage: 'cover.md',
|
||||
|
||||
// mutiple covers
|
||||
coverpage: ['/', '/zh-cn/'],
|
||||
|
||||
// mutiple covers and custom file name
|
||||
coverpage: {
|
||||
'/': 'cover.md',
|
||||
'/zh-cn/': 'cover.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## name
|
||||
|
||||
- Typ: `String`
|
||||
* Typ: `String`
|
||||
|
||||
Webseitenname, wie er in der Inhaltsübersicht in der Seitenleiste angezeigt wird.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
name: 'docsify'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## name-link
|
||||
## nameLink
|
||||
|
||||
- Typ: `String`
|
||||
- Standard: `window.location.pathname`
|
||||
* Typ: `String`
|
||||
* Standard: `window.location.pathname`
|
||||
|
||||
Der Name der Links.
|
||||
|
||||
@@ -205,12 +203,12 @@ window.$docsify = {
|
||||
'/zh-cn/': '/zh-cn/',
|
||||
'/': '/'
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## markdown
|
||||
|
||||
- Typ: `Function`
|
||||
* Typ: `Function`
|
||||
|
||||
Siehe [Markdown Konfiguration](de-de/markdown.md).
|
||||
|
||||
@@ -227,43 +225,46 @@ window.$docsify = {
|
||||
},
|
||||
|
||||
// Funktion
|
||||
markdown: function (marked, renderer) {
|
||||
markdown: function(marked, renderer) {
|
||||
// ...
|
||||
return marked
|
||||
return marked;
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## theme-color
|
||||
## themeColor
|
||||
|
||||
- Typ: `String`
|
||||
* Typ: `String`
|
||||
|
||||
Passe die Farbe der Themen an. Verwende [CSS3 Variablen](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) und polyfill in älteren Browsern.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
themeColor: '#3F51B5'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## alias
|
||||
|
||||
- Typ: `Object`
|
||||
* Typ: `Object`
|
||||
|
||||
Verwende alternative Routen. Du kannst sie ungehindert anpassen.
|
||||
Verwende alternative Routen. Du kannst sie ungehindert anpassen. Supports RegExp.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'/foo/(+*)': '/bar/$1', // supports regexp
|
||||
'/zh-cn/changelog': '/changelog',
|
||||
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
|
||||
'/changelog':
|
||||
'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
|
||||
'/.*/_sidebar.md': '/_sidebar.md' // See #301
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## auto-header
|
||||
## autoHeader
|
||||
|
||||
- Typ: `Boolean`
|
||||
* Typ: `Boolean`
|
||||
|
||||
Sollten `loadSidebar` und `autoHeader` beide aktiviert sein, setze einen Header vor die Seite in jedem Link in `_sidebar.md`, bevor sie in HTML umgewandelt wird. Vergleiche [#78](https://github.com/QingWei-Li/docsify/issues/78).
|
||||
|
||||
@@ -271,19 +272,19 @@ Sollten `loadSidebar` und `autoHeader` beide aktiviert sein, setze einen Header
|
||||
window.$docsify = {
|
||||
loadSidebar: true,
|
||||
autoHeader: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## execute-script
|
||||
## executeScript
|
||||
|
||||
- Typ: `Boolean`
|
||||
* Typ: `Boolean`
|
||||
|
||||
Führe das Skript auf der Seite aus. Analysiere nur das erste script tag ([demo](de-de/themes.md)). Sollte Vue verwendet sein, wird es in der Standardeinstellung ausgeführt.
|
||||
Führe das Skript auf der Seite aus. Analysiere nur das erste script tag ([demo](de-de/themes.md)). Sollte Vue verwendet sein, wird es in der Standardeinstellung ausgeführt.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
executeScript: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
```markdown
|
||||
@@ -296,22 +297,154 @@ window.$docsify = {
|
||||
|
||||
?> Nehme zur Kenntnis, dass, solltest du ein externes Skript ausführen, z.B. ein eingebettete jsfiddle demo, du sicher gehen solltest, das [external-script](de-de/plugins.md?id=external-script) plugin zu verwenden.
|
||||
|
||||
## no-emoji
|
||||
## noEmoji
|
||||
|
||||
* type: `Boolean`
|
||||
|
||||
Verhindere die Umwandlung in Emojis:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
noEmoji: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## merge-navbar
|
||||
## mergeNavbar
|
||||
|
||||
* type: `Boolean`
|
||||
|
||||
Navbar will be merged with the sidebar on smaller screens.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
mergeNavbar: true
|
||||
}
|
||||
```
|
||||
};
|
||||
```
|
||||
|
||||
## formatUpdated
|
||||
|
||||
* type: `String|Function`
|
||||
|
||||
We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
|
||||
See https://github.com/lukeed/tinydate#patterns
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
|
||||
formatUpdated: function(time) {
|
||||
// ...
|
||||
|
||||
return time;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## externalLinkTarget
|
||||
|
||||
* type: `String`
|
||||
* default: `_blank`
|
||||
|
||||
Currently it defaults to \_blank, would be nice if configurable:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
externalLinkTarget: '_self' // default: '_blank'
|
||||
};
|
||||
```
|
||||
|
||||
## routerMode
|
||||
|
||||
* type: `String`
|
||||
* default: `history`
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
routerMode: 'history' // default: 'hash'
|
||||
};
|
||||
```
|
||||
|
||||
## noCompileLinks
|
||||
|
||||
* type: `Array`
|
||||
|
||||
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/QingWei-Li/docsify/issues/203)
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
noCompileLinks: ['/foo', '/bar/.*']
|
||||
};
|
||||
```
|
||||
|
||||
## requestHeaders
|
||||
|
||||
* type: `Object`
|
||||
|
||||
Set the request resource headers.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
requestHeaders: {
|
||||
'x-token': 'xxx'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## ext
|
||||
|
||||
* type: `String`
|
||||
|
||||
Request file extension.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
ext: '.md'
|
||||
};
|
||||
```
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
|
||||
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
|
||||
|
||||
Example:
|
||||
|
||||
* try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
|
||||
* then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
|
||||
* then display 404 page.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
fallbackLanguages: ['fr', 'de']
|
||||
};
|
||||
```
|
||||
|
||||
## 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.
|
||||
|
||||
+46
-3
@@ -26,9 +26,9 @@ Setze `coverpage` auf **true**, und erstelle `_coverpage.md`:
|
||||
|
||||
> Ein magischer Generator für Dokumentationsseiten.
|
||||
|
||||
- Einfach und wenig Speicherbedarf (~16kB gzipped)
|
||||
- Keine statischen HTML Dateien
|
||||
- Mehrere Themes
|
||||
* Einfach und wenig Speicherbedarf (~19kB gzipped)
|
||||
* Keine statischen HTML Dateien
|
||||
* Mehrere Themes
|
||||
|
||||
[GitHub](https://github.com/QingWei-Li/docsify/)
|
||||
[Schnellstart](#docsify)
|
||||
@@ -49,8 +49,51 @@ Die Hintergrundfarbe wird in der Standardeinstellung zufällig generiert. Du kan
|
||||
[Schnellstart](#quick-start)
|
||||
|
||||
<!-- Hintegrundbild -->
|
||||
|
||||

|
||||
|
||||
<!-- Hintegrundfarbe -->
|
||||
|
||||

|
||||
```
|
||||
|
||||
## Coverpage as homepage
|
||||
|
||||
Normal, the coverpage and the homepage appear at the same time. Of course, you can also separate the coverpage by [onlyCover option](de-de/configuration.md#onlycover).
|
||||
|
||||
## Multiple covers
|
||||
|
||||
If your docs site is in more than one language, it may be useful to set multiple covers.
|
||||
|
||||
For example, your docs structure is like this
|
||||
|
||||
```text
|
||||
.
|
||||
└── docs
|
||||
├── README.md
|
||||
├── guide.md
|
||||
├── _coverpage.md
|
||||
└── zh-cn
|
||||
├── README.md
|
||||
└── guide.md
|
||||
└── _coverpage.md
|
||||
```
|
||||
|
||||
Now, you can set
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
coverpage: ['/', '/zh-cn/']
|
||||
};
|
||||
```
|
||||
|
||||
Or a special file name
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
coverpage: {
|
||||
'/': 'cover.md',
|
||||
'/zh-cn/': 'cover.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
+19
-18
@@ -20,7 +20,7 @@ Solltest du eine Navigationsleiste benötigen, so kannst du eine HTML-basierte e
|
||||
|
||||
## Markdown
|
||||
|
||||
Oder du kannst deine Navigationsleiste mit einer Datei basierend auf Markdown erstellen, indem du `loadNavbar` auf **true** setzt und eine Datei namens `_navbar.md` erstellst, vergleiche [load-navbar Einstellungen](configuration.md#load-navbar).
|
||||
Oder du kannst deine Navigationsleiste mit einer Datei basierend auf Markdown erstellen, indem du `loadNavbar` auf **true** setzt und eine Datei namens `_navbar.md` erstellst, vergleiche [loadNavbar Einstellungen](configuration.md#loadnavbar).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -36,13 +36,13 @@ Oder du kannst deine Navigationsleiste mit einer Datei basierend auf Markdown er
|
||||
```markdown
|
||||
<!-- _navbar.md -->
|
||||
|
||||
- [En](/)
|
||||
- [Deutsch](/de-de/)
|
||||
* [En](/)
|
||||
* [Deutsch](/de-de/)
|
||||
```
|
||||
|
||||
!> Solltest du Github Pages verwenden, musst du zusätzlich eine Datei namens `.nojekyll` in `./docs` erstellen, um zu verhindern, dass Github Dateien ignoriert, die mit einem Unterstrich anfangen.
|
||||
|
||||
`_navbar.md` wird in jedem Verzeichnislevel geladen. Sollte das aktuelle Verzeichnis keine Datei namens `_navbar.md` haben, so sucht **docsify** in den übergeordneten Ordnern. Wenn du z.B. im Moment im Verzeichnis `/guide/quick-start` bist, so wird `_navbar.md` von der Datei `/guide/_navbar.md` geladen.
|
||||
`_navbar.md` wird in jedem Verzeichnislevel geladen. Sollte das aktuelle Verzeichnis keine Datei namens `_navbar.md` haben, so sucht **docsify** in den übergeordneten Ordnern. Wenn du z.B. im Moment im Verzeichnis `/guide/quick-start` bist, so wird `_navbar.md` von der Datei `/guide/_navbar.md` geladen.
|
||||
|
||||
## Aufbauen von Strukturen
|
||||
|
||||
@@ -51,23 +51,24 @@ Du kannst untergeordnete Listen erstellen, indem du untergeordnete Punkte einem
|
||||
```markdown
|
||||
<!-- _navbar.md -->
|
||||
|
||||
- Getting started
|
||||
- [Quick start](de-de/quickstart.md)
|
||||
- [Writing more pages](de-de/more-pages.md)
|
||||
- [Custom navbar](de-de/custom-navbar.md)
|
||||
- [Cover page](de-de/cover.md)
|
||||
* Getting started
|
||||
|
||||
- Configuration
|
||||
- [Configuration](de-de/configuration.md)
|
||||
- [Themes](de-de/themes.md)
|
||||
- [Using plugins](de-de/plugins.md)
|
||||
- [Markdown configuration](de-de/markdown.md)
|
||||
- [Language highlight](de-de/language-highlight.md)
|
||||
* [Quick start](de-de/quickstart.md)
|
||||
* [Writing more pages](de-de/more-pages.md)
|
||||
* [Custom navbar](de-de/custom-navbar.md)
|
||||
* [Cover page](de-de/cover.md)
|
||||
|
||||
* Configuration
|
||||
* [Configuration](de-de/configuration.md)
|
||||
* [Themes](de-de/themes.md)
|
||||
* [Using plugins](de-de/plugins.md)
|
||||
* [Markdown configuration](de-de/markdown.md)
|
||||
* [Language highlight](de-de/language-highlight.md)
|
||||
```
|
||||
|
||||
wird also wie folgt aussehen
|
||||
|
||||

|
||||

|
||||
|
||||
## Angepasste Navigationsleisten in Verbindung mit dem emoji Erweiterung
|
||||
|
||||
@@ -90,6 +91,6 @@ so kannst du z.B. auch die Flaggenemojis in der Markdown Datei für deine angepa
|
||||
```markdown
|
||||
<!-- _navbar.md -->
|
||||
|
||||
- [:us:, :uk:](/)
|
||||
- [:de:](/de-de/)
|
||||
* [:us:, :uk:](/)
|
||||
* [:de:](/de-de/)
|
||||
```
|
||||
|
||||
@@ -16,6 +16,30 @@ Es wird empfohlen, deine Dateien im `./docs` Unterordner im `master` branch dein
|
||||
|
||||
!> Du kannst die Dateien auch im Hauptverzeichnis speichern und dann `master branch` in den Einstellungen auswählen.
|
||||
|
||||
|
||||
## GitLab Pages
|
||||
|
||||
If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
|
||||
|
||||
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
|
||||
|
||||
``` YAML
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
- mkdir .public
|
||||
- cp -r * .public
|
||||
- mv .public public
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
```
|
||||
|
||||
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
|
||||
|
||||
|
||||
## VPS
|
||||
|
||||
Verwende folgende nginx config.
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
# Embed files
|
||||
|
||||
With docsify 4.6 it is now possible to embed any type of file.
|
||||
You can embed these files as video, audio, iframes, or code blocks, and even Markdown files can even be embedded directly into the document.
|
||||
|
||||
For example, here embedded a Markdown file. You only need to do this:
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include')
|
||||
```
|
||||
|
||||
Then the content of `example.md` will be displayed directly here
|
||||
|
||||
[filename](_media/example.md ':include')
|
||||
|
||||
You can check the original content for [example.md](_media/example.md ':ignore').
|
||||
|
||||
Normally, this will compiled into a link, but in docsify, if you add `:include` it will be embedded.
|
||||
|
||||
## Embedded file type
|
||||
|
||||
Currently, file extension are automatically recognized and embedded in different ways.
|
||||
|
||||
This is a supported embedding type:
|
||||
|
||||
* **iframe** `.html`, `.htm`
|
||||
* **markdown** `.markdown`, `.md`
|
||||
* **audio** `.mp3`
|
||||
* **video** `.mp4`, `.ogg`
|
||||
* **code** other file extension
|
||||
|
||||
Of course, you can force the specified. For example, you want to Markdown file as code block embedded.
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
```
|
||||
|
||||
You will get it
|
||||
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
|
||||
## Tag attribute
|
||||
|
||||
If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags.
|
||||
|
||||
```markdown
|
||||
[cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px')
|
||||
```
|
||||
|
||||
[cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px')
|
||||
|
||||
Did you see it? You only need to write directly. You can check [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) for these attributes.
|
||||
|
||||
## The code block highlight
|
||||
|
||||
Embedding any type of source code file, you can specify the highlighted language or automatically identify.
|
||||
|
||||
```markdown
|
||||
[](_media/example.html ':include :type=code text')
|
||||
```
|
||||
|
||||
⬇️
|
||||
|
||||
[](_media/example.html ':include :type=code text')
|
||||
|
||||
?> How to set highlight? You can see [here](language-highlight.md).
|
||||
+51
-2
@@ -19,9 +19,58 @@ wird wie folgt gerendert:
|
||||
Generelle Tipps wie:
|
||||
|
||||
```markdown
|
||||
?> *TODO* unit test
|
||||
?> _TODO_ unit test
|
||||
```
|
||||
|
||||
wird wie folgt gerendert:
|
||||
|
||||
?> *TODO* unit test
|
||||
?> _TODO_ unit test
|
||||
|
||||
## Ignore to compile link
|
||||
|
||||
Some time we will put some other relative path to the link, you have to need to tell docsify you don't need to compile this link. For example
|
||||
|
||||
```md
|
||||
[link](/demo/)
|
||||
```
|
||||
|
||||
It will be compiled to `<a href="/#/demo/">link</a>` and will be loaded `/demo/README.md`. Maybe you want to jump to `/demo/index.html`.
|
||||
|
||||
Now you can do that
|
||||
|
||||
```md
|
||||
[link](/demo/ ':ignore')
|
||||
```
|
||||
|
||||
You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set title for link.
|
||||
|
||||
```md
|
||||
[link](/demo/ ':ignore title')
|
||||
|
||||
<a href="/demo/" title="title">link</a>
|
||||
```
|
||||
|
||||
## Set target attribute for link
|
||||
|
||||
```md
|
||||
[link](/demo ':target=_blank')
|
||||
[link](/demo2 ':target=_self')
|
||||
```
|
||||
|
||||
## Github Task Lists
|
||||
|
||||
```md
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
```
|
||||
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
|
||||
@@ -28,3 +28,30 @@ window.$docsify = {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Supports mermaid
|
||||
|
||||
```js
|
||||
// Import mermaid
|
||||
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
|
||||
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
|
||||
mermaid.initialize({ startOnLoad: false });
|
||||
|
||||
window.$docsify = {
|
||||
markdown: {
|
||||
renderer: {
|
||||
code: function(code, lang) {
|
||||
if (lang === "mermaid") {
|
||||
return (
|
||||
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
|
||||
);
|
||||
}
|
||||
return this.origin.code.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ docs/de-de/guide.md => http://domain.com/de-de/guide
|
||||
|
||||
Als Standardeinstellung wird das Inhaltsverzeichnis in der Seitenleiste automatisch basierend auf vorhandenen Markdown Dateien generiert. Wenn du das seitliche Inhaltsverzeichnis anpassen willst, kannst du eine Datei namens `_sidebar.md` erstellen (vergleiche [das seitliche Inhaltsverzeichnis für diese Dokumentation](https://github.com/QingWei-Li/docsify/blob/master/docs/de-de/_sidebar.md) als Beispiel):
|
||||
|
||||
Als Erstes musst du `loadSidebar` auf **true** setzen, vergleiche [Einstellungen für das seitliche Inhaltsverzeichnis](configuration.md#load-sidebar).
|
||||
Als Erstes musst du `loadSidebar` auf **true** setzen, vergleiche [Einstellungen für das seitliche Inhaltsverzeichnis](configuration.md#loadsidebar).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -45,17 +45,30 @@ Als Zweites erstellst du eine Datei namens `_sidebar.md`:
|
||||
```markdown
|
||||
<!-- docs/_sidebar.md -->
|
||||
|
||||
- [Home](/)
|
||||
- [Guide](de-de/guide.md)
|
||||
* [Home](/)
|
||||
* [Guide](de-de/guide.md)
|
||||
```
|
||||
|
||||
!> Solltest du Github Pages verwenden, musst du zusätzlich eine Datei namens `.nojekyll` in `./docs` erstellen, um zu verhindern, dass Github Dateien ignoriert, die mit einem Unterstrich anfangen.
|
||||
|
||||
`_sidebar.md` wird in jedem Verzeichnislevel geladen. Sollte das aktuelle Verzeichnis keine Datei namens `_sidebar.md` haben, so sucht **docsify** in den übergeordneten Ordnern. Wenn du z.B. im Moment im Verzeichnis `/guide/quick-start` bist, so wird `_sidebar.md` von der Datei `/guide/_sidebar.md` geladen.
|
||||
`_sidebar.md` wird in jedem Verzeichnislevel geladen. Sollte das aktuelle Verzeichnis keine Datei namens `_sidebar.md` haben, so sucht **docsify** in den übergeordneten Ordnern. Wenn du z.B. im Moment im Verzeichnis `/guide/quick-start` bist, so wird `_sidebar.md` von der Datei `/guide/_sidebar.md` geladen.
|
||||
|
||||
You can specify `alias` to avoid unnecessary fallback.
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
loadSidebar: true,
|
||||
alias: {
|
||||
'/.*/_sidebar.md': '/_sidebar.md'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
## Inhaltsverzeichnis
|
||||
|
||||
Eine angepasste Seitenleist kann auch automatisch ein Inhaltsverzeichnis generieren, indem ein `subMaxLevel` gesetzt wird, vergleiche [sub-max-level Einstellungen](configuration.md#sub-max-level).
|
||||
Eine angepasste Seitenleist kann auch automatisch ein Inhaltsverzeichnis generieren, indem ein `subMaxLevel` gesetzt wird, vergleiche [subMaxLevel Einstellungen](configuration.md#submaxlevel).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -77,6 +90,7 @@ When `subMaxLevel` is set, each header is automatically added to the table of co
|
||||
# Getting Started
|
||||
|
||||
## Header {docsify-ignore}
|
||||
|
||||
This header won't appear in the sidebar table of contents.
|
||||
```
|
||||
|
||||
@@ -86,6 +100,7 @@ To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on
|
||||
# Getting Started {docsify-ignore-all}
|
||||
|
||||
## Header
|
||||
|
||||
This header won't appear in the sidebar table of contents.
|
||||
```
|
||||
|
||||
|
||||
+90
-2
@@ -35,7 +35,10 @@ Als Standardeinstellung werden Hyperlinks auf der aktuellen Seite erkannt und de
|
||||
noData: {
|
||||
'/de-de/': 'Keine Ergebnisse',
|
||||
'/': 'No Results'
|
||||
}
|
||||
},
|
||||
|
||||
// Headline depth, 1 - 6
|
||||
depth: 2
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -88,8 +91,93 @@ Wenn das Skript auf der Seite ein externes ist (eine Javascript Datei über das
|
||||
|
||||
## Bilder zoomen
|
||||
|
||||
Medium's Bilderzoom. Basierend auf [zoom-image](https://github.com/egoist/zoom-image).
|
||||
Medium's Bilderzoom. Basierend auf [medium-zoom](https://github.com/francoischalifour/medium-zoom).
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.min.js"></script>
|
||||
```
|
||||
|
||||
Exclude the special image
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
|
||||
## Demo code with instant preview and jsfiddle integration
|
||||
|
||||
With this plugin, sample code can be rendered on the page instantly, so that the readers can see the preview immediately.
|
||||
When readers expand the demo box, the source code and description are shown there. if they click the button `Try in Jsfiddle`,
|
||||
`jsfiddle.net` will be open with the code of this sample, which allow readers to revise the code and try on their own.
|
||||
|
||||
[Vue](https://njleonzhang.github.io/docsify-demo-box-vue/) and [React](https://njleonzhang.github.io/docsify-demo-box-react/) are both supported.
|
||||
|
||||
|
||||
## Edit on github
|
||||
|
||||
Add `Edit on github` button on every pages. Provided by [@njleonzhang](https://github.com/njleonzhang), check [document](https://github.com/njleonzhang/docsify-edit-on-github)
|
||||
|
||||
## Copy to Clipboard
|
||||
|
||||
Add a simple `Click to copy` button to all preformatted code blocks to effortlessly allow users to copy example code from your docs. Provided by [@jperasmus](https://github.com/jperasmus)
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify-copy-code/styles.css">
|
||||
<script src="//unpkg.com/docsify-copy-code/index.js"></script>
|
||||
```
|
||||
|
||||
```javascript
|
||||
window.$docsify = {
|
||||
plugins: [
|
||||
window.DocsifyCopyCodePlugin.init()
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.
|
||||
|
||||
|
||||
|
||||
## Disqus
|
||||
|
||||
Disqus comments. https://disqus.com/
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
disqus: 'shortname'
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/disqus.min.js"></script>
|
||||
```
|
||||
|
||||
|
||||
## Gitalk
|
||||
|
||||
[Gitalk](https://github.com/gitalk/gitalk) is a modern comment component based on Github Issue and Preact.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//unpkg.com/gitalk/dist/gitalk.css">
|
||||
|
||||
<script src="//unpkg.com/docsify/lib/plugins/gitalk.min.js"></script>
|
||||
<script src="//unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
||||
<script>
|
||||
const gitalk = new Gitalk({
|
||||
clientID: 'Github Application Client ID',
|
||||
clientSecret: 'Github Application Client Secret',
|
||||
repo: 'Github repo',
|
||||
owner: 'Github repo owner',
|
||||
admin: ['Github repo collaborators, only these guys can initialize github issues'],
|
||||
// facebook-like distraction free mode
|
||||
distractionFreeMode: false
|
||||
})
|
||||
</script>
|
||||
```
|
||||
|
||||
## Navigation
|
||||
|
||||
Pagination for docsify. By [@imyelo](https://github.com/imyelo)
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
||||
```
|
||||
|
||||
@@ -44,13 +44,20 @@ Wenn du `npm` nicht verwenden möchtest, oder Probleme bei der Installation des
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">dict.
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
//...
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
</body>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
# Server-Side Rendering
|
||||
|
||||
See https://docsify.now.sh
|
||||
|
||||
Repo in https://github.com/QingWei-Li/docsify-ssr-demo
|
||||
|
||||
## Why SSR?
|
||||
- Better SEO
|
||||
- Feeling cool
|
||||
|
||||
## Quick start
|
||||
|
||||
Install `now` and `docsify-cli` in your project.
|
||||
|
||||
```bash
|
||||
npm i now docsify-cli -D
|
||||
```
|
||||
|
||||
Edit `package.json`. If the documentation in `./docs` subdirectory.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-project",
|
||||
"scripts": {
|
||||
"start": "docsify start . -c ssr.config.js",
|
||||
"deploy": "now -p"
|
||||
},
|
||||
"files": [
|
||||
"docs"
|
||||
],
|
||||
"docsify": {
|
||||
"config": {
|
||||
"basePath": 'https://docsify.js.org/',
|
||||
"loadSidebar": true,
|
||||
"loadNavbar": true,
|
||||
"coverpage": true,
|
||||
"name": "docsify"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
!> The `basePath` just like webpack `publicPath`. We can use local or remote files.
|
||||
|
||||
We can preview in the local to see if it works.
|
||||
|
||||
```bash
|
||||
npm start
|
||||
|
||||
# open http://localhost:4000
|
||||
```
|
||||
|
||||
Publish it!
|
||||
|
||||
```bash
|
||||
now -p
|
||||
```
|
||||
|
||||
Now, You have a support for SSR the docs site.
|
||||
|
||||
## Custom template
|
||||
|
||||
You can provide a templte for entire page's HTML. such as
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>docsify</title>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css" title="vue">
|
||||
</head>
|
||||
<body>
|
||||
<!--inject-app-->
|
||||
<!--inject-config-->
|
||||
</body>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/search.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||
</html>
|
||||
```
|
||||
|
||||
The template should contain these comments for rendered app content.
|
||||
- `<!--inject-app-->`
|
||||
- `<!--inject-config-->`
|
||||
|
||||
## Configuration
|
||||
|
||||
You can configure it in a special config file, or `package.json`.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
template: './ssr.html',
|
||||
config: {
|
||||
// docsify config
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Deploy for your VPS
|
||||
|
||||
You can run `docsify start` directly on your Node server, or write your own server app with `docsify-server-renderer`.
|
||||
|
||||
```js
|
||||
var Renderer = require('docsify-server-renderer')
|
||||
var readFileSync = require('fs').readFileSync
|
||||
|
||||
// init
|
||||
var renderer = new Renderer({
|
||||
template: readFileSync('./docs/index.template.html', 'utf-8').,
|
||||
config: {
|
||||
name: 'docsify',
|
||||
repo: 'qingwei-li/docsify'
|
||||
}
|
||||
})
|
||||
|
||||
renderer.renderToString(url)
|
||||
.then(html => {})
|
||||
.catch(err => {})
|
||||
```
|
||||
@@ -47,6 +47,8 @@ window.$docsify = {
|
||||
|
||||
## Beispiel
|
||||
|
||||
### footer
|
||||
|
||||
Füge jeder Seite eine footer Komponente hinzu:
|
||||
|
||||
```js
|
||||
@@ -68,3 +70,25 @@ window.$docsify = {
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Edit Button
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
plugins: [
|
||||
function(hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs' + vm.route.file
|
||||
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
+46
-1
@@ -1,6 +1,6 @@
|
||||
# Deploy
|
||||
|
||||
Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pages or VPS.
|
||||
Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pages, GitLab Pages or VPS.
|
||||
|
||||
## GitHub Pages
|
||||
|
||||
@@ -15,6 +15,51 @@ It is recommended that you save your files to the `./docs` subfolder of the `mas
|
||||

|
||||
|
||||
!> You can also save files in the root directory and select `master branch`.
|
||||
You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch
|
||||
|
||||
## GitLab Pages
|
||||
|
||||
If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
|
||||
|
||||
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
|
||||
|
||||
``` YAML
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
- mkdir .public
|
||||
- cp -r * .public
|
||||
- mv .public public
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
```
|
||||
|
||||
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
|
||||
|
||||
## Firebase Hosting
|
||||
|
||||
!> You'll need to install the Firebase CLI using `npm i -g firebase-tools` after signing into the [Firebase Console](https://console.firebase.google.com) using a Google Account.
|
||||
|
||||
Using Terminal determine and navigate to the directory for your Firebase Project - this could be `~/Projects/Docs` etc. From there, run `firebase init`, choosing `Hosting` from the menu (use **space** to select, **arrow keys** to change options and **enter** to confirm). Follow the setup instructions.
|
||||
|
||||
You should have your `firebase.json` file looking similar to this (I changed the deployment directory from `public` to `site`):
|
||||
```json
|
||||
{
|
||||
"hosting": {
|
||||
"public": "site",
|
||||
"ignore": [
|
||||
"firebase.json",
|
||||
"**/.*",
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Once finished, build the starting template by running `docsify init ./site` (replacing site with the deployment directory you determined when running `firebase init` - public by default). Add/edit the documentation, then run `firebase deploy` from the base project directory.
|
||||
|
||||
## VPS
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
# Embed files
|
||||
|
||||
With docsify 4.6 it is now possible to embed any type of file.
|
||||
You can embed these files as video, audio, iframes, or code blocks, and even Markdown files can even be embedded directly into the document.
|
||||
|
||||
For example, here embedded a Markdown file. You only need to do this:
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include')
|
||||
```
|
||||
|
||||
Then the content of `example.md` will be displayed directly here
|
||||
|
||||
[filename](_media/example.md ':include')
|
||||
|
||||
You can check the original content for [example.md](_media/example.md ':ignore').
|
||||
|
||||
Normally, this will compiled into a link, but in docsify, if you add `:include` it will be embedded.
|
||||
|
||||
## Embedded file type
|
||||
|
||||
Currently, file extension are automatically recognized and embedded in different ways.
|
||||
|
||||
This is a supported embedding type:
|
||||
|
||||
* **iframe** `.html`, `.htm`
|
||||
* **markdown** `.markdown`, `.md`
|
||||
* **audio** `.mp3`
|
||||
* **video** `.mp4`, `.ogg`
|
||||
* **code** other file extension
|
||||
|
||||
Of course, you can force the specified. For example, you want to Markdown file as code block embedded.
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
```
|
||||
|
||||
You will get it
|
||||
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
|
||||
## Tag attribute
|
||||
|
||||
If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags.
|
||||
|
||||
```markdown
|
||||
[cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px')
|
||||
```
|
||||
|
||||
[cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px')
|
||||
|
||||
Did you see it? You only need to write directly. You can check [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) for these attributes.
|
||||
|
||||
## The code block highlight
|
||||
|
||||
Embedding any type of source code file, you can specify the highlighted language or automatically identify.
|
||||
|
||||
```markdown
|
||||
[](_media/example.html ':include :type=code text')
|
||||
```
|
||||
|
||||
⬇️
|
||||
|
||||
[](_media/example.html ':include :type=code text')
|
||||
|
||||
?> How to set highlight? You can see [here](language-highlight.md).
|
||||
+57
-2
@@ -19,9 +19,64 @@ is rendered as:
|
||||
General tips like:
|
||||
|
||||
```markdown
|
||||
?> *TODO* unit test
|
||||
?> _TODO_ unit test
|
||||
```
|
||||
|
||||
are rendered as:
|
||||
|
||||
?> *TODO* unit test
|
||||
?> _TODO_ unit test
|
||||
|
||||
## Ignore to compile link
|
||||
|
||||
Some time we will put some other relative path to the link, you have to need to tell docsify you don't need to compile this link. For example
|
||||
|
||||
```md
|
||||
[link](/demo/)
|
||||
```
|
||||
|
||||
It will be compiled to `<a href="/#/demo/">link</a>` and will be loaded `/demo/README.md`. Maybe you want to jump to `/demo/index.html`.
|
||||
|
||||
Now you can do that
|
||||
|
||||
```md
|
||||
[link](/demo/ ':ignore')
|
||||
```
|
||||
|
||||
You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set title for link.
|
||||
|
||||
```md
|
||||
[link](/demo/ ':ignore title')
|
||||
|
||||
<a href="/demo/" title="title">link</a>
|
||||
```
|
||||
|
||||
## Set target attribute for link
|
||||
|
||||
```md
|
||||
[link](/demo ':target=_blank')
|
||||
[link](/demo2 ':target=_self')
|
||||
```
|
||||
|
||||
## Disable link
|
||||
|
||||
```md
|
||||
[link](/demo ':disabled')
|
||||
```
|
||||
|
||||
## Github Task Lists
|
||||
|
||||
```md
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
```
|
||||
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
|
||||
+58
-37
@@ -1,9 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>docsify</title>
|
||||
<link rel="icon" href="_media/favicon.ico">
|
||||
<meta name="google-site-verification" content="6t0LoIeFksrjF4c9sqUEsVXiQNxLp2hgoqo0KryT-sE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
|
||||
<meta name="description" content="A magical documentation generator.">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
@@ -17,43 +20,61 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">Loading ...</div>
|
||||
</body>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'/de-de/changelog': '/changelog',
|
||||
'/zh-cn/changelog': '/changelog',
|
||||
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
|
||||
},
|
||||
auto2top: true,
|
||||
coverpage: true,
|
||||
executeScript: true,
|
||||
loadSidebar: true,
|
||||
loadNavbar: true,
|
||||
mergeNavbar: true,
|
||||
maxLevel: 4,
|
||||
name: 'docsify',
|
||||
search: {
|
||||
noData: {
|
||||
'/de-de/': 'Keine Ergebnisse!',
|
||||
'/zh-cn/': '没有结果!',
|
||||
'/': 'No results!'
|
||||
<script>
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'.*?/awesome': 'https://raw.githubusercontent.com/QingWei-Li/awesome-docsify/master/README.md',
|
||||
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG.md',
|
||||
'/.*/_navbar.md': '/_navbar.md'
|
||||
},
|
||||
paths: 'auto',
|
||||
placeholder: {
|
||||
'/de-de/': 'Suche',
|
||||
'/zh-cn/': '搜索',
|
||||
'/': 'Search'
|
||||
}
|
||||
},
|
||||
subMaxLevel: 2
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||
</html>
|
||||
auto2top: true,
|
||||
coverpage: true,
|
||||
executeScript: true,
|
||||
loadSidebar: true,
|
||||
loadNavbar: true,
|
||||
mergeNavbar: true,
|
||||
maxLevel: 4,
|
||||
subMaxLevel: 2,
|
||||
ga: 'UA-106147152-1',
|
||||
name: 'docsify',
|
||||
search: {
|
||||
noData: {
|
||||
'/de-de/': 'Keine Ergebnisse!',
|
||||
'/zh-cn/': '没有结果!',
|
||||
'/': 'No results!'
|
||||
},
|
||||
paths: 'auto',
|
||||
placeholder: {
|
||||
'/de-de/': 'Suche',
|
||||
'/zh-cn/': '搜索',
|
||||
'/': 'Search'
|
||||
}
|
||||
},
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
plugins: [
|
||||
function (hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs/' + vm.route.file
|
||||
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/ga.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
# language highlight
|
||||
|
||||
**docsify** uses [Prism](https://github.com/PrismJS/prism) to highlight code blocks in your pages. By default it only supports CSS, JavaScipt and HTML. You can make **Prism** load additional languages:
|
||||
**docsify** uses [Prism](https://github.com/PrismJS/prism) to highlight code blocks in your pages. By default it only supports CSS, JavaScript and HTML. You can make **Prism** load additional languages:
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
|
||||
@@ -28,3 +28,28 @@ window.$docsify = {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Supports mermaid
|
||||
|
||||
```js
|
||||
// Import mermaid
|
||||
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
|
||||
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
|
||||
mermaid.initialize({ startOnLoad: false });
|
||||
|
||||
window.$docsify = {
|
||||
markdown: {
|
||||
renderer: {
|
||||
code: function(code, lang) {
|
||||
if (lang === "mermaid") {
|
||||
return (
|
||||
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
|
||||
);
|
||||
}
|
||||
return this.origin.code.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
+31
-14
@@ -6,12 +6,12 @@ For example, the directory structure is as follows:
|
||||
|
||||
```text
|
||||
.
|
||||
├── docs
|
||||
| └── README.md
|
||||
| └── guide.md
|
||||
| └── zh-cn
|
||||
| └──README.md
|
||||
| └──guide.md
|
||||
└── docs
|
||||
├── README.md
|
||||
├── guide.md
|
||||
└── zh-cn
|
||||
├── README.md
|
||||
└── guide.md
|
||||
```
|
||||
|
||||
Matching routes
|
||||
@@ -23,11 +23,11 @@ docs/zh-cn/README.md => http://domain.com/zh-cn/
|
||||
docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
|
||||
```
|
||||
|
||||
## Custom sidebar
|
||||
## Sidebar
|
||||
|
||||
By default, the table of contents in the sidebar is automatically generated based on your markdown files. If you need a custom sidebar, then you can create your own `_sidebar.md` (see [this documentation's sidebar](https://github.com/QingWei-Li/docsify/blob/master/docs/_sidebar.md) for an example):
|
||||
In order to have sidebar, then you can create your own `_sidebar.md` (see [this documentation's sidebar](https://github.com/QingWei-Li/docsify/blob/master/docs/_sidebar.md) for an example):
|
||||
|
||||
First, you need to set `loadSidebar` to **true**. Details are available in the [configuration paragraph](configuration.md#load-sidebar).
|
||||
First, you need to set `loadSidebar` to **true**. Details are available in the [configuration paragraph](configuration.md#loadsidebar).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -45,17 +45,32 @@ Create the `_sidebar.md`:
|
||||
```markdown
|
||||
<!-- docs/_sidebar.md -->
|
||||
|
||||
- [Home](/)
|
||||
- [Guide](guide.md)
|
||||
* [Home](/)
|
||||
* [Guide](guide.md)
|
||||
```
|
||||
|
||||
!> You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
|
||||
You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
|
||||
|
||||
`_sidebar.md` is loaded from each level directory. If the current directory doesn't have `_sidebar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_sidebar.md` will be loaded from `/guide/_sidebar.md`.
|
||||
`_sidebar.md` is loaded from each level directory. If the current directory doesn't have `_sidebar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_sidebar.md` will be loaded from `/guide/_sidebar.md`.
|
||||
|
||||
You can specify `alias` to avoid unnecessary fallback.
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
loadSidebar: true,
|
||||
alias: {
|
||||
'/.*/_sidebar.md': '/_sidebar.md'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
## Table of Contents
|
||||
|
||||
A custom sidebar can also automatically generate a table of contents by setting a `subMaxLevel`, compare [sub-max-level configuration](configuration.md#sub-max-level).
|
||||
Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.
|
||||
|
||||
A custom sidebar can also automatically generate a table of contents by setting a `subMaxLevel`, compare [subMaxLevel configuration](configuration.md#submaxlevel).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -77,6 +92,7 @@ When `subMaxLevel` is set, each header is automatically added to the table of co
|
||||
# Getting Started
|
||||
|
||||
## Header {docsify-ignore}
|
||||
|
||||
This header won't appear in the sidebar table of contents.
|
||||
```
|
||||
|
||||
@@ -86,6 +102,7 @@ To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on
|
||||
# Getting Started {docsify-ignore-all}
|
||||
|
||||
## Header
|
||||
|
||||
This header won't appear in the sidebar table of contents.
|
||||
```
|
||||
|
||||
|
||||
+90
-2
@@ -35,7 +35,10 @@ By default, the hyperlink on the current page is recognized and the content is s
|
||||
noData: {
|
||||
'/zh-cn/': '找不到结果',
|
||||
'/': 'No Results'
|
||||
}
|
||||
},
|
||||
|
||||
// Headline depth, 1 - 6
|
||||
depth: 2
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -88,8 +91,93 @@ If the script on the page is an external one (imports a js file via `src` attrib
|
||||
|
||||
## Zoom image
|
||||
|
||||
Medium's Image Zoom. Based on [zoom-image](https://github.com/egoist/zoom-image).
|
||||
Medium's image zoom. Based on [medium-zoom](https://github.com/francoischalifour/medium-zoom).
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.min.js"></script>
|
||||
```
|
||||
|
||||
Exclude the special image
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
|
||||
|
||||
## Edit on github
|
||||
|
||||
Add `Edit on github` button on every pages. Provided by [@njleonzhang](https://github.com/njleonzhang), check [document](https://github.com/njleonzhang/docsify-edit-on-github)
|
||||
|
||||
## Demo code with instant preview and jsfiddle integration
|
||||
|
||||
With this plugin, sample code can be rendered on the page instantly, so that the readers can see the preview immediately.
|
||||
When readers expand the demo box, the source code and description are shown there. if they click the button `Try in Jsfiddle`,
|
||||
`jsfiddle.net` will be open with the code of this sample, which allow readers to revise the code and try on their own.
|
||||
|
||||
[Vue](https://njleonzhang.github.io/docsify-demo-box-vue/) and [React](https://njleonzhang.github.io/docsify-demo-box-react/) are both supported.
|
||||
|
||||
|
||||
## Copy to Clipboard
|
||||
|
||||
Add a simple `Click to copy` button to all preformatted code blocks to effortlessly allow users to copy example code from your docs. Provided by [@jperasmus](https://github.com/jperasmus)
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify-copy-code/styles.css">
|
||||
<script src="//unpkg.com/docsify-copy-code/index.js"></script>
|
||||
```
|
||||
|
||||
```javascript
|
||||
window.$docsify = {
|
||||
plugins: [
|
||||
window.DocsifyCopyCodePlugin.init()
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.
|
||||
|
||||
|
||||
## Disqus
|
||||
|
||||
Disqus comments. https://disqus.com/
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
disqus: 'shortname'
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/disqus.min.js"></script>
|
||||
```
|
||||
|
||||
## Gitalk
|
||||
|
||||
[Gitalk](https://github.com/gitalk/gitalk) is a modern comment component based on Github Issue and Preact.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//unpkg.com/gitalk/dist/gitalk.css">
|
||||
|
||||
<script src="//unpkg.com/docsify/lib/plugins/gitalk.min.js"></script>
|
||||
<script src="//unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
||||
<script>
|
||||
const gitalk = new Gitalk({
|
||||
clientID: 'Github Application Client ID',
|
||||
clientSecret: 'Github Application Client Secret',
|
||||
repo: 'Github repo',
|
||||
owner: 'Github repo owner',
|
||||
admin: ['Github repo collaborators, only these guys can initialize github issues'],
|
||||
// facebook-like distraction free mode
|
||||
distractionFreeMode: false
|
||||
})
|
||||
</script>
|
||||
```
|
||||
|
||||
## Navigation
|
||||
|
||||
Pagination for docsify. By [@imyelo](https://github.com/imyelo)
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
||||
```
|
||||
|
||||
|
||||
+8
-1
@@ -44,13 +44,20 @@ If you don't like `npm` or have trouble installing the tool, you can manually cr
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
//...
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
</body>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
# Server-Side Rendering
|
||||
|
||||
See https://docsify.now.sh
|
||||
|
||||
Repo in https://github.com/QingWei-Li/docsify-ssr-demo
|
||||
|
||||
## Why SSR?
|
||||
- Better SEO
|
||||
- Feeling cool
|
||||
|
||||
## Quick start
|
||||
|
||||
Install `now` and `docsify-cli` in your project.
|
||||
|
||||
```bash
|
||||
npm i now docsify-cli -D
|
||||
```
|
||||
|
||||
Edit `package.json`. If the documentation in `./docs` subdirectory.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-project",
|
||||
"scripts": {
|
||||
"start": "docsify start . -c ssr.config.js",
|
||||
"deploy": "now -p"
|
||||
},
|
||||
"files": [
|
||||
"docs"
|
||||
],
|
||||
"docsify": {
|
||||
"config": {
|
||||
"basePath": "https://docsify.js.org/",
|
||||
"loadSidebar": true,
|
||||
"loadNavbar": true,
|
||||
"coverpage": true,
|
||||
"name": "docsify"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
!> The `basePath` just like webpack `publicPath`. We can use local or remote files.
|
||||
|
||||
We can preview in the local to see if it works.
|
||||
|
||||
```bash
|
||||
npm start
|
||||
|
||||
# open http://localhost:4000
|
||||
```
|
||||
|
||||
Publish it!
|
||||
|
||||
```bash
|
||||
now -p
|
||||
```
|
||||
|
||||
Now, You have a support for SSR the docs site.
|
||||
|
||||
## Custom template
|
||||
|
||||
You can provide a template for entire page's HTML. such as
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>docsify</title>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css" title="vue">
|
||||
</head>
|
||||
<body>
|
||||
<!--inject-app-->
|
||||
<!--inject-config-->
|
||||
<script src="//unpkg.com/docsify/lib/docsify.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/search.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
The template should contain these comments for rendered app content.
|
||||
- `<!--inject-app-->`
|
||||
- `<!--inject-config-->`
|
||||
|
||||
## Configuration
|
||||
|
||||
You can configure it in a special config file, or `package.json`.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
template: './ssr.html',
|
||||
maxAge: 60 * 60 * 1000, // lru-cache config
|
||||
config: {
|
||||
// docsify config
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Deploy for your VPS
|
||||
|
||||
You can run `docsify start` directly on your Node server, or write your own server app with `docsify-server-renderer`.
|
||||
|
||||
```js
|
||||
var Renderer = require('docsify-server-renderer')
|
||||
var readFileSync = require('fs').readFileSync
|
||||
|
||||
// init
|
||||
var renderer = new Renderer({
|
||||
template: readFileSync('./docs/index.template.html', 'utf-8').,
|
||||
config: {
|
||||
name: 'docsify',
|
||||
repo: 'qingwei-li/docsify'
|
||||
}
|
||||
})
|
||||
|
||||
renderer.renderToString(url)
|
||||
.then(html => {})
|
||||
.catch(err => {})
|
||||
```
|
||||
+3
-3
@@ -19,7 +19,7 @@ Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main'
|
||||
|
||||
*README.md*
|
||||
|
||||
```markdown
|
||||
````markdown
|
||||
# Vue guide
|
||||
|
||||
`v-for` usage.
|
||||
@@ -28,12 +28,12 @@ Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main'
|
||||
<ul>
|
||||
<li v-for="i in 10">{{ i }}</li>
|
||||
</ul>
|
||||
``
|
||||
```
|
||||
|
||||
<ul>
|
||||
<li v-for="i in 10">{{ i }}</li>
|
||||
</ul>
|
||||
```
|
||||
````
|
||||
|
||||
You can manually initialize a Vue instance.
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ window.$docsify = {
|
||||
|
||||
## Example
|
||||
|
||||
#### footer
|
||||
|
||||
Add footer component in each pages.
|
||||
|
||||
```js
|
||||
@@ -68,3 +70,24 @@ window.$docsify = {
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Edit Button
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
plugins: [
|
||||
function(hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs' + vm.route.file
|
||||
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -11,13 +11,15 @@ docsify 是一个动态生成文档网站的工具。不同于 GitBook、Hexo
|
||||
查看[快速开始](zh-cn/quickstart.md)了解详情。
|
||||
|
||||
## 特性
|
||||
- 无需构建,写完文档直接发布
|
||||
- 容易使用并且轻量 (~16kB gzipped)
|
||||
- 智能的全文搜索
|
||||
- 提供多套主题
|
||||
- 丰富的 API
|
||||
- 支持 Emoji
|
||||
- 兼容 IE10+
|
||||
|
||||
* 无需构建,写完文档直接发布
|
||||
* 容易使用并且轻量 (~19kB gzipped)
|
||||
* 智能的全文搜索
|
||||
* 提供多套主题
|
||||
* 丰富的 API
|
||||
* 支持 Emoji
|
||||
* 兼容 IE10+
|
||||
* 支持 SSR ([example](https://github.com/QingWei-Li/docsify-ssr-demo))
|
||||
|
||||
## 例子
|
||||
|
||||
|
||||
+25
-19
@@ -1,22 +1,28 @@
|
||||
- 入门
|
||||
- [快速开始](zh-cn/quickstart.md)
|
||||
- [多页文档](zh-cn/more-pages.md)
|
||||
- [定制导航栏](zh-cn/custom-navbar.md)
|
||||
- [封面](zh-cn/cover.md)
|
||||
* 入门
|
||||
|
||||
- 定制化
|
||||
- [配置项](zh-cn/configuration.md)
|
||||
- [主题](zh-cn/themes.md)
|
||||
- [插件列表](zh-cn/plugins.md)
|
||||
- [开发插件](zh-cn/write-a-plugin.md)
|
||||
- [Markdown 配置](zh-cn/markdown.md)
|
||||
- [代码高亮](zh-cn/language-highlight.md)
|
||||
* [快速开始](zh-cn/quickstart.md)
|
||||
* [多页文档](zh-cn/more-pages.md)
|
||||
* [定制导航栏](zh-cn/custom-navbar.md)
|
||||
* [封面](zh-cn/cover.md)
|
||||
|
||||
- 指南
|
||||
- [部署](zh-cn/deploy.md)
|
||||
- [文档助手](zh-cn/helpers.md)
|
||||
- [兼容 Vue](zh-cn/vue.md)
|
||||
- [CDN](zh-cn/cdn.md)
|
||||
- [离线模式(PWA)](zh-cn/pwa.md)
|
||||
* 定制化
|
||||
|
||||
- [Changelog](zh-cn/changelog.md)
|
||||
* [配置项](zh-cn/configuration.md)
|
||||
* [主题](zh-cn/themes.md)
|
||||
* [插件列表](zh-cn/plugins.md)
|
||||
* [开发插件](zh-cn/write-a-plugin.md)
|
||||
* [Markdown 配置](zh-cn/markdown.md)
|
||||
* [代码高亮](zh-cn/language-highlight.md)
|
||||
|
||||
* 指南
|
||||
|
||||
* [部署](zh-cn/deploy.md)
|
||||
* [文档助手](zh-cn/helpers.md)
|
||||
* [兼容 Vue](zh-cn/vue.md)
|
||||
* [CDN](zh-cn/cdn.md)
|
||||
* [离线模式(PWA)](zh-cn/pwa.md)
|
||||
* [服务端渲染 (SSR)](zh-cn/ssr.md)
|
||||
* [文件嵌入<sup style="color:red">(new)<sup>](zh-cn/embed-files.md)
|
||||
|
||||
* [Awesome docsify](zh-cn/awesome.md)
|
||||
* [Changelog](zh-cn/changelog.md)
|
||||
|
||||
+2
-2
@@ -44,6 +44,6 @@ JS 的压缩文件是原有文件路径的基础上加 `.min`后缀
|
||||
|
||||
## 其他 CDN
|
||||
|
||||
- http://www.bootcdn.cn/docsify
|
||||
- http://www.jsdelivr.com/projects/docsify
|
||||
- http://www.bootcdn.cn/docsify (支持国内)
|
||||
- https://cdn.jsdelivr.net/npm/docsify/ (国内外都支持)
|
||||
- https://cdnjs.com/libraries/docsify
|
||||
|
||||
+223
-87
@@ -1,9 +1,8 @@
|
||||
# 配置项
|
||||
|
||||
docsify 有两种配置参数的方式。一种是配置在 `window.$docsify` 里,另一种是给 `script` 标签添加 `data-*` 属性。
|
||||
你可以配置在 `window.$docsify` 里。
|
||||
|
||||
```html
|
||||
<!-- 方法 1 -->
|
||||
<script>
|
||||
window.$docsify = {
|
||||
repo: 'QingWei-Li/docsify',
|
||||
@@ -11,38 +10,25 @@ docsify 有两种配置参数的方式。一种是配置在 `window.$docsify`
|
||||
coverpage: true
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 方法 2 -->
|
||||
<script
|
||||
src="//unpkg.com/docsify"
|
||||
data-repo="QingWei-Li/docsify"
|
||||
data-max-level="3"
|
||||
data-coverpage>
|
||||
</script>
|
||||
```
|
||||
|
||||
两种方式可以共存,推荐第一种做法——直接配置 `window.$docsify` 对象——这会让你的配置更加清晰,同时也可以方便的将配置单独写到另一个文件里。
|
||||
|
||||
!> 通过 `window.$docsify` 配置属性,需要将属性改成驼峰命名法。通过 `data-*` 属性配置,保持短横线的命名规则。
|
||||
|
||||
|
||||
## el
|
||||
|
||||
- 类型:`String`
|
||||
- 默认值:`#app`
|
||||
* 类型:`String`
|
||||
* 默认值:`#app`
|
||||
|
||||
docsify 初始化的挂载元素,可以是一个 CSS 选择器,默认为 `#app` 如果不存在就直接绑定在 `body` 上。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
el: '#app'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## repo
|
||||
|
||||
- 类型:`String`
|
||||
- 默认值: `null`
|
||||
* 类型:`String`
|
||||
* 默认值: `null`
|
||||
|
||||
配置仓库地址或者 `username/repo` 的字符串,会在页面右上角渲染一个 [GitHub Corner](http://tholman.com/github-corners/) 挂件。
|
||||
|
||||
@@ -51,28 +37,39 @@ window.$docsify = {
|
||||
repo: 'QingWei-Li/docsify',
|
||||
// or
|
||||
repo: 'https://github.com/QingWei-Li/docsify/'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
## max-level
|
||||
|
||||
- 类型:`Number`
|
||||
- 默认值: `6`
|
||||
* 类型:`Number`
|
||||
* 默认值: `6`
|
||||
|
||||
默认情况下会抓取文档中所有标题渲染成目录,可配置最大支持渲染的标题层级。
|
||||
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
maxLevel: 4
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## load-navbar
|
||||
## maxLevel
|
||||
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
* Type: `Number`
|
||||
* Default: `6`
|
||||
|
||||
Maximum Table of content level.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
maxLevel: 4
|
||||
};
|
||||
```
|
||||
|
||||
## loadNavbar
|
||||
|
||||
* 类型:`Boolean|String`
|
||||
* 默认值: `false`
|
||||
|
||||
加载自定义导航栏,参考[定制导航栏](zh-cn/custom-navbar.md) 了解用法。设置为 `true` 后会加载 `_navbar.md` 文件,也可以自定义加载的文件名。
|
||||
|
||||
@@ -83,13 +80,13 @@ window.$docsify = {
|
||||
|
||||
// 加载 nav.md
|
||||
loadNavbar: 'nav.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## load-sidebar
|
||||
## loadSidebar
|
||||
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
* 类型:`Boolean|String`
|
||||
* 默认值: `false`
|
||||
|
||||
加载自定义侧边栏,参考[多页文档](zh-cn/more-pages.md)。设置为 `true` 后会加载 `_sidebar.md` 文件,也可以自定义加载的文件名。
|
||||
|
||||
@@ -100,42 +97,39 @@ window.$docsify = {
|
||||
|
||||
// 加载 summary.md
|
||||
loadSidebar: 'summary.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## sub-max-level
|
||||
## subMaxLevel
|
||||
|
||||
- 类型:`Number`
|
||||
- 默认值: `0`
|
||||
* 类型:`Number`
|
||||
* 默认值: `0`
|
||||
|
||||
自定义侧边栏后默认不会再生成目录,你也可以通过设置生成目录的最大层级开启这个功能。
|
||||
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
subMaxLevel: 2
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
## auto2top
|
||||
|
||||
- 类型:`Boolean`
|
||||
- 默认值: `false`
|
||||
* 类型:`Boolean`
|
||||
* 默认值: `false`
|
||||
|
||||
切换页面后是否自动跳转到页面顶部。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
auto2top: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
## homepage
|
||||
|
||||
- 类型:`String`
|
||||
- 默认值: `README.md`
|
||||
* 类型:`String`
|
||||
* 默认值: `README.md`
|
||||
|
||||
设置首页文件加载路径。适合不想将 `README.md` 作为入口文件渲染,或者是文档存放在其他位置的情况使用。
|
||||
|
||||
@@ -145,13 +139,14 @@ window.$docsify = {
|
||||
homepage: 'home.md',
|
||||
|
||||
// 文档和仓库根目录下的 README.md 内容一致
|
||||
homepage: 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/README.md'
|
||||
}
|
||||
homepage:
|
||||
'https://raw.githubusercontent.com/QingWei-Li/docsify/master/README.md'
|
||||
};
|
||||
```
|
||||
|
||||
## base-path
|
||||
## basePath
|
||||
|
||||
- 类型:`String`
|
||||
* 类型:`String`
|
||||
|
||||
文档加载的根路径,可以是二级路径或者是其他域名的路径。
|
||||
|
||||
@@ -163,15 +158,15 @@ window.$docsify = {
|
||||
basePath: 'https://docsify.js.org/',
|
||||
|
||||
// 甚至直接渲染其他仓库 readme
|
||||
basePath: 'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
|
||||
}
|
||||
basePath:
|
||||
'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
## coverpage
|
||||
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
* 类型:`Boolean|String`
|
||||
* 默认值: `false`
|
||||
|
||||
启用[封面页](zh-cn/cover.md)。开启后是加载 `_coverpage.md` 文件,也可以自定义文件名。
|
||||
|
||||
@@ -180,27 +175,35 @@ window.$docsify = {
|
||||
coverpage: true,
|
||||
|
||||
// 自定义文件名
|
||||
coverpage: 'cover.md'
|
||||
}
|
||||
coverpage: 'cover.md',
|
||||
|
||||
// mutiple covers
|
||||
coverpage: ['/', '/zh-cn/'],
|
||||
|
||||
// mutiple covers and custom file name
|
||||
coverpage: {
|
||||
'/': 'cover.md',
|
||||
'/zh-cn/': 'cover.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## name
|
||||
|
||||
- 类型:`String`
|
||||
|
||||
* 类型:`String`
|
||||
|
||||
文档标题,会显示在侧边栏顶部。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
name: 'docsify'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## name-link
|
||||
## nameLink
|
||||
|
||||
- 类型:`String`
|
||||
- 默认值:`window.location.pathname`
|
||||
* 类型:`String`
|
||||
* 默认值:`window.location.pathname`
|
||||
|
||||
点击文档标题后跳转的链接地址。
|
||||
|
||||
@@ -213,12 +216,12 @@ window.$docsify = {
|
||||
'/zh-cn/': '/zh-cn/',
|
||||
'/': '/'
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## markdown
|
||||
|
||||
- 类型: `Object|Function`
|
||||
* 类型: `Object|Function`
|
||||
|
||||
参考 [Markdown 配置](zh-cn/markdown.md)。
|
||||
|
||||
@@ -235,44 +238,46 @@ window.$docsify = {
|
||||
},
|
||||
|
||||
// function
|
||||
markdown: function (marked, renderer) {
|
||||
markdown: function(marked, renderer) {
|
||||
// ...
|
||||
return marked
|
||||
return marked;
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## theme-color
|
||||
## themeColor
|
||||
|
||||
- 类型:`String`
|
||||
* 类型:`String`
|
||||
|
||||
替换主题色。利用 [CSS3 支持变量](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables)的特性,对于老的浏览器有 polyfill 处理。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
themeColor: '#3F51B5'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## alias
|
||||
|
||||
- 类型:`Object`
|
||||
|
||||
定义路由别名,可以更自由的定义路由规则。
|
||||
* 类型:`Object`
|
||||
|
||||
定义路由别名,可以更自由的定义路由规则。 支持正则。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'/foo/(+*)': '/bar/$1', // supports regexp
|
||||
'/zh-cn/changelog': '/changelog',
|
||||
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
|
||||
'/changelog':
|
||||
'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
|
||||
'/.*/_sidebar.md': '/_sidebar.md' // See #301
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## auto-header
|
||||
## autoHeader
|
||||
|
||||
- 类型:`Boolean`
|
||||
* 类型:`Boolean`
|
||||
|
||||
同时设置 `loadSidebar` 和 `autoHeader` 后,可以根据 `_sidebar.md` 的内容自动为每个页面增加标题。[#78](https://github.com/QingWei-Li/docsify/issues/78)
|
||||
|
||||
@@ -280,19 +285,19 @@ window.$docsify = {
|
||||
window.$docsify = {
|
||||
loadSidebar: true,
|
||||
autoHeader: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## execute-script
|
||||
## executeScript
|
||||
|
||||
- 类型:`Boolean`
|
||||
* 类型:`Boolean`
|
||||
|
||||
执行文档里的 script 标签里的脚本,只执行第一个 script ([demo](zh-cn/themes.md))。 如果 Vue 存在,则自动开启。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
executeScript: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
```markdown
|
||||
@@ -301,28 +306,159 @@ window.$docsify = {
|
||||
<script>
|
||||
console.log(2333)
|
||||
</script>
|
||||
|
||||
```
|
||||
|
||||
注意如果执行的是一个外链脚本,比如 jsfiddle 的内嵌 demo,请确保引入 [external-script](plugins.md?id=外链脚本-external-script) 插件。
|
||||
|
||||
## no-emoji
|
||||
## noEmoji
|
||||
|
||||
* type: `Boolean`
|
||||
|
||||
禁用 emoji 解析。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
noEmoji: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## merge-navbar
|
||||
## mergeNavbar
|
||||
|
||||
* type: `Boolean`
|
||||
|
||||
小屏设备下合并导航栏到侧边栏。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
mergeNavbar: true
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## formatUpdated
|
||||
|
||||
* type: `String|Function`
|
||||
|
||||
我们可以显示文档更新日期通过 **{docsify-updated<span>}</span>** 变量. 并且格式化日期通过 `formatUpdated`。参考 https://github.com/lukeed/tinydate#patterns
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
|
||||
formatUpdated: function(time) {
|
||||
// ...
|
||||
|
||||
return time;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## externalLinkTarget
|
||||
|
||||
* type: `String`
|
||||
* default: `_blank`
|
||||
|
||||
当前默认为 \_blank, 配置一下就可以:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
externalLinkTarget: '_self' // default: '_blank'
|
||||
};
|
||||
```
|
||||
|
||||
## routerMode
|
||||
|
||||
* type: `String`
|
||||
* default: `history`
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
routerMode: 'history' // default: 'hash'
|
||||
};
|
||||
```
|
||||
|
||||
## noCompileLinks
|
||||
|
||||
* 类型: `Array`
|
||||
|
||||
有时我们不希望 docsify 处理我们的链接。 参考 [#203](https://github.com/QingWei-Li/docsify/issues/203)
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
noCompileLinks: ['/foo', '/bar/.*']
|
||||
};
|
||||
```
|
||||
|
||||
## requestHeaders
|
||||
|
||||
* type: `Object`
|
||||
|
||||
设置请求资源的请求头。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
requestHeaders: {
|
||||
'x-token': 'xxx'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## ext
|
||||
|
||||
* type: `String`
|
||||
|
||||
资源的文件扩展名。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
ext: '.md'
|
||||
};
|
||||
```
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
|
||||
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
|
||||
|
||||
Example:
|
||||
|
||||
* try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
|
||||
* then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
|
||||
* then display 404 page.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
fallbackLanguages: ['fr', 'de']
|
||||
};
|
||||
```
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
|
||||
+50
-9
@@ -6,7 +6,7 @@
|
||||
|
||||
封面的生成同样是从 markdown 文件渲染来的。开启渲染封面功能后在文档根目录创建 `_coverpage.md` 文件。渲染效果如本文档。
|
||||
|
||||
*index.html*
|
||||
_index.html_
|
||||
|
||||
```html
|
||||
<script>
|
||||
@@ -17,7 +17,7 @@
|
||||
<script src="//unpkg.com/docsify"></script>
|
||||
```
|
||||
|
||||
*_coverpage.md*
|
||||
_\_coverpage.md_
|
||||
|
||||
```markdown
|
||||

|
||||
@@ -26,24 +26,21 @@
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
- Simple and lightweight (~12kb gzipped)
|
||||
- Multiple themes
|
||||
- Not build static html files
|
||||
|
||||
* Simple and lightweight (~12kb gzipped)
|
||||
* Multiple themes
|
||||
* Not build static html files
|
||||
|
||||
[GitHub](https://github.com/QingWei-Li/docsify/)
|
||||
[Get Started](#quick-start)
|
||||
```
|
||||
|
||||
|
||||
|
||||
!> 一份文档只会在根目录下加载封面,其他页面或者二级目录下都不会加载。
|
||||
|
||||
## 自定义背景
|
||||
|
||||
目前的背景是随机生成的渐变色,我们自定义背景色或者背景图。在文档末尾用添加图片的 Markdown 语法设置背景。
|
||||
|
||||
*_coverpage.md*
|
||||
_\_coverpage.md_
|
||||
|
||||
```markdown
|
||||
# docsify
|
||||
@@ -52,7 +49,51 @@
|
||||
[Get Started](#quick-start)
|
||||
|
||||
<!-- 背景图片 -->
|
||||
|
||||

|
||||
|
||||
<!-- 背景色 -->
|
||||
|
||||

|
||||
```
|
||||
|
||||
## 封面作为首页
|
||||
|
||||
通常封面和首页是同时出现的,当然你也是当封面独立出来通过设置[onlyCover 选项](zh-cn/configuration.md#onlycover)。
|
||||
|
||||
## 多个封面
|
||||
|
||||
如果你的文档网站是多语言的,或许你需要设置多个封面。
|
||||
|
||||
例如你的文档目录结构如下
|
||||
|
||||
```text
|
||||
.
|
||||
└── docs
|
||||
├── README.md
|
||||
├── guide.md
|
||||
├── _coverpage.md
|
||||
└── zh-cn
|
||||
├── README.md
|
||||
└── guide.md
|
||||
└── _coverpage.md
|
||||
```
|
||||
|
||||
那么你可以这么配置
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
coverpage: ['/', '/zh-cn/']
|
||||
};
|
||||
```
|
||||
|
||||
或者具体指名文件名
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
coverpage: {
|
||||
'/': 'cover.md',
|
||||
'/zh-cn/': 'cover.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
+19
-22
@@ -2,7 +2,7 @@
|
||||
|
||||
我们可以直接在 HTML 里定义导航栏,要注意链接要以 `#/` 开头。
|
||||
|
||||
*index.html*
|
||||
_index.html_
|
||||
|
||||
```html
|
||||
<body>
|
||||
@@ -14,13 +14,11 @@
|
||||
</body>
|
||||
```
|
||||
|
||||
|
||||
## 配置文件
|
||||
|
||||
那我们可以通过 Markdown 文件来配置导航。首先配置 `loadNavbar`,默认加载的文件为 `_navbar.md`。具体配置规则见[配置项#load-navbar](configuration.md#load-navbar)。
|
||||
|
||||
*index.html*
|
||||
那我们可以通过 Markdown 文件来配置导航。首先配置 `loadNavbar`,默认加载的文件为 `_navbar.md`。具体配置规则见[配置项#loadNavbar](configuration.md#loadnavbar)。
|
||||
|
||||
_index.html_
|
||||
|
||||
```html
|
||||
<script>
|
||||
@@ -31,11 +29,11 @@
|
||||
<script src="//unpkg.com/docsify"></script>
|
||||
```
|
||||
|
||||
*_navbar.md*
|
||||
_\_navbar.md_
|
||||
|
||||
```markdown
|
||||
- [En](/)
|
||||
- [中文](/zh-cn/)
|
||||
* [En](/)
|
||||
* [中文](/zh-cn/)
|
||||
```
|
||||
|
||||
`_navbar.md` 加载逻辑和 `sidebar` 文件一致,从每层目录下获取。例如当前路由为 `/zh-cn/custom-navbar` 那么是从 `/zh-cn/_navbar.md` 获取导航栏。
|
||||
@@ -44,24 +42,23 @@
|
||||
|
||||
如果导航内容过多,可以写成嵌套的列表,会被渲染成下拉列表的形式。
|
||||
|
||||
*_navbar.md*
|
||||
|
||||
_\_navbar.md_
|
||||
|
||||
```markdown
|
||||
- 基础
|
||||
- [快速开始](zh-cn/quickstart.md)
|
||||
- [多页文档](zh-cn/more-pages.md)
|
||||
- [定制导航栏](zh-cn/custom-navbar.md)
|
||||
- [封面](zh-cn/cover.md)
|
||||
* 基础
|
||||
* [快速开始](zh-cn/quickstart.md)
|
||||
* [多页文档](zh-cn/more-pages.md)
|
||||
* [定制导航栏](zh-cn/custom-navbar.md)
|
||||
* [封面](zh-cn/cover.md)
|
||||
|
||||
- 配置
|
||||
- [配置项](zh-cn/configuration.md)
|
||||
- [主题](zh-cn/themes.md)
|
||||
- [使用插件](zh-cn/plugins.md)
|
||||
- [Markdown 配置](zh-cn/markdown.md)
|
||||
- [代码高亮](zh-cn/language-highlight.md)
|
||||
* 配置
|
||||
* [配置项](zh-cn/configuration.md)
|
||||
* [主题](zh-cn/themes.md)
|
||||
* [使用插件](zh-cn/plugins.md)
|
||||
* [Markdown 配置](zh-cn/markdown.md)
|
||||
* [代码高亮](zh-cn/language-highlight.md)
|
||||
```
|
||||
|
||||
效果图
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -15,6 +15,30 @@ GitHub Pages 支持从三个地方读取文件
|
||||
|
||||
!> 可以将文档放在根目录下,然后选择 **master 分支** 作为文档目录。
|
||||
|
||||
|
||||
## GitLab Pages
|
||||
|
||||
如果你正在部署你的主分支, 在 `.gitlab-ci.yml` 中包含以下脚本:
|
||||
|
||||
?> `.public` 的解决方法是这样的,`cp` 不会无限循环的将 `public/` 复制到自身。
|
||||
|
||||
``` YAML
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
- mkdir .public
|
||||
- cp -r * .public
|
||||
- mv .public public
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
```
|
||||
|
||||
!> 你可以用 `- cp -r docs/. public` 替换脚本, 如果 `./docs` 是你的 docsify 子文件夹。
|
||||
|
||||
|
||||
## VPS
|
||||
|
||||
和部署所有静态网站一样,只需将服务器的访问根目录设定为 `index.html` 文件。
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# 文件嵌入
|
||||
|
||||
docsify 4.6 开始支持嵌入任何类型的文件到文档里。你可以将文件当成 `iframe`、`video`、`audio` 或者 `code block`,如果是 Markdown 文件,甚至可以直接插入到当前文档里。
|
||||
|
||||
这是一个嵌入 Markdown 文件的例子。
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include')
|
||||
```
|
||||
|
||||
`example.md` 文件的内容将会直接显示在这里
|
||||
|
||||
[filename](_media/example.md ':include')
|
||||
|
||||
你可以查看 [example.md](_media/example.md ':ignore') 原始内容对比效果。
|
||||
|
||||
通常情况下,这样的语法将会被当作链接处理。但是在 docsify 里,如果你添加一个 `:include` 选项,它就会被当作文件嵌入。
|
||||
|
||||
## 嵌入的类型
|
||||
|
||||
当前,嵌入的类型是通过文件后缀自动识别的,这是目前支持的类型:
|
||||
|
||||
* **iframe** `.html`, `.htm`
|
||||
* **markdown** `.markdown`, `.md`
|
||||
* **audio** `.mp3`
|
||||
* **video** `.mp4`, `.ogg`
|
||||
* **code** other file extension
|
||||
|
||||
当然,你也可以强制设置嵌入类型。例如你想将 Markdown 文件当作一个 `code block` 嵌入。
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
```
|
||||
|
||||
你将得到
|
||||
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
|
||||
## 标签属性
|
||||
|
||||
如果你嵌入文件是一个 `iframe`、`audio` 或者 `video`,你可以给这些标签设置属性。
|
||||
|
||||
```markdown
|
||||
[cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px')
|
||||
```
|
||||
|
||||
[cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px')
|
||||
|
||||
看见没?你只需要直接写属性就好了,每个标签有哪些属性建议你查看 [MDN 文档](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)。
|
||||
|
||||
## 代码块高亮
|
||||
|
||||
如果是嵌入一个代码块,你可以设置高亮的语言,或者让它自动识别。这里是手动设置高亮语言
|
||||
|
||||
```markdown
|
||||
[](_media/example.html ':include :type=code text')
|
||||
```
|
||||
|
||||
⬇️
|
||||
|
||||
[](_media/example.html ':include :type=code text')
|
||||
|
||||
?> 如何高亮代码?你可以查看[这份文档](language-highlight.md).
|
||||
+50
-4
@@ -2,7 +2,6 @@
|
||||
|
||||
docsify 扩展了一些 Markdown 语法,可以让文档更易读。
|
||||
|
||||
|
||||
## 强调内容
|
||||
|
||||
适合显示重要的提示信息,语法为 `!> 内容`。
|
||||
@@ -13,14 +12,61 @@ docsify 扩展了一些 Markdown 语法,可以让文档更易读。
|
||||
|
||||
!> 一段重要的内容,可以和其他 **Markdown** 语法混用。
|
||||
|
||||
|
||||
## 普通提示
|
||||
|
||||
普通的提示信息,比如写 TODO 或者参考内容等。
|
||||
|
||||
```markdown
|
||||
?> *TODO* 完善示例
|
||||
?> _TODO_ 完善示例
|
||||
```
|
||||
|
||||
?> *TODO* 完善示例
|
||||
?> _TODO_ 完善示例
|
||||
|
||||
## 忽略编译链接
|
||||
|
||||
有时候我们会把其他一些相对路径放到链接上,你必须告诉 docsify 你不需要编译这个链接。 例如:
|
||||
|
||||
```md
|
||||
[link](/demo/)
|
||||
```
|
||||
|
||||
它将被编译为 `<a href="/#/demo/">link</a>` 并将加载 `/demo/README.md`. 可能你想跳转到 `/demo/index.html`。
|
||||
|
||||
现在你可以做到这一点
|
||||
|
||||
```md
|
||||
[link](/demo/ ':ignore')
|
||||
```
|
||||
|
||||
即将会得到 `<a href="/demo/">link</a>` html 代码。不要担心,你仍然可以为链接设置标题。
|
||||
|
||||
```md
|
||||
[link](/demo/ ':ignore title')
|
||||
|
||||
<a href="/demo/" title="title">link</a>
|
||||
```
|
||||
|
||||
## 设置链接的 target 属性
|
||||
|
||||
```md
|
||||
[link](/demo ':target=_blank')
|
||||
[link](/demo2 ':target=_self')
|
||||
```
|
||||
|
||||
## Github 任务列表
|
||||
|
||||
```md
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
```
|
||||
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
<script src="//unpkg.com/prismjs/components/prism-php.js"></script>
|
||||
```
|
||||
|
||||
?> 其他的语言高亮插件可以查看[Prims 仓库](https://github.com/PrismJS/prism/tree/gh-pages/components)。
|
||||
?> 其他的语言高亮插件可以查看[Prims 仓库](https://github.com/PrismJS/prism/tree/gh-pages/components)。
|
||||
|
||||
+27
-1
@@ -27,4 +27,30 @@ window.$docsify = {
|
||||
return marked
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
|
||||
## 支持 mermaid
|
||||
|
||||
```js
|
||||
// Import mermaid
|
||||
// <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.css">
|
||||
// <script src="//cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
|
||||
mermaid.initialize({ startOnLoad: false });
|
||||
|
||||
window.$docsify = {
|
||||
markdown: {
|
||||
renderer: {
|
||||
code: function(code, lang) {
|
||||
if (lang === "mermaid") {
|
||||
return (
|
||||
'<div class="mermaid">' + mermaid.render(lang, code) + "</div>"
|
||||
);
|
||||
}
|
||||
return this.origin.code.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
+24
-11
@@ -26,7 +26,7 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
|
||||
|
||||
默认情况下,侧边栏会根据当前文档的标题生成目录。也可以设置文档链接,通过 Markdown 文件生成,效果如当前的文档的侧边栏。
|
||||
|
||||
首先配置 `loadSidebar` 选项,具体配置规则见[配置项#load-sidebar](configuration.md#load-sidebar)。
|
||||
首先配置 `loadSidebar` 选项,具体配置规则见[配置项#loadSidebar](configuration.md#loadsidebar)。
|
||||
|
||||
```html
|
||||
<script>
|
||||
@@ -40,15 +40,27 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
|
||||
接着创建 `_sidebar.md` 文件,内容如下
|
||||
|
||||
```markdown
|
||||
- [首页](zh-cn/)
|
||||
- [指南](zh-cn/guide)
|
||||
* [首页](zh-cn/)
|
||||
* [指南](zh-cn/guide)
|
||||
```
|
||||
|
||||
!> 需要在文档根目录创建 `.nojekyll` 命名的空文件,阻止 GitHub Pages 忽略命名是下划线开头的文件。
|
||||
|
||||
|
||||
`_sidebar.md` 的加载逻辑是从每层目录下获取文件,如果当前目录不存在该文件则回退到上一级目录。例如当前路径为 `/zh-cn/more-pages` 则从 `/zh-cn/_sidebar.md` 获取文件,如果不存在则从 `/_sidebar.md` 获取。
|
||||
|
||||
当然你也可以配置 `alias` 避免不必要的回退过程。
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
loadSidebar: true,
|
||||
alias: {
|
||||
'/.*/_sidebar.md': '/_sidebar.md'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
## 显示目录
|
||||
|
||||
自定义侧边栏同时也可以开启目录功能。设置 `subMaxLevel` 配置项,具体介绍见 [配置项#sub-max-level](zh-cn/configuration#sub-max-level)。
|
||||
@@ -63,25 +75,26 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
|
||||
<script src="//unpkg.com/docsify"></script>
|
||||
```
|
||||
|
||||
## Ignoring Subheaders
|
||||
## 忽略副标题
|
||||
|
||||
When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it.
|
||||
当设置了 `subMaxLevel` 时,默认情况下每个标题都会自动添加到目录中。如果你想忽略特定的标题,可以给它添加 `{docsify-ignore}` 。
|
||||
|
||||
```markdown
|
||||
# Getting Started
|
||||
|
||||
## Header {docsify-ignore}
|
||||
This header won't appear in the sidebar table of contents.
|
||||
|
||||
该标题不会出现在侧边栏的目录中。
|
||||
```
|
||||
|
||||
To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
|
||||
要忽略特定页面上的所有标题,你可以在页面的第一个标题上使用 `{docsify-ignore-all}` 。
|
||||
|
||||
```markdown
|
||||
# Getting Started {docsify-ignore-all}
|
||||
|
||||
## Header
|
||||
This header won't appear in the sidebar table of contents.
|
||||
|
||||
该标题不会出现在侧边栏的目录中。
|
||||
```
|
||||
|
||||
Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used.
|
||||
|
||||
在使用时, `{docsify-ignore}` 和 `{docsify-ignore-all}` 都不会在页面上呈现。
|
||||
|
||||
+94
-2
@@ -35,7 +35,10 @@
|
||||
noData: {
|
||||
'/zh-cn/': '找不到结果',
|
||||
'/': 'No Results'
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索标题的最大程级, 1 - 6
|
||||
depth: 2
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -80,10 +83,99 @@
|
||||
<script src="//unpkg.com/docsify/lib/plugins/external-script.js"></script>
|
||||
```
|
||||
|
||||
## Demo code with instant preview and jsfiddle integration
|
||||
|
||||
With this plugin, sample code can be rendered on the page instantly, so that the readers can see the preview immediately.
|
||||
When readers expand the demo box, the source code and description are shown there. if they click the button `Try in Jsfiddle`,
|
||||
`jsfiddle.net` will be open with the code of this sample, which allow readers to revise the code and try on their own.
|
||||
|
||||
[Vue](https://njleonzhang.github.io/docsify-demo-box-vue/) and [React](https://njleonzhang.github.io/docsify-demo-box-react/) are both supported.
|
||||
|
||||
|
||||
## 图片缩放 - Zoom image
|
||||
|
||||
Medium's 风格的图片缩放插件. 基于 [zoom-image](https://github.com/egoist/zoom-image)。
|
||||
Medium's 风格的图片缩放插件. 基于 [medium-zoom](https://github.com/francoischalifour/medium-zoom)。
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.js"></script>
|
||||
```
|
||||
|
||||
|
||||
忽略某张图片
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
|
||||
|
||||
|
||||
## 在 Github 上编辑
|
||||
|
||||
在每一页上添加 `Edit on github` 按钮. 由第三方库提供, 查看 [document](https://github.com/njleonzhang/docsify-edit-on-github)
|
||||
|
||||
|
||||
## Copy to Clipboard
|
||||
|
||||
Add a simple `Click to copy` button to all preformatted code blocks to effortlessly allow users to copy example code from your docs. Provided by [@jperasmus](https://github.com/jperasmus)
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify-copy-code/styles.css">
|
||||
<script src="//unpkg.com/docsify-copy-code/index.js"></script>
|
||||
```
|
||||
|
||||
```javascript
|
||||
window.$docsify = {
|
||||
plugins: [
|
||||
window.DocsifyCopyCodePlugin.init()
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.
|
||||
|
||||
|
||||
|
||||
## Disqus
|
||||
|
||||
Disqus comments. https://disqus.com/
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
disqus: 'shortname'
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/disqus.min.js"></script>
|
||||
```
|
||||
|
||||
|
||||
## Gitalk
|
||||
|
||||
[Gitalk](https://github.com/gitalk/gitalk) is a modern comment component based on Github Issue and Preact.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//unpkg.com/gitalk/dist/gitalk.css">
|
||||
|
||||
<script src="//unpkg.com/docsify/lib/plugins/gitalk.min.js"></script>
|
||||
<script src="//unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
||||
<script>
|
||||
const gitalk = new Gitalk({
|
||||
clientID: 'Github Application Client ID',
|
||||
clientSecret: 'Github Application Client Secret',
|
||||
repo: 'Github repo',
|
||||
owner: 'Github repo owner',
|
||||
admin: ['Github repo collaborators, only these guys can initialize github issues'],
|
||||
// facebook-like distraction free mode
|
||||
distractionFreeMode: false
|
||||
})
|
||||
</script>
|
||||
```
|
||||
|
||||
## Navigation
|
||||
|
||||
Pagination for docsify. By [@imyelo](https://github.com/imyelo)
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
||||
```
|
||||
|
||||
@@ -44,13 +44,20 @@ docsify serve docs
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
//...
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
</body>
|
||||
<script src="//unpkg.com/docsify"></script>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
# 服务端渲染(SSR)
|
||||
|
||||
先看例子 https://docsify.now.sh
|
||||
|
||||
项目地址在 https://github.com/QingWei-Li/docsify-ssr-demo
|
||||
|
||||

|
||||
|
||||
文档依旧是部署在 GitHub Pages 上,Node 服务部署在 now.sh 里,渲染的内容是从 GitHub Pages 上同步过来的。所以静态部署文档的服务器和服务端渲染的 Node 服务器是分开的,也就是说你还是可以用之前的方式更新文档,并不需要每次都部署。
|
||||
|
||||
|
||||
|
||||
## 快速开始
|
||||
|
||||
如果你熟悉 `now` 的使用,接下来的介绍就很简单了。先创建一个新项目,并安装 `now` 和 `docsify-cli`。
|
||||
|
||||
```bash
|
||||
mkdir my-ssr-demo && cd my-ssr-demo
|
||||
npm init -y
|
||||
npm i now docsify-cli -D
|
||||
```
|
||||
|
||||
配置 `package.json`
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"start": "docsify start .",
|
||||
"deploy": "now -p"
|
||||
},
|
||||
"docsify": {
|
||||
"config": {
|
||||
"basePath": "https://docsify.js.org/",
|
||||
"loadSidebar": true,
|
||||
"loadNavbar": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
如果你还没有创建文档,可以参考[之前的文章](https://zhuanlan.zhihu.com/p/24540753)。其中 `basePath` 为文档所在的路径,可以填你的 docsify 文档网站。
|
||||
|
||||
配置可以单独写在配置文件内,然后通过 `--config config.js` 加载。
|
||||
|
||||
渲染的基础模版也可以自定义,配置在 `template` 属性上,例如
|
||||
|
||||
```js
|
||||
"docsify": {
|
||||
"template": "./ssr.html",
|
||||
"config": {
|
||||
"basePath": "https://docsify.js.org/",
|
||||
"loadSidebar": true,
|
||||
"loadNavbar": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*ssr.html*
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>docsify</title>
|
||||
<link rel="icon" href="_media/favicon.ico">
|
||||
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
|
||||
<meta name="description" content="A magical documentation generator.">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" title="vue">
|
||||
</head>
|
||||
<body>
|
||||
<!--inject-app-->
|
||||
<!--inject-config-->
|
||||
</body>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
||||
</html>
|
||||
|
||||
```
|
||||
|
||||
其中 `<!--inject-app-->` 和 `<!--inject-config-->` 为占位符,会自动将渲染后的 html 和配置内容注入到页面上。
|
||||
|
||||
现在,你可以运行 `npm start` 预览效果,如果没有问题就通过 `npm run deploy` 部署服务。
|
||||
|
||||
```bash
|
||||
npm start
|
||||
# open http://localhost:4000
|
||||
|
||||
npm run deploy
|
||||
# now ...
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 更多玩法
|
||||
|
||||
`docsify start` 其实是依赖了 [`docsify-server-renderer`](https://npmarket.surge.sh/?name=docsify-server-renderer) 模块,如果你感兴趣,你完全可以用它自己实现一个 server,可以加入缓存等功能。
|
||||
|
||||
```js
|
||||
var Renderer = require('docsify-server-renderer')
|
||||
var readFileSync = require('fs').readFileSync
|
||||
|
||||
// init
|
||||
var renderer = new Renderer({
|
||||
template: readFileSync('./docs/index.template.html', 'utf-8').,
|
||||
config: {
|
||||
name: 'docsify',
|
||||
repo: 'qingwei-li/docsify'
|
||||
}
|
||||
})
|
||||
|
||||
renderer.renderToString(url)
|
||||
.then(html => {})
|
||||
.catch(err => {})
|
||||
```
|
||||
|
||||
当然文档文件和 server 也是可以部署在一起的,`basePath` 不是一个 URL 的话就会当做文件路径处理,也就是从服务器上加载资源。
|
||||
@@ -46,6 +46,9 @@ window.$docsify = {
|
||||
|
||||
## 例子
|
||||
|
||||
|
||||
### footer
|
||||
|
||||
给每个页面的末尾加上 `footer`
|
||||
|
||||
```js
|
||||
@@ -66,4 +69,26 @@ window.$docsify = {
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Edit Button
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
plugins: [
|
||||
function(hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs' + vm.route.file
|
||||
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>docsify</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="stylesheet" href="/themes/vue.css" title="vue">
|
||||
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled>
|
||||
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled>
|
||||
<style>
|
||||
nav.app-nav li ul {
|
||||
min-width: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
|
||||
'/.*/_navbar.md': '/_navbar.md'
|
||||
},
|
||||
notFoundPage: '_404.html',
|
||||
auto2top: true,
|
||||
basePath: '/docs/',
|
||||
executeScript: true,
|
||||
loadNavbar: true,
|
||||
loadSidebar: true,
|
||||
coverpage: true,
|
||||
name: 'docsify',
|
||||
subMaxLevel: 2,
|
||||
mergeNavbar: true,
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
plugins: [
|
||||
function (hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/' + vm.route.file
|
||||
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<script src="/lib/docsify.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"lerna": "2.0.0-rc.5",
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"version": "0.0.0"
|
||||
}
|
||||
+1929
-872
File diff suppressed because it is too large
Load Diff
Vendored
+1
-2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,54 @@
|
||||
(function () {
|
||||
var fixedPath = location.href.replace('/-/', '/#/');
|
||||
if (fixedPath !== location.href) {
|
||||
location.href = fixedPath;
|
||||
}
|
||||
|
||||
function install(hook, vm) {
|
||||
var dom = Docsify.dom;
|
||||
var disqus = vm.config.disqus;
|
||||
if (!disqus) {
|
||||
throw Error('$docsify.disqus is required')
|
||||
}
|
||||
|
||||
hook.init(function (_) {
|
||||
var script = dom.create('script');
|
||||
|
||||
script.async = true;
|
||||
script.src = "https://" + disqus + ".disqus.com/embed.js";
|
||||
script.setAttribute('data-timestamp', Number(new Date()));
|
||||
dom.appendTo(dom.body, script);
|
||||
});
|
||||
|
||||
hook.mounted(function (_) {
|
||||
var div = dom.create('div');
|
||||
div.id = 'disqus_thread';
|
||||
var main = dom.getNode('#main');
|
||||
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
|
||||
dom.appendTo(dom.find('.content'), div);
|
||||
|
||||
// eslint-disable-next-line
|
||||
window.disqus_config = function() {
|
||||
this.page.url = location.origin + '/-' + vm.route.path;
|
||||
this.page.identifier = vm.route.path;
|
||||
this.page.title = document.title;
|
||||
};
|
||||
});
|
||||
|
||||
hook.doneEach(function (_) {
|
||||
if (typeof window.DISQUS !== 'undefined') {
|
||||
window.DISQUS.reset({
|
||||
reload: true,
|
||||
config: function () {
|
||||
this.page.url = location.origin + '/-' + vm.route.path;
|
||||
this.page.identifier = vm.route.path;
|
||||
this.page.title = document.title;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
||||
|
||||
}());
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
!function(){var i=location.href.replace("/-/","/#/");i!==location.href&&(location.href=i);$docsify.plugins=[].concat(function(i,t){var e=Docsify.dom,o=t.config.disqus;if(!o)throw Error("$docsify.disqus is required");i.init(function(i){var t=e.create("script");t.async=!0,t.src="https://"+o+".disqus.com/embed.js",t.setAttribute("data-timestamp",Number(new Date)),e.appendTo(e.body,t)}),i.mounted(function(i){var o=e.create("div");o.id="disqus_thread";var n=e.getNode("#main");o.style="width: "+n.clientWidth+"px; margin: 0 auto 20px;",e.appendTo(e.find(".content"),o),window.disqus_config=function(){this.page.url=location.origin+"/-"+t.route.path,this.page.identifier=t.route.path,this.page.title=document.title}}),i.doneEach(function(i){void 0!==window.DISQUS&&window.DISQUS.reset({reload:!0,config:function(){this.page.url=location.origin+"/-"+t.route.path,this.page.identifier=t.route.path,this.page.title=document.title}})})},$docsify.plugins)}();
|
||||
+896
-152
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,8 +1,5 @@
|
||||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function handleExternalScript () {
|
||||
function handleExternalScript() {
|
||||
var container = Docsify.dom.getNode('#main');
|
||||
var scripts = Docsify.dom.findAll(container, 'script');
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
this.D=this.D||{},function(){"use strict";function e(){for(var e=Docsify.dom.getNode("#main"),i=Docsify.dom.findAll(e,"script"),o=i.length;o--;){var t=i[o];if(t&&t.src){var n=document.createElement("script");Array.prototype.slice.call(t.attributes).forEach(function(e){n[e.name]=e.value}),t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)}}}var i=function(i){i.doneEach(e)};window.$docsify.plugins=[].concat(i,window.$docsify.plugins)}();
|
||||
!function(){function o(){for(var o=Docsify.dom.getNode("#main"),e=Docsify.dom.findAll(o,"script"),n=e.length;n--;){var i=e[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(o){t[o.name]=o.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}window.$docsify.plugins=[].concat(function(e){e.doneEach(o)},window.$docsify.plugins)}();
|
||||
|
||||
+328
-335
@@ -1,7 +1,4 @@
|
||||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Fork https://github.com/egoist/docute/blob/master/src/utils/yaml.js
|
||||
*/
|
||||
@@ -33,386 +30,381 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* @namespace
|
||||
*/
|
||||
|
||||
|
||||
var errors = [];
|
||||
var reference_blocks = [];
|
||||
var processing_time = 0;
|
||||
var regex$1 =
|
||||
{
|
||||
"regLevel" : new RegExp("^([\\s\\-]+)"),
|
||||
"invalidLine" : new RegExp("^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$"),
|
||||
"dashesString" : new RegExp("^\\s*\\\"([^\\\"]*)\\\"\\s*$"),
|
||||
"quotesString" : new RegExp("^\\s*\\\'([^\\\']*)\\\'\\s*$"),
|
||||
"float" : new RegExp("^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$"),
|
||||
"integer" : new RegExp("^[+-]?[0-9]+$"),
|
||||
"array" : new RegExp("\\[\\s*(.*)\\s*\\]"),
|
||||
"map" : new RegExp("\\{\\s*(.*)\\s*\\}"),
|
||||
"key_value" : new RegExp("([a-z0-9_-][ a-z0-9_-]*):( .+)", "i"),
|
||||
"single_key_value" : new RegExp("^([a-z0-9_-][ a-z0-9_-]*):( .+?)$", "i"),
|
||||
"key" : new RegExp("([a-z0-9_-][ a-z0-9_-]+):( .+)?", "i"),
|
||||
"item" : new RegExp("^-\\s+"),
|
||||
"trim" : new RegExp("^\\s+|\\s+$"),
|
||||
"comment" : new RegExp("([^\\\'\\\"#]+([\\\'\\\"][^\\\'\\\"]*[\\\'\\\"])*)*(#.*)?")
|
||||
};
|
||||
var regex$1 = {
|
||||
regLevel: new RegExp('^([\\s\\-]+)'),
|
||||
invalidLine: new RegExp('^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$'),
|
||||
dashesString: new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'),
|
||||
quotesString: new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"),
|
||||
float: new RegExp('^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$'),
|
||||
integer: new RegExp('^[+-]?[0-9]+$'),
|
||||
array: new RegExp('\\[\\s*(.*)\\s*\\]'),
|
||||
map: new RegExp('\\{\\s*(.*)\\s*\\}'),
|
||||
key_value: new RegExp('([a-z0-9_-][ a-z0-9_-]*):( .+)', 'i'),
|
||||
single_key_value: new RegExp('^([a-z0-9_-][ a-z0-9_-]*):( .+?)$', 'i'),
|
||||
key: new RegExp('([a-z0-9_-][ a-z0-9_-]+):( .+)?', 'i'),
|
||||
item: new RegExp('^-\\s+'),
|
||||
trim: new RegExp('^\\s+|\\s+$'),
|
||||
comment: new RegExp('([^\\\'\\"#]+([\\\'\\"][^\\\'\\"]*[\\\'\\"])*)*(#.*)?')
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* @class A block of lines of a given level.
|
||||
* @param {int} lvl The block's level.
|
||||
* @private
|
||||
*/
|
||||
function Block(lvl) {
|
||||
return {
|
||||
/* The block's parent */
|
||||
parent: null,
|
||||
/* Number of children */
|
||||
length: 0,
|
||||
/* Block's level */
|
||||
level: lvl,
|
||||
/* Lines of code to process */
|
||||
lines: [],
|
||||
/* Blocks with greater level */
|
||||
children : [],
|
||||
/* Add a block to the children collection */
|
||||
addChild : function(obj) {
|
||||
this.children.push(obj);
|
||||
obj.parent = this;
|
||||
++this.length;
|
||||
}
|
||||
};
|
||||
return {
|
||||
/* The block's parent */
|
||||
parent: null,
|
||||
/* Number of children */
|
||||
length: 0,
|
||||
/* Block's level */
|
||||
level: lvl,
|
||||
/* Lines of code to process */
|
||||
lines: [],
|
||||
/* Blocks with greater level */
|
||||
children: [],
|
||||
/* Add a block to the children collection */
|
||||
addChild: function(obj) {
|
||||
this.children.push(obj);
|
||||
obj.parent = this;
|
||||
++this.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parser$1(str) {
|
||||
var regLevel = regex$1["regLevel"];
|
||||
var invalidLine = regex$1["invalidLine"];
|
||||
var lines = str.split("\n");
|
||||
var m;
|
||||
var level = 0, curLevel = 0;
|
||||
var regLevel = regex$1['regLevel'];
|
||||
var invalidLine = regex$1['invalidLine'];
|
||||
var lines = str.split('\n');
|
||||
var m;
|
||||
var level = 0,
|
||||
curLevel = 0;
|
||||
|
||||
var blocks = [];
|
||||
var blocks = [];
|
||||
|
||||
var result = new Block(-1);
|
||||
var currentBlock = new Block(0);
|
||||
result.addChild(currentBlock);
|
||||
var levels = [];
|
||||
var line = "";
|
||||
var result = new Block(-1);
|
||||
var currentBlock = new Block(0);
|
||||
result.addChild(currentBlock);
|
||||
var levels = [];
|
||||
var line = '';
|
||||
|
||||
blocks.push(currentBlock);
|
||||
levels.push(level);
|
||||
blocks.push(currentBlock);
|
||||
levels.push(level);
|
||||
|
||||
for(var i = 0, len = lines.length; i < len; ++i) {
|
||||
line = lines[i];
|
||||
for (var i = 0, len = lines.length; i < len; ++i) {
|
||||
line = lines[i];
|
||||
|
||||
if(line.match(invalidLine)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(m = regLevel.exec(line)) {
|
||||
level = m[1].length;
|
||||
} else
|
||||
{ level = 0; }
|
||||
|
||||
if(level > curLevel) {
|
||||
var oldBlock = currentBlock;
|
||||
currentBlock = new Block(level);
|
||||
oldBlock.addChild(currentBlock);
|
||||
blocks.push(currentBlock);
|
||||
levels.push(level);
|
||||
} else if(level < curLevel) {
|
||||
var added = false;
|
||||
|
||||
var k = levels.length - 1;
|
||||
for(; k >= 0; --k) {
|
||||
if(levels[k] == level) {
|
||||
currentBlock = new Block(level);
|
||||
blocks.push(currentBlock);
|
||||
levels.push(level);
|
||||
if(blocks[k].parent!= null)
|
||||
{ blocks[k].parent.addChild(currentBlock); }
|
||||
added = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!added) {
|
||||
errors.push("Error: Invalid indentation at line " + i + ": " + line);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
currentBlock.lines.push(line.replace(regex$1["trim"], ""));
|
||||
curLevel = level;
|
||||
if (line.match(invalidLine)) {
|
||||
continue
|
||||
}
|
||||
|
||||
return result;
|
||||
if ((m = regLevel.exec(line))) {
|
||||
level = m[1].length;
|
||||
} else { level = 0; }
|
||||
|
||||
if (level > curLevel) {
|
||||
var oldBlock = currentBlock;
|
||||
currentBlock = new Block(level);
|
||||
oldBlock.addChild(currentBlock);
|
||||
blocks.push(currentBlock);
|
||||
levels.push(level);
|
||||
} else if (level < curLevel) {
|
||||
var added = false;
|
||||
|
||||
var k = levels.length - 1;
|
||||
for (; k >= 0; --k) {
|
||||
if (levels[k] == level) {
|
||||
currentBlock = new Block(level);
|
||||
blocks.push(currentBlock);
|
||||
levels.push(level);
|
||||
if (blocks[k].parent != null) { blocks[k].parent.addChild(currentBlock); }
|
||||
added = true;
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (!added) {
|
||||
errors.push('Error: Invalid indentation at line ' + i + ': ' + line);
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
currentBlock.lines.push(line.replace(regex$1['trim'], ''));
|
||||
curLevel = level;
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
function processValue(val) {
|
||||
val = val.replace(regex$1["trim"], "");
|
||||
var m = null;
|
||||
val = val.replace(regex$1['trim'], '');
|
||||
var m = null;
|
||||
|
||||
if(val == 'true') {
|
||||
return true;
|
||||
} else if(val == 'false') {
|
||||
return false;
|
||||
} else if(val == '.NaN') {
|
||||
return Number.NaN;
|
||||
} else if(val == 'null') {
|
||||
return null;
|
||||
} else if(val == '.inf') {
|
||||
return Number.POSITIVE_INFINITY;
|
||||
} else if(val == '-.inf') {
|
||||
return Number.NEGATIVE_INFINITY;
|
||||
} else if(m = val.match(regex$1["dashesString"])) {
|
||||
return m[1];
|
||||
} else if(m = val.match(regex$1["quotesString"])) {
|
||||
return m[1];
|
||||
} else if(m = val.match(regex$1["float"])) {
|
||||
return parseFloat(m[0]);
|
||||
} else if(m = val.match(regex$1["integer"])) {
|
||||
return parseInt(m[0]);
|
||||
} else if( !isNaN(m = Date.parse(val))) {
|
||||
return new Date(m);
|
||||
} else if(m = val.match(regex$1["single_key_value"])) {
|
||||
var res = {};
|
||||
res[m[1]] = processValue(m[2]);
|
||||
return res;
|
||||
} else if(m = val.match(regex$1["array"])){
|
||||
var count = 0, c = ' ';
|
||||
var res = [];
|
||||
var content = "";
|
||||
var str = false;
|
||||
for(var j = 0, lenJ = m[1].length; j < lenJ; ++j) {
|
||||
c = m[1][j];
|
||||
if(c == '\'' || c == '"') {
|
||||
if(str === false) {
|
||||
str = c;
|
||||
content += c;
|
||||
continue;
|
||||
} else if((c == '\'' && str == '\'') || (c == '"' && str == '"')) {
|
||||
str = false;
|
||||
content += c;
|
||||
continue;
|
||||
}
|
||||
} else if(str === false && (c == '[' || c == '{')) {
|
||||
++count;
|
||||
} else if(str === false && (c == ']' || c == '}')) {
|
||||
--count;
|
||||
} else if(str === false && count == 0 && c == ',') {
|
||||
res.push(processValue(content));
|
||||
content = "";
|
||||
continue;
|
||||
}
|
||||
|
||||
content += c;
|
||||
if (val == 'true') {
|
||||
return true
|
||||
} else if (val == 'false') {
|
||||
return false
|
||||
} else if (val == '.NaN') {
|
||||
return Number.NaN
|
||||
} else if (val == 'null') {
|
||||
return null
|
||||
} else if (val == '.inf') {
|
||||
return Number.POSITIVE_INFINITY
|
||||
} else if (val == '-.inf') {
|
||||
return Number.NEGATIVE_INFINITY
|
||||
} else if ((m = val.match(regex$1['dashesString']))) {
|
||||
return m[1]
|
||||
} else if ((m = val.match(regex$1['quotesString']))) {
|
||||
return m[1]
|
||||
} else if ((m = val.match(regex$1['float']))) {
|
||||
return parseFloat(m[0])
|
||||
} else if ((m = val.match(regex$1['integer']))) {
|
||||
return parseInt(m[0])
|
||||
} else if (!isNaN((m = Date.parse(val)))) {
|
||||
return new Date(m)
|
||||
} else if ((m = val.match(regex$1['single_key_value']))) {
|
||||
var res = {};
|
||||
res[m[1]] = processValue(m[2]);
|
||||
return res
|
||||
} else if ((m = val.match(regex$1['array']))) {
|
||||
var count = 0,
|
||||
c = ' ';
|
||||
var res = [];
|
||||
var content = '';
|
||||
var str = false;
|
||||
for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) {
|
||||
c = m[1][j];
|
||||
if (c == "'" || c == '"') {
|
||||
if (str === false) {
|
||||
str = c;
|
||||
content += c;
|
||||
continue
|
||||
} else if ((c == "'" && str == "'") || (c == '"' && str == '"')) {
|
||||
str = false;
|
||||
content += c;
|
||||
continue
|
||||
}
|
||||
} else if (str === false && (c == '[' || c == '{')) {
|
||||
++count;
|
||||
} else if (str === false && (c == ']' || c == '}')) {
|
||||
--count;
|
||||
} else if (str === false && count == 0 && c == ',') {
|
||||
res.push(processValue(content));
|
||||
content = '';
|
||||
continue
|
||||
}
|
||||
|
||||
if(content.length > 0)
|
||||
{ res.push(processValue(content)); }
|
||||
return res;
|
||||
} else if(m = val.match(regex$1["map"])){
|
||||
var count = 0, c = ' ';
|
||||
var res = [];
|
||||
var content = "";
|
||||
var str = false;
|
||||
for(var j = 0, lenJ = m[1].length; j < lenJ; ++j) {
|
||||
c = m[1][j];
|
||||
if(c == '\'' || c == '"') {
|
||||
if(str === false) {
|
||||
str = c;
|
||||
content += c;
|
||||
continue;
|
||||
} else if((c == '\'' && str == '\'') || (c == '"' && str == '"')) {
|
||||
str = false;
|
||||
content += c;
|
||||
continue;
|
||||
}
|
||||
} else if(str === false && (c == '[' || c == '{')) {
|
||||
++count;
|
||||
} else if(str === false && (c == ']' || c == '}')) {
|
||||
--count;
|
||||
} else if(str === false && count == 0 && c == ',') {
|
||||
res.push(content);
|
||||
content = "";
|
||||
continue;
|
||||
}
|
||||
content += c;
|
||||
}
|
||||
|
||||
content += c;
|
||||
if (content.length > 0) { res.push(processValue(content)); }
|
||||
return res
|
||||
} else if ((m = val.match(regex$1['map']))) {
|
||||
var count = 0,
|
||||
c = ' ';
|
||||
var res = [];
|
||||
var content = '';
|
||||
var str = false;
|
||||
for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) {
|
||||
c = m[1][j];
|
||||
if (c == "'" || c == '"') {
|
||||
if (str === false) {
|
||||
str = c;
|
||||
content += c;
|
||||
continue
|
||||
} else if ((c == "'" && str == "'") || (c == '"' && str == '"')) {
|
||||
str = false;
|
||||
content += c;
|
||||
continue
|
||||
}
|
||||
} else if (str === false && (c == '[' || c == '{')) {
|
||||
++count;
|
||||
} else if (str === false && (c == ']' || c == '}')) {
|
||||
--count;
|
||||
} else if (str === false && count == 0 && c == ',') {
|
||||
res.push(content);
|
||||
content = '';
|
||||
continue
|
||||
}
|
||||
|
||||
if(content.length > 0)
|
||||
{ res.push(content); }
|
||||
content += c;
|
||||
}
|
||||
|
||||
var newRes = {};
|
||||
for(var j = 0, lenJ = res.length; j < lenJ; ++j) {
|
||||
if(m = res[j].match(regex$1["key_value"])) {
|
||||
newRes[m[1]] = processValue(m[2]);
|
||||
}
|
||||
}
|
||||
if (content.length > 0) { res.push(content); }
|
||||
|
||||
return newRes;
|
||||
} else
|
||||
{ return val; }
|
||||
var newRes = {};
|
||||
for (var j = 0, lenJ = res.length; j < lenJ; ++j) {
|
||||
if ((m = res[j].match(regex$1['key_value']))) {
|
||||
newRes[m[1]] = processValue(m[2]);
|
||||
}
|
||||
}
|
||||
|
||||
return newRes
|
||||
} else { return val }
|
||||
}
|
||||
|
||||
function processFoldedBlock(block) {
|
||||
var lines = block.lines;
|
||||
var children = block.children;
|
||||
var str = lines.join(" ");
|
||||
var chunks = [str];
|
||||
for(var i = 0, len = children.length; i < len; ++i) {
|
||||
chunks.push(processFoldedBlock(children[i]));
|
||||
}
|
||||
return chunks.join("\n");
|
||||
var lines = block.lines;
|
||||
var children = block.children;
|
||||
var str = lines.join(' ');
|
||||
var chunks = [str];
|
||||
for (var i = 0, len = children.length; i < len; ++i) {
|
||||
chunks.push(processFoldedBlock(children[i]));
|
||||
}
|
||||
return chunks.join('\n')
|
||||
}
|
||||
|
||||
function processLiteralBlock(block) {
|
||||
var lines = block.lines;
|
||||
var children = block.children;
|
||||
var str = lines.join("\n");
|
||||
for(var i = 0, len = children.length; i < len; ++i) {
|
||||
str += processLiteralBlock(children[i]);
|
||||
}
|
||||
return str;
|
||||
var lines = block.lines;
|
||||
var children = block.children;
|
||||
var str = lines.join('\n');
|
||||
for (var i = 0, len = children.length; i < len; ++i) {
|
||||
str += processLiteralBlock(children[i]);
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
function processBlock(blocks) {
|
||||
var m = null;
|
||||
var res = {};
|
||||
var lines = null;
|
||||
var children = null;
|
||||
var currentObj = null;
|
||||
var m = null;
|
||||
var res = {};
|
||||
var lines = null;
|
||||
var children = null;
|
||||
var currentObj = null;
|
||||
|
||||
var level = -1;
|
||||
var level = -1;
|
||||
|
||||
var processedBlocks = [];
|
||||
var processedBlocks = [];
|
||||
|
||||
var isMap = true;
|
||||
var isMap = true;
|
||||
|
||||
for(var j = 0, lenJ = blocks.length; j < lenJ; ++j) {
|
||||
for (var j = 0, lenJ = blocks.length; j < lenJ; ++j) {
|
||||
if (level != -1 && level != blocks[j].level) { continue }
|
||||
|
||||
if(level != -1 && level != blocks[j].level)
|
||||
{ continue; }
|
||||
processedBlocks.push(j);
|
||||
|
||||
processedBlocks.push(j);
|
||||
level = blocks[j].level;
|
||||
lines = blocks[j].lines;
|
||||
children = blocks[j].children;
|
||||
currentObj = null;
|
||||
|
||||
level = blocks[j].level;
|
||||
lines = blocks[j].lines;
|
||||
children = blocks[j].children;
|
||||
currentObj = null;
|
||||
for (var i = 0, len = lines.length; i < len; ++i) {
|
||||
var line = lines[i];
|
||||
|
||||
for(var i = 0, len = lines.length; i < len; ++i) {
|
||||
var line = lines[i];
|
||||
if ((m = line.match(regex$1['key']))) {
|
||||
var key = m[1];
|
||||
|
||||
if(m = line.match(regex$1["key"])) {
|
||||
var key = m[1];
|
||||
|
||||
if(key[0] == '-') {
|
||||
key = key.replace(regex$1["item"], "");
|
||||
if (isMap) {
|
||||
isMap = false;
|
||||
if (typeof(res.length) === "undefined") {
|
||||
res = [];
|
||||
}
|
||||
}
|
||||
if(currentObj != null) { res.push(currentObj); }
|
||||
currentObj = {};
|
||||
isMap = true;
|
||||
}
|
||||
|
||||
if(typeof m[2] != "undefined") {
|
||||
var value = m[2].replace(regex$1["trim"], "");
|
||||
if(value[0] == '&') {
|
||||
var nb = processBlock(children);
|
||||
if(currentObj != null) { currentObj[key] = nb; }
|
||||
else { res[key] = nb; }
|
||||
reference_blocks[value.substr(1)] = nb;
|
||||
} else if(value[0] == '|') {
|
||||
if(currentObj != null) { currentObj[key] = processLiteralBlock(children.shift()); }
|
||||
else { res[key] = processLiteralBlock(children.shift()); }
|
||||
} else if(value[0] == '*') {
|
||||
var v = value.substr(1);
|
||||
var no = {};
|
||||
|
||||
if(typeof reference_blocks[v] == "undefined") {
|
||||
errors.push("Reference '" + v + "' not found!");
|
||||
} else {
|
||||
for(var k in reference_blocks[v]) {
|
||||
no[k] = reference_blocks[v][k];
|
||||
}
|
||||
|
||||
if(currentObj != null) { currentObj[key] = no; }
|
||||
else { res[key] = no; }
|
||||
}
|
||||
} else if(value[0] == '>') {
|
||||
if(currentObj != null) { currentObj[key] = processFoldedBlock(children.shift()); }
|
||||
else { res[key] = processFoldedBlock(children.shift()); }
|
||||
} else {
|
||||
if(currentObj != null) { currentObj[key] = processValue(value); }
|
||||
else { res[key] = processValue(value); }
|
||||
}
|
||||
} else {
|
||||
if(currentObj != null) { currentObj[key] = processBlock(children); }
|
||||
else { res[key] = processBlock(children); }
|
||||
}
|
||||
} else if(line.match(/^-\s*$/)) {
|
||||
if (isMap) {
|
||||
isMap = false;
|
||||
if (typeof(res.length) === "undefined") {
|
||||
res = [];
|
||||
}
|
||||
}
|
||||
if(currentObj != null) { res.push(currentObj); }
|
||||
currentObj = {};
|
||||
isMap = true;
|
||||
continue;
|
||||
} else if(m = line.match(/^-\s*(.*)/)) {
|
||||
if(currentObj != null)
|
||||
{ currentObj.push(processValue(m[1])); }
|
||||
else {
|
||||
if (isMap) {
|
||||
isMap = false;
|
||||
if (typeof(res.length) === "undefined") {
|
||||
res = [];
|
||||
}
|
||||
}
|
||||
res.push(processValue(m[1]));
|
||||
}
|
||||
continue;
|
||||
if (key[0] == '-') {
|
||||
key = key.replace(regex$1['item'], '');
|
||||
if (isMap) {
|
||||
isMap = false;
|
||||
if (typeof res.length === 'undefined') {
|
||||
res = [];
|
||||
}
|
||||
}
|
||||
if (currentObj != null) { res.push(currentObj); }
|
||||
currentObj = {};
|
||||
isMap = true;
|
||||
}
|
||||
|
||||
if(currentObj != null) {
|
||||
if (isMap) {
|
||||
isMap = false;
|
||||
if (typeof(res.length) === "undefined") {
|
||||
res = [];
|
||||
}
|
||||
if (typeof m[2] != 'undefined') {
|
||||
var value = m[2].replace(regex$1['trim'], '');
|
||||
if (value[0] == '&') {
|
||||
var nb = processBlock(children);
|
||||
if (currentObj != null) { currentObj[key] = nb; }
|
||||
else { res[key] = nb; }
|
||||
reference_blocks[value.substr(1)] = nb;
|
||||
} else if (value[0] == '|') {
|
||||
if (currentObj != null)
|
||||
{ currentObj[key] = processLiteralBlock(children.shift()); }
|
||||
else { res[key] = processLiteralBlock(children.shift()); }
|
||||
} else if (value[0] == '*') {
|
||||
var v = value.substr(1);
|
||||
var no = {};
|
||||
|
||||
if (typeof reference_blocks[v] == 'undefined') {
|
||||
errors.push("Reference '" + v + "' not found!");
|
||||
} else {
|
||||
for (var k in reference_blocks[v]) {
|
||||
no[k] = reference_blocks[v][k];
|
||||
}
|
||||
|
||||
if (currentObj != null) { currentObj[key] = no; }
|
||||
else { res[key] = no; }
|
||||
}
|
||||
res.push(currentObj);
|
||||
} else if (value[0] == '>') {
|
||||
if (currentObj != null)
|
||||
{ currentObj[key] = processFoldedBlock(children.shift()); }
|
||||
else { res[key] = processFoldedBlock(children.shift()); }
|
||||
} else {
|
||||
if (currentObj != null) { currentObj[key] = processValue(value); }
|
||||
else { res[key] = processValue(value); }
|
||||
}
|
||||
} else {
|
||||
if (currentObj != null) { currentObj[key] = processBlock(children); }
|
||||
else { res[key] = processBlock(children); }
|
||||
}
|
||||
} else if (line.match(/^-\s*$/)) {
|
||||
if (isMap) {
|
||||
isMap = false;
|
||||
if (typeof res.length === 'undefined') {
|
||||
res = [];
|
||||
}
|
||||
}
|
||||
if (currentObj != null) { res.push(currentObj); }
|
||||
currentObj = {};
|
||||
isMap = true;
|
||||
continue
|
||||
} else if ((m = line.match(/^-\s*(.*)/))) {
|
||||
if (currentObj != null) { currentObj.push(processValue(m[1])); }
|
||||
else {
|
||||
if (isMap) {
|
||||
isMap = false;
|
||||
if (typeof res.length === 'undefined') {
|
||||
res = [];
|
||||
}
|
||||
}
|
||||
res.push(processValue(m[1]));
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
for(var j = processedBlocks.length - 1; j >= 0; --j) {
|
||||
blocks.splice.call(blocks, processedBlocks[j], 1);
|
||||
if (currentObj != null) {
|
||||
if (isMap) {
|
||||
isMap = false;
|
||||
if (typeof res.length === 'undefined') {
|
||||
res = [];
|
||||
}
|
||||
}
|
||||
res.push(currentObj);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
for (var j = processedBlocks.length - 1; j >= 0; --j) {
|
||||
blocks.splice.call(blocks, processedBlocks[j], 1);
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
function semanticAnalysis(blocks) {
|
||||
var res = processBlock(blocks.children);
|
||||
return res;
|
||||
var res = processBlock(blocks.children);
|
||||
return res
|
||||
}
|
||||
|
||||
function preProcess(src) {
|
||||
var m;
|
||||
var lines = src.split("\n");
|
||||
var m;
|
||||
var lines = src.split('\n');
|
||||
|
||||
var r = regex$1["comment"];
|
||||
var r = regex$1['comment'];
|
||||
|
||||
for(var i in lines) {
|
||||
if(m = lines[i].match(r)) {
|
||||
/* var cmt = "";
|
||||
for (var i in lines) {
|
||||
if ((m = lines[i].match(r))) {
|
||||
/* var cmt = "";
|
||||
if(typeof m[3] != "undefined")
|
||||
lines[i] = m[1];
|
||||
else if(typeof m[3] != "undefined")
|
||||
@@ -420,25 +412,25 @@ function preProcess(src) {
|
||||
else
|
||||
lines[i] = "";
|
||||
*/
|
||||
if(typeof m[3] !== "undefined") {
|
||||
lines[i] = m[0].substr(0, m[0].length - m[3].length);
|
||||
}
|
||||
}
|
||||
if (typeof m[3] !== 'undefined') {
|
||||
lines[i] = m[0].substr(0, m[0].length - m[3].length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lines.join("\n");
|
||||
return lines.join('\n')
|
||||
}
|
||||
|
||||
function load(str) {
|
||||
errors = [];
|
||||
reference_blocks = [];
|
||||
processing_time = (new Date()).getTime();
|
||||
var pre = preProcess(str);
|
||||
var doc = parser$1(pre);
|
||||
var res = semanticAnalysis(doc);
|
||||
processing_time = (new Date()).getTime() - processing_time;
|
||||
errors = [];
|
||||
reference_blocks = [];
|
||||
processing_time = new Date().getTime();
|
||||
var pre = preProcess(str);
|
||||
var doc = parser$1(pre);
|
||||
var res = semanticAnalysis(doc);
|
||||
processing_time = new Date().getTime() - processing_time;
|
||||
|
||||
return res;
|
||||
return res
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -446,7 +438,8 @@ function load(str) {
|
||||
*/
|
||||
/* eslint-disable */
|
||||
var optionalByteOrderMark = '\\ufeff?';
|
||||
var pattern = '^(' +
|
||||
var pattern =
|
||||
'^(' +
|
||||
optionalByteOrderMark +
|
||||
'(= yaml =|---)' +
|
||||
'$([\\s\\S]*?)' +
|
||||
@@ -458,7 +451,7 @@ var pattern = '^(' +
|
||||
// need to be moved down into the functions that use it.
|
||||
var regex = new RegExp(pattern, 'm');
|
||||
|
||||
function extractor (string) {
|
||||
function extractor(string) {
|
||||
string = string || '';
|
||||
|
||||
var lines = string.split(/(\r?\n)/);
|
||||
@@ -469,7 +462,7 @@ function extractor (string) {
|
||||
}
|
||||
}
|
||||
|
||||
function parse (string) {
|
||||
function parse(string) {
|
||||
var match = regex.exec(string);
|
||||
|
||||
if (!match) {
|
||||
@@ -498,6 +491,6 @@ var install = function (hook, vm) {
|
||||
});
|
||||
};
|
||||
|
||||
window.$docsify.plugins = [].concat(install, window.$docsify.plugins);
|
||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
||||
|
||||
}());
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+15
-15
@@ -1,34 +1,34 @@
|
||||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// From https://github.com/egoist/vue-ga/blob/master/src/index.js
|
||||
function appendScript () {
|
||||
function appendScript() {
|
||||
var script = document.createElement('script');
|
||||
script.async = true;
|
||||
script.src = 'https://www.google-analytics.com/analytics.js';
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
function init (id) {
|
||||
if (!window.ga) {
|
||||
appendScript();
|
||||
window.ga = window.ga || function () {
|
||||
function init(id) {
|
||||
appendScript();
|
||||
window.ga =
|
||||
window.ga ||
|
||||
function () {
|
||||
(window.ga.q = window.ga.q || []).push(arguments);
|
||||
};
|
||||
window.ga.l = Number(new Date());
|
||||
window.ga('create', id, 'auto');
|
||||
}
|
||||
window.ga.l = Number(new Date());
|
||||
window.ga('create', id, 'auto');
|
||||
}
|
||||
|
||||
function collect () {
|
||||
init(window.$docsify.ga);
|
||||
function collect() {
|
||||
if (!window.ga) {
|
||||
init($docsify.ga);
|
||||
}
|
||||
|
||||
window.ga('set', 'page', location.hash);
|
||||
window.ga('send', 'pageview');
|
||||
}
|
||||
|
||||
var install = function (hook) {
|
||||
if (!window.$docsify.ga) {
|
||||
if (!$docsify.ga) {
|
||||
console.error('[Docsify] ga is required.');
|
||||
return
|
||||
}
|
||||
@@ -36,6 +36,6 @@ var install = function (hook) {
|
||||
hook.beforeEach(collect);
|
||||
};
|
||||
|
||||
window.$docsify.plugins = [].concat(install, window.$docsify.plugins);
|
||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
||||
|
||||
}());
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
this.D=this.D||{},function(){"use strict";function n(){var n=document.createElement("script");n.async=!0,n.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(n)}function o(o){window.ga||(n(),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",o,"auto"))}function i(){o(window.$docsify.ga),window.ga("set","page",location.hash),window.ga("send","pageview")}var w=function(n){return window.$docsify.ga?void n.beforeEach(i):void console.error("[Docsify] ga is required.")};window.$docsify.plugins=[].concat(w,window.$docsify.plugins)}();
|
||||
!function(){function n(n){!function(){var n=document.createElement("script");n.async=!0,n.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(n)}(),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",n,"auto")}function o(){window.ga||n($docsify.ga),window.ga("set","page",location.hash),window.ga("send","pageview")}$docsify.plugins=[].concat(function(n){$docsify.ga?n.beforeEach(o):console.error("[Docsify] ga is required.")},$docsify.plugins)}();
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
(function () {
|
||||
function install(hook) {
|
||||
var dom = Docsify.dom;
|
||||
|
||||
hook.mounted(function (_) {
|
||||
var div = dom.create('div');
|
||||
div.id = 'gitalk-container';
|
||||
var main = dom.getNode('#main');
|
||||
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
|
||||
dom.appendTo(dom.find('.content'), div);
|
||||
var script = dom.create('script');
|
||||
var content = "gitalk.render('gitalk-container')";
|
||||
script.textContent = content;
|
||||
dom.appendTo(dom.body, script);
|
||||
});
|
||||
}
|
||||
|
||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
||||
|
||||
}());
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
!function(){$docsify.plugins=[].concat(function(n){var t=Docsify.dom;n.mounted(function(n){var i=t.create("div");i.id="gitalk-container";var e=t.getNode("#main");i.style="width: "+e.clientWidth+"px; margin: 0 auto 20px;",t.appendTo(t.find(".content"),i);var o=t.create("script");o.textContent="gitalk.render('gitalk-container')",t.appendTo(t.body,o)})},$docsify.plugins)}();
|
||||
+127
-88
@@ -1,11 +1,8 @@
|
||||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var INDEXS = {};
|
||||
var helper;
|
||||
|
||||
function escapeHtml (string) {
|
||||
function escapeHtml(string) {
|
||||
var entityMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
@@ -15,56 +12,56 @@ function escapeHtml (string) {
|
||||
'/': '/'
|
||||
};
|
||||
|
||||
return String(string).replace(/[&<>"'\/]/g, function (s) { return entityMap[s]; })
|
||||
return String(string).replace(/[&<>"'/]/g, function (s) { return entityMap[s]; })
|
||||
}
|
||||
|
||||
function getAllPaths () {
|
||||
function getAllPaths(router) {
|
||||
var paths = [];
|
||||
|
||||
helper.dom.findAll('a:not([data-nosearch])')
|
||||
.map(function (node) {
|
||||
var href = node.href;
|
||||
var originHref = node.getAttribute('href');
|
||||
var path = helper.route.parse(href).path;
|
||||
helper.dom.findAll('a:not([data-nosearch])').forEach(function (node) {
|
||||
var href = node.href;
|
||||
var originHref = node.getAttribute('href');
|
||||
var path = router.parse(href).path;
|
||||
|
||||
if (path &&
|
||||
paths.indexOf(path) === -1 &&
|
||||
!helper.route.isAbsolutePath(originHref)) {
|
||||
paths.push(path);
|
||||
}
|
||||
});
|
||||
if (
|
||||
path &&
|
||||
paths.indexOf(path) === -1 &&
|
||||
!Docsify.util.isAbsolutePath(originHref)
|
||||
) {
|
||||
paths.push(path);
|
||||
}
|
||||
});
|
||||
|
||||
return paths
|
||||
}
|
||||
|
||||
function saveData (maxAge) {
|
||||
function saveData(maxAge) {
|
||||
localStorage.setItem('docsify.search.expires', Date.now() + maxAge);
|
||||
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS));
|
||||
}
|
||||
|
||||
function genIndex (path, content) {
|
||||
function genIndex(path, content, router, depth) {
|
||||
if ( content === void 0 ) content = '';
|
||||
|
||||
var tokens = window.marked.lexer(content);
|
||||
var slugify = window.Docsify.slugify;
|
||||
var toURL = Docsify.route.toURL;
|
||||
var index = {};
|
||||
var slug;
|
||||
|
||||
tokens.forEach(function (token) {
|
||||
if (token.type === 'heading' && token.depth <= 2) {
|
||||
slug = toURL(path, { id: slugify(token.text) });
|
||||
index[slug] = { slug: slug, title: token.text, body: '' };
|
||||
if (token.type === 'heading' && token.depth <= depth) {
|
||||
slug = router.toURL(path, {id: slugify(token.text)});
|
||||
index[slug] = {slug: slug, title: token.text, body: ''};
|
||||
} else {
|
||||
if (!slug) { return }
|
||||
if (!slug) {
|
||||
return
|
||||
}
|
||||
if (!index[slug]) {
|
||||
index[slug] = { slug: slug, title: '', body: '' };
|
||||
index[slug] = {slug: slug, title: '', body: ''};
|
||||
} else if (index[slug].body) {
|
||||
index[slug].body += '\n' + (token.text || '');
|
||||
} else {
|
||||
if (index[slug].body) {
|
||||
index[slug].body += '\n' + (token.text || '');
|
||||
} else {
|
||||
index[slug].body = token.text;
|
||||
}
|
||||
index[slug].body = token.text;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -72,14 +69,22 @@ function genIndex (path, content) {
|
||||
return index
|
||||
}
|
||||
|
||||
function search (keywords) {
|
||||
/**
|
||||
* @param {String} query
|
||||
* @returns {Array}
|
||||
*/
|
||||
function search(query) {
|
||||
var matchingResults = [];
|
||||
var data = [];
|
||||
Object.keys(INDEXS).forEach(function (key) {
|
||||
data = data.concat(Object.keys(INDEXS[key]).map(function (page) { return INDEXS[key][page]; }));
|
||||
});
|
||||
|
||||
keywords = [].concat(keywords, keywords.trim().split(/[\s\-\,\\/]+/));
|
||||
query = query.trim();
|
||||
var keywords = query.split(/[\s\-,\\/]+/);
|
||||
if (keywords.length !== 1) {
|
||||
keywords = [].concat(query, keywords);
|
||||
}
|
||||
|
||||
var loop = function ( i ) {
|
||||
var post = data[i];
|
||||
@@ -90,8 +95,12 @@ function search (keywords) {
|
||||
var postUrl = post.slug || '';
|
||||
|
||||
if (postTitle && postContent) {
|
||||
keywords.forEach(function (keyword, i) {
|
||||
var regEx = new RegExp(keyword, 'gi');
|
||||
keywords.forEach(function (keyword) {
|
||||
// From https://github.com/sindresorhus/escape-string-regexp
|
||||
var regEx = new RegExp(
|
||||
keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'),
|
||||
'gi'
|
||||
);
|
||||
var indexTitle = -1;
|
||||
var indexContent = -1;
|
||||
|
||||
@@ -102,7 +111,9 @@ function search (keywords) {
|
||||
isMatch = false;
|
||||
} else {
|
||||
isMatch = true;
|
||||
if (indexContent < 0) { indexContent = 0; }
|
||||
if (indexContent < 0) {
|
||||
indexContent = 0;
|
||||
}
|
||||
|
||||
var start = 0;
|
||||
var end = 0;
|
||||
@@ -110,13 +121,16 @@ function search (keywords) {
|
||||
start = indexContent < 11 ? 0 : indexContent - 10;
|
||||
end = start === 0 ? 70 : indexContent + keyword.length + 60;
|
||||
|
||||
if (end > postContent.length) { end = postContent.length; }
|
||||
if (end > postContent.length) {
|
||||
end = postContent.length;
|
||||
}
|
||||
|
||||
var matchContent = '...' +
|
||||
var matchContent =
|
||||
'...' +
|
||||
escapeHtml(postContent)
|
||||
.substring(start, end)
|
||||
.replace(regEx, ("<em class=\"search-keyword\">" + keyword + "</em>")) +
|
||||
'...';
|
||||
'...';
|
||||
|
||||
resultStr += matchContent;
|
||||
}
|
||||
@@ -139,7 +153,7 @@ function search (keywords) {
|
||||
return matchingResults
|
||||
}
|
||||
|
||||
function init$1 (config, vm) {
|
||||
function init$1(config, vm) {
|
||||
helper = Docsify;
|
||||
|
||||
var isAuto = config.paths === 'auto';
|
||||
@@ -153,102 +167,125 @@ function init$1 (config, vm) {
|
||||
return
|
||||
}
|
||||
|
||||
var paths = isAuto ? getAllPaths() : config.paths;
|
||||
var paths = isAuto ? getAllPaths(vm.router) : config.paths;
|
||||
var len = paths.length;
|
||||
var count = 0;
|
||||
|
||||
paths.forEach(function (path) {
|
||||
if (INDEXS[path]) { return count++ }
|
||||
if (INDEXS[path]) {
|
||||
return count++
|
||||
}
|
||||
|
||||
helper
|
||||
.get(vm.$getFile(path))
|
||||
.get(vm.router.getFile(path), false, vm.config.requestHeaders)
|
||||
.then(function (result) {
|
||||
INDEXS[path] = genIndex(path, result);
|
||||
INDEXS[path] = genIndex(path, result, vm.router, config.depth);
|
||||
len === ++count && saveData(config.maxAge);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var dom;
|
||||
var NO_DATA_TEXT = '';
|
||||
|
||||
function style () {
|
||||
var code = "\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 7px;\n line-height: 22px;\n font-size: 14px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}";
|
||||
var style = dom.create('style', code);
|
||||
dom.appendTo(dom.head, style);
|
||||
function style() {
|
||||
var code = "\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}";
|
||||
|
||||
Docsify.dom.style(code);
|
||||
}
|
||||
|
||||
function tpl (opts) {
|
||||
function tpl(opts, defaultValue) {
|
||||
if ( defaultValue === void 0 ) defaultValue = '';
|
||||
|
||||
var html =
|
||||
"<input type=\"search\" />" +
|
||||
'<div class="results-panel"></div>' +
|
||||
'</div>';
|
||||
var el = dom.create('div', html);
|
||||
var aside = dom.find('aside');
|
||||
"<div class=\"input-wrap\">\n <input type=\"search\" value=\"" + defaultValue + "\" />\n <div class=\"clear-button\">\n <svg width=\"26\" height=\"24\">\n <circle cx=\"12\" cy=\"12\" r=\"11\" fill=\"#ccc\" />\n <path stroke=\"white\" stroke-width=\"2\" d=\"M8.25,8.25,15.75,15.75\" />\n <path stroke=\"white\" stroke-width=\"2\"d=\"M8.25,15.75,15.75,8.25\" />\n </svg>\n </div>\n </div>\n <div class=\"results-panel\"></div>\n </div>";
|
||||
var el = Docsify.dom.create('div', html);
|
||||
var aside = Docsify.dom.find('aside');
|
||||
|
||||
dom.toggleClass(el, 'search');
|
||||
dom.before(aside, el);
|
||||
Docsify.dom.toggleClass(el, 'search');
|
||||
Docsify.dom.before(aside, el);
|
||||
}
|
||||
|
||||
function bindEvents () {
|
||||
var $search = dom.find('div.search');
|
||||
var $input = dom.find($search, 'input');
|
||||
var $panel = dom.find($search, '.results-panel');
|
||||
var doSearch = function (value) {
|
||||
if (!value) {
|
||||
$panel.classList.remove('show');
|
||||
$panel.innerHTML = '';
|
||||
return
|
||||
}
|
||||
var matchs = search(value);
|
||||
function doSearch(value) {
|
||||
var $search = Docsify.dom.find('div.search');
|
||||
var $panel = Docsify.dom.find($search, '.results-panel');
|
||||
var $clearBtn = Docsify.dom.find($search, '.clear-button');
|
||||
|
||||
var html = '';
|
||||
matchs.forEach(function (post) {
|
||||
html += "<div class=\"matching-post\">\n <h2><a href=\"" + (post.url) + "\">" + (post.title) + "</a></h2>\n <p>" + (post.content) + "</p>\n</div>";
|
||||
});
|
||||
if (!value) {
|
||||
$panel.classList.remove('show');
|
||||
$clearBtn.classList.remove('show');
|
||||
$panel.innerHTML = '';
|
||||
return
|
||||
}
|
||||
var matchs = search(value);
|
||||
|
||||
$panel.classList.add('show');
|
||||
$panel.innerHTML = html || ("<p class=\"empty\">" + NO_DATA_TEXT + "</p>");
|
||||
};
|
||||
var html = '';
|
||||
matchs.forEach(function (post) {
|
||||
html += "<div class=\"matching-post\">\n<a href=\"" + (post.url) + "\">\n<h2>" + (post.title) + "</h2>\n<p>" + (post.content) + "</p>\n</a>\n</div>";
|
||||
});
|
||||
|
||||
$panel.classList.add('show');
|
||||
$clearBtn.classList.add('show');
|
||||
$panel.innerHTML = html || ("<p class=\"empty\">" + NO_DATA_TEXT + "</p>");
|
||||
}
|
||||
|
||||
function bindEvents() {
|
||||
var $search = Docsify.dom.find('div.search');
|
||||
var $input = Docsify.dom.find($search, 'input');
|
||||
var $inputWrap = Docsify.dom.find($search, '.input-wrap');
|
||||
|
||||
var timeId;
|
||||
// Prevent to Fold sidebar
|
||||
dom.on($search, 'click',
|
||||
function (e) { return e.target.tagName !== 'A' && e.stopPropagation(); });
|
||||
dom.on($input, 'input', function (e) {
|
||||
Docsify.dom.on(
|
||||
$search,
|
||||
'click',
|
||||
function (e) { return e.target.tagName !== 'A' && e.stopPropagation(); }
|
||||
);
|
||||
Docsify.dom.on($input, 'input', function (e) {
|
||||
clearTimeout(timeId);
|
||||
timeId = setTimeout(function (_) { return doSearch(e.target.value.trim()); }, 100);
|
||||
});
|
||||
Docsify.dom.on($inputWrap, 'click', function (e) {
|
||||
// Click input outside
|
||||
if (e.target.tagName !== 'INPUT') {
|
||||
$input.value = '';
|
||||
doSearch();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updatePlaceholder (text, path) {
|
||||
var $input = dom.getNode('.search input[type="search"]');
|
||||
function updatePlaceholder(text, path) {
|
||||
var $input = Docsify.dom.getNode('.search input[type="search"]');
|
||||
|
||||
if (!$input) {
|
||||
return
|
||||
}
|
||||
if (typeof text === 'string') {
|
||||
$input.placeholder = text;
|
||||
} else {
|
||||
var match = Object.keys(text).find(function (key) { return path.indexOf(key) > -1; });
|
||||
var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0];
|
||||
$input.placeholder = text[match];
|
||||
}
|
||||
}
|
||||
|
||||
function updateNoData (text, path) {
|
||||
function updateNoData(text, path) {
|
||||
if (typeof text === 'string') {
|
||||
NO_DATA_TEXT = text;
|
||||
} else {
|
||||
var match = Object.keys(text).find(function (key) { return path.indexOf(key) > -1; });
|
||||
var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0];
|
||||
NO_DATA_TEXT = text[match];
|
||||
}
|
||||
}
|
||||
|
||||
function init$$1 (opts) {
|
||||
dom = Docsify.dom;
|
||||
function init(opts, vm) {
|
||||
var keywords = vm.router.parse().query.s;
|
||||
|
||||
style();
|
||||
tpl(opts);
|
||||
tpl(opts, keywords);
|
||||
bindEvents();
|
||||
keywords && setTimeout(function (_) { return doSearch(keywords); }, 500);
|
||||
}
|
||||
|
||||
function update (opts, vm) {
|
||||
function update(opts, vm) {
|
||||
updatePlaceholder(opts.placeholder, vm.route.path);
|
||||
updateNoData(opts.noData, vm.route.path);
|
||||
}
|
||||
@@ -257,6 +294,7 @@ var CONFIG = {
|
||||
placeholder: 'Type to search',
|
||||
noData: 'No Results!',
|
||||
paths: 'auto',
|
||||
depth: 2,
|
||||
maxAge: 86400000 // 1 day
|
||||
};
|
||||
|
||||
@@ -271,12 +309,13 @@ var install = function (hook, vm) {
|
||||
CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : CONFIG.maxAge;
|
||||
CONFIG.placeholder = opts.placeholder || CONFIG.placeholder;
|
||||
CONFIG.noData = opts.noData || CONFIG.noData;
|
||||
CONFIG.depth = opts.depth || CONFIG.depth;
|
||||
}
|
||||
|
||||
var isAuto = CONFIG.paths === 'auto';
|
||||
|
||||
hook.mounted(function (_) {
|
||||
init$$1(CONFIG);
|
||||
init(CONFIG, vm);
|
||||
!isAuto && init$1(CONFIG, vm);
|
||||
});
|
||||
hook.doneEach(function (_) {
|
||||
@@ -285,6 +324,6 @@ var install = function (hook, vm) {
|
||||
});
|
||||
};
|
||||
|
||||
window.$docsify.plugins = [].concat(install, window.$docsify.plugins);
|
||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
||||
|
||||
}());
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+12
-292
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 9.6 KiB |
Generated
+8438
File diff suppressed because it is too large
Load Diff
+50
-22
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "3.6.5",
|
||||
"version": "4.6.6",
|
||||
"description": "A magical documentation generator.",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
@@ -20,31 +20,54 @@
|
||||
"themes"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "rm -rf lib themes && node build/build.js && mkdir lib/themes && mkdir themes && node build/build-css.js",
|
||||
"dev:build": "rm -rf lib themes && mkdir themes && node build/build.js --dev && node build/build-css.js --dev",
|
||||
"dev": "node app.js & nodemon -w src -e js,css --exec 'npm run dev:build'",
|
||||
"test": "eslint src"
|
||||
"bootstrap": "npm i && lerna bootstrap && npm run build:ssr",
|
||||
"serve": "node server",
|
||||
"serve:ssr": "cross-env SSR=1 node server",
|
||||
"dev": "run-p serve watch:*",
|
||||
"dev:ssr": "run-p serve:ssr watch:*",
|
||||
"lint": "eslint {src,packages} --fix",
|
||||
"test": "run-p lint",
|
||||
"css": "stylus src/themes/*.styl -u autoprefixer-stylus",
|
||||
"watch:css": "run-p 'css -- -o themes -w'",
|
||||
"watch:js": "node build/build.js",
|
||||
"build:css:min": "mkdir lib/themes && run-p 'css -- -o lib/themes' && node build/mincss.js",
|
||||
"build:css": "mkdir themes && run-p 'css -- -o themes'",
|
||||
"build:js": "cross-env NODE_ENV=production node build/build.js",
|
||||
"build:ssr": "node build/ssr.js",
|
||||
"build:cover": "node build/cover.js",
|
||||
"build": "rimraf lib themes && run-s build:js build:css build:css:min build:ssr build:cover",
|
||||
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
|
||||
"pub": "sh build/release.sh",
|
||||
"postinstall": "opencollective postinstall"
|
||||
},
|
||||
"dependencies": {
|
||||
"marked": "^0.3.6",
|
||||
"prismjs": "^1.6.0",
|
||||
"zoom-image": "^0.1.4"
|
||||
"marked": "^0.3.12",
|
||||
"medium-zoom": "^0.3.0",
|
||||
"opencollective": "^1.0.3",
|
||||
"prismjs": "^1.9.0",
|
||||
"tinydate": "^1.0.0",
|
||||
"tweezer.js": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer-stylus": "^0.14.0",
|
||||
"chokidar": "^2.0.2",
|
||||
"conventional-changelog-cli": "^1.3.5",
|
||||
"cross-env": "^5.1.3",
|
||||
"cssnano": "^3.10.0",
|
||||
"eslint": "^3.18.0",
|
||||
"eslint-config-vue": "^2.0.2",
|
||||
"eslint-plugin-vue": "^2.0.1",
|
||||
"nodemon": "^1.11.0",
|
||||
"postcss": "^5.2.16",
|
||||
"postcss-salad": "^1.0.8",
|
||||
"rollup": "^0.41.6",
|
||||
"rollup-plugin-buble": "^0.15.0",
|
||||
"rollup-plugin-commonjs": "^8.0.2",
|
||||
"rollup-plugin-node-resolve": "^2.0.0",
|
||||
"rollup-plugin-string": "^2.0.2",
|
||||
"rollup-plugin-uglify": "^1.0.1",
|
||||
"serve-static": "^1.12.1"
|
||||
"eslint": "^4.14.0",
|
||||
"eslint-config-xo-space": "^0.18.0",
|
||||
"lerna": "^2.5.1",
|
||||
"live-server": "^1.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"rimraf": "^2.6.2",
|
||||
"rollup": "^0.53.3",
|
||||
"rollup-plugin-async": "^1.2.0",
|
||||
"rollup-plugin-buble": "^0.18.0",
|
||||
"rollup-plugin-commonjs": "^8.2.6",
|
||||
"rollup-plugin-node-resolve": "^3.0.0",
|
||||
"rollup-plugin-replace": "^2.0.0",
|
||||
"rollup-plugin-uglify": "^2.0.1",
|
||||
"stylus": "^0.54.5"
|
||||
},
|
||||
"keywords": [
|
||||
"doc",
|
||||
@@ -52,5 +75,10 @@
|
||||
"documentation",
|
||||
"creator",
|
||||
"generator"
|
||||
]
|
||||
],
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/docsify",
|
||||
"logo": "https://docsify.js.org/_media/icon.svg"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
build.js
|
||||
node_modules
|
||||
*.log
|
||||
.git
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user