mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 21:36:10 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a961e3b972 | ||
|
|
3c94178805 | ||
|
|
490242fb73 | ||
|
|
5c0de0aefe | ||
|
|
04b36b0ef2 | ||
|
|
3a7ad6299e | ||
|
|
feea7f9b48 | ||
|
|
cd09d91434 | ||
|
|
a5f333a329 | ||
|
|
7dcebe7544 | ||
|
|
cc636e6ca3 | ||
|
|
5523a2a2a9 | ||
|
|
f8f22e5a3c | ||
|
|
ee72dd05e5 | ||
|
|
6c7ebc989d | ||
|
|
57967d2caa | ||
|
|
c2886b1b62 | ||
|
|
2d9e581d63 | ||
|
|
604989ff04 | ||
|
|
26525db433 | ||
|
|
2b0109b89a | ||
|
|
fb144b2e69 | ||
|
|
ac695de859 | ||
|
|
e5a263f1bb | ||
|
|
48e531bcfb | ||
|
|
1f338d2142 | ||
|
|
cf05d7b26c | ||
|
|
cb1a56d89b | ||
|
|
62b7578468 | ||
|
|
410efb2bc2 | ||
|
|
1e99d7b514 | ||
|
|
e4e011c81f | ||
|
|
4cd0e5eb49 | ||
|
|
531e483c31 | ||
|
|
6a3d69ae1a | ||
|
|
ef1b42be23 | ||
|
|
54f45ecb0a | ||
|
|
4c91fbc7cb | ||
|
|
bfd0d18e48 | ||
|
|
74ff68a40e |
@@ -1,3 +1,53 @@
|
||||
<a name="4.7.0"></a>
|
||||
# [4.7.0](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.7.0) (2018-06-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* alldow addition content in sidebar, fix [#518](https://github.com/QingWei-Li/docsify/issues/518), fix 539 ([#543](https://github.com/QingWei-Li/docsify/issues/543)) ([04b36b0](https://github.com/QingWei-Li/docsify/commit/04b36b0))
|
||||
* async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
|
||||
* loading embed files synchronously, fixed [#525](https://github.com/QingWei-Li/docsify/issues/525), fixed [#527](https://github.com/QingWei-Li/docsify/issues/527) ([#544](https://github.com/QingWei-Li/docsify/issues/544)) ([feea7f9](https://github.com/QingWei-Li/docsify/commit/feea7f9))
|
||||
* path include chinese character cause hilight bug ([#556](https://github.com/QingWei-Li/docsify/issues/556)) ([a5f333a](https://github.com/QingWei-Li/docsify/commit/a5f333a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add logo option, [#264](https://github.com/QingWei-Li/docsify/issues/264) ([#541](https://github.com/QingWei-Li/docsify/issues/541)) ([ee72dd0](https://github.com/QingWei-Li/docsify/commit/ee72dd0))
|
||||
* add unpkg field, close [#531](https://github.com/QingWei-Li/docsify/issues/531) ([#558](https://github.com/QingWei-Li/docsify/issues/558)) ([5c0de0a](https://github.com/QingWei-Li/docsify/commit/5c0de0a))
|
||||
* support image resizing, resolve [#508](https://github.com/QingWei-Li/docsify/issues/508) ([#545](https://github.com/QingWei-Li/docsify/issues/545)) ([3a7ad62](https://github.com/QingWei-Li/docsify/commit/3a7ad62))
|
||||
|
||||
|
||||
|
||||
<a name="4.6.10"></a>
|
||||
## [4.6.10](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.6.10) (2018-03-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
|
||||
|
||||
|
||||
|
||||
<a name="4.6.9"></a>
|
||||
## [4.6.9](https://github.com/QingWei-Li/docsify/compare/v4.6.8...v4.6.9) (2018-03-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade medium-zoom, fixed [#417](https://github.com/QingWei-Li/docsify/issues/417) ([6a3d69a](https://github.com/QingWei-Li/docsify/commit/6a3d69a))
|
||||
|
||||
|
||||
|
||||
<a name="4.6.8"></a>
|
||||
## [4.6.8](https://github.com/QingWei-Li/docsify/compare/v4.6.7...v4.6.8) (2018-03-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* resolve path of image and embed files, fixed [#412](https://github.com/QingWei-Li/docsify/issues/412) ([bfd0d18](https://github.com/QingWei-Li/docsify/commit/bfd0d18))
|
||||
|
||||
|
||||
|
||||
<a name="4.6.7"></a>
|
||||
## [4.6.7](https://github.com/QingWei-Li/docsify/compare/v4.6.6...v4.6.7) (2018-03-03)
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
|
||||
## 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>
|
||||
<a href="https://github.com/QingWei-Li/docsify/graphs/contributors"><img src="https://opencollective.com/docsify/contributors.svg?width=890" /></a>
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# docsify <small>4.6.7</small>
|
||||
# docsify <small>4.7.0</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
- [:cn: 中文](/zh-cn/)
|
||||
- [:de: Deutsch](/de-de/)
|
||||
- [:uk: English](/)
|
||||
- [:es: Spanish](https://docsify-es.js.org)
|
||||
- [:ru: Russian](https://docsify-ru.js.org)
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ Recommended: [unpkg](//unpkg.com), which will reflect the latest version as soon
|
||||
<script src="//unpkg.com/docsify/lib/docsify.js"></script>
|
||||
```
|
||||
|
||||
Alternatively, use [compressed files](#compressed-files).
|
||||
Alternatively, use [compressed files](#compressed-file).
|
||||
|
||||
## Specific version
|
||||
|
||||
|
||||
+61
-51
@@ -14,8 +14,8 @@ You can configure the `window.$docsify`.
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -27,8 +27,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -42,8 +42,8 @@ window.$docsify = {
|
||||
|
||||
## maxLevel
|
||||
|
||||
* Type: `Number`
|
||||
* Default: `6`
|
||||
- Type: `Number`
|
||||
- Default: `6`
|
||||
|
||||
Maximum Table of content level.
|
||||
|
||||
@@ -55,8 +55,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -72,8 +72,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -89,8 +89,8 @@ window.$docsify = {
|
||||
|
||||
## subMaxLevel
|
||||
|
||||
* Type: `Number`
|
||||
* Default: `0`
|
||||
- Type: `Number`
|
||||
- Default: `0`
|
||||
|
||||
Add table of contents (TOC) in custom sidebar.
|
||||
|
||||
@@ -102,8 +102,8 @@ window.$docsify = {
|
||||
|
||||
## auto2top
|
||||
|
||||
* Type: `Boolean`
|
||||
* Default: `false`
|
||||
- Type: `Boolean`
|
||||
- Default: `false`
|
||||
|
||||
Scrolls to the top of the screen when the route is changed.
|
||||
|
||||
@@ -115,8 +115,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -133,7 +133,7 @@ window.$docsify = {
|
||||
|
||||
## basePath
|
||||
|
||||
* Type: `String`
|
||||
- Type: `String`
|
||||
|
||||
Base path of the website. You can set it to another directory or another domain name.
|
||||
|
||||
@@ -152,8 +152,8 @@ window.$docsify = {
|
||||
|
||||
## coverpage
|
||||
|
||||
* Type: `Boolean|String|String[]|Object`
|
||||
* Default: `false`
|
||||
- Type: `Boolean|String|String[]|Object`
|
||||
- Default: `false`
|
||||
|
||||
Activate the [cover feature](cover.md). If true, it will load from `_coverpage.md`.
|
||||
|
||||
@@ -175,9 +175,21 @@ window.$docsify = {
|
||||
};
|
||||
```
|
||||
|
||||
## logo
|
||||
|
||||
- Type: `String`
|
||||
|
||||
Website logo as it appears in the sidebar, you can resize by CSS.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
logo: '/_media/icon.svg'
|
||||
};
|
||||
```
|
||||
|
||||
## name
|
||||
|
||||
* Type: `String`
|
||||
- Type: `String`
|
||||
|
||||
Website name as it appears in the sidebar.
|
||||
|
||||
@@ -189,8 +201,8 @@ window.$docsify = {
|
||||
|
||||
## nameLink
|
||||
|
||||
* Type: `String`
|
||||
* Default: `window.location.pathname`
|
||||
- Type: `String`
|
||||
- Default: `window.location.pathname`
|
||||
|
||||
The name of the link.
|
||||
|
||||
@@ -208,7 +220,7 @@ window.$docsify = {
|
||||
|
||||
## markdown
|
||||
|
||||
* Type: `Function`
|
||||
- Type: `Function`
|
||||
|
||||
See [Markdown configuration](markdown.md).
|
||||
|
||||
@@ -234,7 +246,7 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -246,7 +258,7 @@ window.$docsify = {
|
||||
|
||||
## alias
|
||||
|
||||
* Type: `Object`
|
||||
- Type: `Object`
|
||||
|
||||
Set the route alias. You can freely manage routing rules. Supports RegExp.
|
||||
|
||||
@@ -264,7 +276,7 @@ window.$docsify = {
|
||||
|
||||
## 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).
|
||||
|
||||
@@ -277,7 +289,7 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -299,7 +311,7 @@ Note that if you are running an external script, e.g. an embedded jsfiddle demo,
|
||||
|
||||
## noEmoji
|
||||
|
||||
* type: `Boolean`
|
||||
- type: `Boolean`
|
||||
|
||||
Disabled emoji parse.
|
||||
|
||||
@@ -311,7 +323,7 @@ window.$docsify = {
|
||||
|
||||
## mergeNavbar
|
||||
|
||||
* type: `Boolean`
|
||||
- type: `Boolean`
|
||||
|
||||
Navbar will be merged with the sidebar on smaller screens.
|
||||
|
||||
@@ -323,7 +335,7 @@ window.$docsify = {
|
||||
|
||||
## formatUpdated
|
||||
|
||||
* type: `String|Function`
|
||||
- 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
|
||||
@@ -342,8 +354,8 @@ window.$docsify = {
|
||||
|
||||
## externalLinkTarget
|
||||
|
||||
* type: `String`
|
||||
* default: `_blank`
|
||||
- type: `String`
|
||||
- default: `_blank`
|
||||
|
||||
Target to open external links. Default `'_blank'` (new window/tab)
|
||||
|
||||
@@ -355,8 +367,8 @@ window.$docsify = {
|
||||
|
||||
## routerMode
|
||||
|
||||
* type: `String`
|
||||
* default: `history`
|
||||
- type: `String`
|
||||
- default: `hash`
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -366,7 +378,7 @@ window.$docsify = {
|
||||
|
||||
## noCompileLinks
|
||||
|
||||
* type: `Array`
|
||||
- type: `Array`
|
||||
|
||||
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/QingWei-Li/docsify/issues/203)
|
||||
|
||||
@@ -378,7 +390,7 @@ window.$docsify = {
|
||||
|
||||
## onlyCover
|
||||
|
||||
* type: `Boolean`
|
||||
- type: `Boolean`
|
||||
|
||||
Only coverpage is loaded when visiting the home page.
|
||||
|
||||
@@ -390,7 +402,7 @@ window.$docsify = {
|
||||
|
||||
## requestHeaders
|
||||
|
||||
* type: `Object`
|
||||
- type: `Object`
|
||||
|
||||
Set the request resource headers.
|
||||
|
||||
@@ -404,7 +416,7 @@ window.$docsify = {
|
||||
|
||||
## ext
|
||||
|
||||
* type: `String`
|
||||
- type: `String`
|
||||
|
||||
Request file extension.
|
||||
|
||||
@@ -416,32 +428,28 @@ window.$docsify = {
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
- 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.
|
||||
|
||||
- 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"
|
||||
]
|
||||
fallbackLanguages: ['fr', 'de']
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
## notFoundPage
|
||||
|
||||
* type: `Boolean` | `String` | `Object`
|
||||
- type: `Boolean` | `String` | `Object`
|
||||
|
||||
Load the `_404.md` file:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: true
|
||||
@@ -449,6 +457,7 @@ window.$docsify = {
|
||||
```
|
||||
|
||||
Load the customised path of the 404 page:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: 'my404.md'
|
||||
@@ -456,13 +465,14 @@ window.$docsify = {
|
||||
```
|
||||
|
||||
Load the right 404 page according to the localisation:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: {
|
||||
'/': '_404.md',
|
||||
'/de': 'de/_404.md',
|
||||
'/de': 'de/_404.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
|
||||
|
||||
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ The background color is generated randomly by default. You can customize the bac
|
||||
|
||||
## 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).
|
||||
Normally, 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
|
||||
|
||||
|
||||
+59
-43
@@ -14,8 +14,8 @@ You can configure the `window.$docsify`.
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -27,8 +27,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -42,8 +42,8 @@ window.$docsify = {
|
||||
|
||||
## maxLevel
|
||||
|
||||
* Typ: `Number`
|
||||
* Standard: `6`
|
||||
- Typ: `Number`
|
||||
- Standard: `6`
|
||||
|
||||
Maximale Anzahl der Inhaltsübersichtebenen.
|
||||
|
||||
@@ -55,8 +55,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -72,8 +72,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -89,8 +89,8 @@ window.$docsify = {
|
||||
|
||||
## subMaxLevel
|
||||
|
||||
* Typ: `Number`
|
||||
* Standard: `0`
|
||||
- Typ: `Number`
|
||||
- Standard: `0`
|
||||
|
||||
Wähle die maximale Anzahl der Unterpunkte pro Datei in der Inhaltsübersicht.
|
||||
|
||||
@@ -102,8 +102,8 @@ window.$docsify = {
|
||||
|
||||
## auto2top
|
||||
|
||||
* Typ: `Boolean`
|
||||
* Standard: `false`
|
||||
- Typ: `Boolean`
|
||||
- Standard: `false`
|
||||
|
||||
Scrolle zum Anfang der Seite, wenn die Route gewechselt wird.
|
||||
|
||||
@@ -115,8 +115,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -133,7 +133,7 @@ window.$docsify = {
|
||||
|
||||
## basePath
|
||||
|
||||
* Typ: `String`
|
||||
- Typ: `String`
|
||||
|
||||
Der Basispfad der Webseite. Du kannst einen anderen Ordner wählen, oder eine andere Domain.
|
||||
|
||||
@@ -152,8 +152,8 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -175,9 +175,21 @@ window.$docsify = {
|
||||
};
|
||||
```
|
||||
|
||||
## logo
|
||||
|
||||
- Type: `String`
|
||||
|
||||
Website logo as it appears in the sidebar, you can resize by CSS.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
logo: '/_media/icon.svg'
|
||||
};
|
||||
```
|
||||
|
||||
## name
|
||||
|
||||
* Typ: `String`
|
||||
- Typ: `String`
|
||||
|
||||
Webseitenname, wie er in der Inhaltsübersicht in der Seitenleiste angezeigt wird.
|
||||
|
||||
@@ -189,8 +201,8 @@ window.$docsify = {
|
||||
|
||||
## nameLink
|
||||
|
||||
* Typ: `String`
|
||||
* Standard: `window.location.pathname`
|
||||
- Typ: `String`
|
||||
- Standard: `window.location.pathname`
|
||||
|
||||
Der Name der Links.
|
||||
|
||||
@@ -208,7 +220,7 @@ window.$docsify = {
|
||||
|
||||
## markdown
|
||||
|
||||
* Typ: `Function`
|
||||
- Typ: `Function`
|
||||
|
||||
Siehe [Markdown Konfiguration](de-de/markdown.md).
|
||||
|
||||
@@ -234,7 +246,7 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -246,7 +258,7 @@ window.$docsify = {
|
||||
|
||||
## alias
|
||||
|
||||
* Typ: `Object`
|
||||
- Typ: `Object`
|
||||
|
||||
Verwende alternative Routen. Du kannst sie ungehindert anpassen. Supports RegExp.
|
||||
|
||||
@@ -264,7 +276,7 @@ window.$docsify = {
|
||||
|
||||
## 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).
|
||||
|
||||
@@ -277,7 +289,7 @@ window.$docsify = {
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -299,7 +311,7 @@ window.$docsify = {
|
||||
|
||||
## noEmoji
|
||||
|
||||
* type: `Boolean`
|
||||
- type: `Boolean`
|
||||
|
||||
Verhindere die Umwandlung in Emojis:
|
||||
|
||||
@@ -311,7 +323,7 @@ window.$docsify = {
|
||||
|
||||
## mergeNavbar
|
||||
|
||||
* type: `Boolean`
|
||||
- type: `Boolean`
|
||||
|
||||
Navbar will be merged with the sidebar on smaller screens.
|
||||
|
||||
@@ -323,7 +335,7 @@ window.$docsify = {
|
||||
|
||||
## formatUpdated
|
||||
|
||||
* type: `String|Function`
|
||||
- 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
|
||||
@@ -342,8 +354,8 @@ window.$docsify = {
|
||||
|
||||
## externalLinkTarget
|
||||
|
||||
* type: `String`
|
||||
* default: `_blank`
|
||||
- type: `String`
|
||||
- default: `_blank`
|
||||
|
||||
Currently it defaults to \_blank, would be nice if configurable:
|
||||
|
||||
@@ -355,8 +367,8 @@ window.$docsify = {
|
||||
|
||||
## routerMode
|
||||
|
||||
* type: `String`
|
||||
* default: `history`
|
||||
- type: `String`
|
||||
- default: `history`
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -366,7 +378,7 @@ window.$docsify = {
|
||||
|
||||
## noCompileLinks
|
||||
|
||||
* type: `Array`
|
||||
- type: `Array`
|
||||
|
||||
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/QingWei-Li/docsify/issues/203)
|
||||
|
||||
@@ -378,7 +390,7 @@ window.$docsify = {
|
||||
|
||||
## requestHeaders
|
||||
|
||||
* type: `Object`
|
||||
- type: `Object`
|
||||
|
||||
Set the request resource headers.
|
||||
|
||||
@@ -392,7 +404,7 @@ window.$docsify = {
|
||||
|
||||
## ext
|
||||
|
||||
* type: `String`
|
||||
- type: `String`
|
||||
|
||||
Request file extension.
|
||||
|
||||
@@ -404,15 +416,15 @@ window.$docsify = {
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
- 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.
|
||||
- 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 = {
|
||||
@@ -422,9 +434,10 @@ window.$docsify = {
|
||||
|
||||
## notFoundPage
|
||||
|
||||
* type: `Boolean` | `String` | `Object`
|
||||
- type: `Boolean` | `String` | `Object`
|
||||
|
||||
Load the `_404.md` file:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: true
|
||||
@@ -432,6 +445,7 @@ window.$docsify = {
|
||||
```
|
||||
|
||||
Load the customised path of the 404 page:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: 'my404.md'
|
||||
@@ -439,12 +453,14 @@ window.$docsify = {
|
||||
```
|
||||
|
||||
Load the right 404 page according to the localisation:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: {
|
||||
'/': '_404.md',
|
||||
'/de': 'de/_404.md',
|
||||
'/de': 'de/_404.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
|
||||
|
||||
@@ -68,7 +68,7 @@ Du kannst untergeordnete Listen erstellen, indem du untergeordnete Punkte einem
|
||||
|
||||
wird also wie folgt aussehen
|
||||
|
||||

|
||||

|
||||
|
||||
## Angepasste Navigationsleisten in Verbindung mit dem emoji Erweiterung
|
||||
|
||||
|
||||
+19
-7
@@ -6,24 +6,23 @@
|
||||
|
||||
Du kannst folgende drei Orte verwenden, um die Dokumentation für dein Github repository zu verwalten:
|
||||
|
||||
* `docs/` Ordner
|
||||
* master branch
|
||||
* gh-pages branch
|
||||
- `docs/` Ordner
|
||||
- master branch
|
||||
- gh-pages branch
|
||||
|
||||
Es wird empfohlen, deine Dateien im `./docs` Unterordner im `master` branch deines repository zu speichern. Wechsle dann zu den Einstellungen deines repository und wähle `master branch /docs folder` als deine Github Pages Quelle.
|
||||
|
||||

|
||||

|
||||
|
||||
!> 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
|
||||
```YAML
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
@@ -39,7 +38,6 @@ pages:
|
||||
|
||||
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
|
||||
|
||||
|
||||
## VPS
|
||||
|
||||
Verwende folgende nginx config.
|
||||
@@ -55,3 +53,17 @@ server {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Netlify
|
||||
|
||||
1. Login to your [Netlify](https://www.netlify.com/) account.
|
||||
2. In the [dashboard](https://app.netlify.com/) page, click **New site from Git**.
|
||||
3. Choose a repository where you store your docs, leave the **Build Command** area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`.
|
||||
|
||||
### HTML5 router
|
||||
|
||||
When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, populate a `\redirects` file in the docs directory and you're all set:
|
||||
|
||||
```sh
|
||||
/* /index.html 200
|
||||
```
|
||||
|
||||
@@ -6,14 +6,14 @@ You can embed these files as video, audio, iframes, or code blocks, and even Mar
|
||||
For example, here embedded a Markdown file. You only need to do this:
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include')
|
||||
[filename](../_media/example.md ':include')
|
||||
```
|
||||
|
||||
Then the content of `example.md` will be displayed directly here
|
||||
|
||||
[filename](_media/example.md ':include')
|
||||
[filename](../_media/example.md ':include')
|
||||
|
||||
You can check the original content for [example.md](_media/example.md ':ignore').
|
||||
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.
|
||||
|
||||
@@ -32,12 +32,12 @@ This is a supported embedding type:
|
||||
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')
|
||||
[filename](../_media/example.md ':include :type=code')
|
||||
```
|
||||
|
||||
You will get it
|
||||
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
[filename](../_media/example.md ':include :type=code')
|
||||
|
||||
## Tag attribute
|
||||
|
||||
@@ -56,11 +56,11 @@ Did you see it? You only need to write directly. You can check [MDN](https://dev
|
||||
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')
|
||||
```
|
||||
|
||||
⬇️
|
||||
|
||||
[](_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).
|
||||
|
||||
+22
-12
@@ -60,17 +60,27 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
|
||||
## Github Task Lists
|
||||
|
||||
```md
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
- [ ] foo
|
||||
- bar
|
||||
- [x] baz
|
||||
- [] bam <~ not working
|
||||
- [ ] bim
|
||||
- [ ] lim
|
||||
```
|
||||
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
- [ ] foo
|
||||
- bar
|
||||
- [x] baz
|
||||
- [] bam <~ not working
|
||||
- [ ] bim
|
||||
- [ ] lim
|
||||
|
||||
## Image resizing
|
||||
|
||||
```md
|
||||

|
||||

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

|
||||

|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Markdown Einstellungen
|
||||
|
||||
**docsify** verwendet [marked](https://github.com/chjj/marked), um Markdown umzuwandeln. Du kannst einstellen, wie es deine Markdown Seiten in HTML umwandelt, indem du `renderer` konfigurierst:
|
||||
**docsify** verwendet [marked](https://github.com/markedjs/marked), um Markdown umzuwandeln. Du kannst einstellen, wie es deine Markdown Seiten in HTML umwandelt, indem du `renderer` konfigurierst:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -15,7 +15,7 @@ window.$docsify = {
|
||||
}
|
||||
```
|
||||
|
||||
?> Für mögliche Einstellungen, siehe [marked Dokumentation](https://github.com/chjj/marked#options-1)
|
||||
?> Für mögliche Einstellungen, siehe [marked Dokumentation](https://github.com/markedjs/marked#options-1)
|
||||
|
||||
Du kannst die Regeln auch beliebig anpassen.
|
||||
|
||||
|
||||
+3
-23
@@ -4,7 +4,6 @@
|
||||
|
||||
Als Standardeinstellung werden Hyperlinks auf der aktuellen Seite erkannt und der Inhalt in `localStorage` gespeichert. Du kannst den Pfad zu den Dateien auch anpassen:
|
||||
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
@@ -67,12 +66,6 @@ Konfiguration über `data-ga`:
|
||||
<script src="//unpkg.com/docsify/lib/plugins/ga.min.js"></script>
|
||||
```
|
||||
|
||||
## front matter
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/plugins/front-matter.min.js"></script>
|
||||
```
|
||||
|
||||
## emoji
|
||||
|
||||
Als Standardeinstellung werden emojis umgewandelt. Als Beispiel wird `:100:` umgewandelt in :100:. Aber das ist nicht genau, das es keine passende Nicht-emoji Zeichenfolge gibt. Solltest du emojis richtig umwandeln wollen, musst du diese Erweiterung verwenden.
|
||||
@@ -111,7 +104,6 @@ When readers expand the demo box, the source code and description are shown ther
|
||||
|
||||
[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)
|
||||
@@ -121,22 +113,11 @@ Add `Edit on github` button on every pages. Provided by [@njleonzhang](https://g
|
||||
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()
|
||||
]
|
||||
}
|
||||
<script src="//unpkg.com/docsify-copy-code"></script>
|
||||
```
|
||||
|
||||
See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.
|
||||
|
||||
|
||||
|
||||
## Disqus
|
||||
|
||||
Disqus comments. https://disqus.com/
|
||||
@@ -150,10 +131,9 @@ Disqus comments. https://disqus.com/
|
||||
<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.
|
||||
[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">
|
||||
@@ -173,7 +153,7 @@ Disqus comments. https://disqus.com/
|
||||
</script>
|
||||
```
|
||||
|
||||
## Navigation
|
||||
## Pagination
|
||||
|
||||
Pagination for docsify. By [@imyelo](https://github.com/imyelo)
|
||||
|
||||
|
||||
@@ -54,3 +54,9 @@ Solltest du weitere Themes erstellen, kannst du sie gerne der Allgemeinheit mit
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
## Other themes
|
||||
|
||||
- [docsify-themeable](https://jhildenbiddle.github.io/docsify-themeable/#/) A delightfully simple theme system for docsify.
|
||||
|
||||
+21
-10
@@ -6,9 +6,9 @@ Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pa
|
||||
|
||||
There're three places to populate your docs for your Github repository:
|
||||
|
||||
* `docs/` folder
|
||||
* master branch
|
||||
* gh-pages branch
|
||||
- `docs/` folder
|
||||
- master branch
|
||||
- gh-pages branch
|
||||
|
||||
It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your Github Pages source in your repositories' settings page.
|
||||
|
||||
@@ -23,7 +23,7 @@ If you are deploying your master branch, include `.gitlab-ci.yml` with the follo
|
||||
|
||||
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
|
||||
|
||||
``` YAML
|
||||
```YAML
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
@@ -41,20 +41,17 @@ pages:
|
||||
|
||||
## 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.
|
||||
!> 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/**"
|
||||
]
|
||||
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -76,3 +73,17 @@ server {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Netlify
|
||||
|
||||
1. Login to your [Netlify](https://www.netlify.com/) account.
|
||||
2. In the [dashboard](https://app.netlify.com/) page, click **New site from Git**.
|
||||
3. Choose a repository where you store your docs, leave the **Build Command** area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`.
|
||||
|
||||
### HTML5 router
|
||||
|
||||
When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, populate a `\redirects` file in the docs directory and you're all set:
|
||||
|
||||
```sh
|
||||
/* /index.html 200
|
||||
```
|
||||
|
||||
+22
-12
@@ -66,17 +66,27 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
|
||||
## Github Task Lists
|
||||
|
||||
```md
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
- [ ] foo
|
||||
- bar
|
||||
- [x] baz
|
||||
- [] bam <~ not working
|
||||
- [ ] bim
|
||||
- [ ] lim
|
||||
```
|
||||
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
- [ ] foo
|
||||
- bar
|
||||
- [x] baz
|
||||
- [] bam <~ not working
|
||||
- [ ] bim
|
||||
- [ ] lim
|
||||
|
||||
## Image resizing
|
||||
|
||||
```md
|
||||

|
||||

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

|
||||

|
||||
|
||||
+5
-3
@@ -14,6 +14,7 @@
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/dark.css" title="dark" disabled>
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/buble.css" title="buble" disabled>
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/pure.css" title="pure" disabled>
|
||||
<script src="//unpkg.com/docsify-plugin-codefund@1.0.3/index.js"></script>
|
||||
<style>
|
||||
nav.app-nav li ul {
|
||||
min-width: 100px;
|
||||
@@ -62,10 +63,11 @@
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ '\n\n----\n\n'
|
||||
+ '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
|
||||
})
|
||||
}
|
||||
},
|
||||
DocsifyCodefund.create('fae1f9a4-870c-4c25-b8e0-c80464f7a95c')
|
||||
]
|
||||
}
|
||||
</script>
|
||||
@@ -77,4 +79,4 @@
|
||||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+18
-22
@@ -4,7 +4,6 @@
|
||||
|
||||
By default, the hyperlink on the current page is recognized and the content is saved in `localStorage`. You can also specify the path to the files.
|
||||
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
@@ -67,12 +66,6 @@ Configure by `data-ga`.
|
||||
<script src="//unpkg.com/docsify/lib/plugins/ga.min.js"></script>
|
||||
```
|
||||
|
||||
## front matter
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/docsify/lib/plugins/front-matter.min.js"></script>
|
||||
```
|
||||
|
||||
## emoji
|
||||
|
||||
The default is to support parsing emoji. For example `:100:` will be parsed to :100:. But it is not precise because there is no matching non-emoji string. If you need to correctly parse the emoji string, you need install this plugin.
|
||||
@@ -103,7 +96,6 @@ Exclude the special image
|
||||

|
||||
```
|
||||
|
||||
|
||||
## 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)
|
||||
@@ -116,27 +108,16 @@ When readers expand the demo box, the source code and description are shown ther
|
||||
|
||||
[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()
|
||||
]
|
||||
}
|
||||
<script src="//unpkg.com/docsify-copy-code"></script>
|
||||
```
|
||||
|
||||
See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.
|
||||
|
||||
|
||||
## Disqus
|
||||
|
||||
Disqus comments. https://disqus.com/
|
||||
@@ -152,7 +133,7 @@ Disqus comments. https://disqus.com/
|
||||
|
||||
## Gitalk
|
||||
|
||||
[Gitalk](https://github.com/gitalk/gitalk) is a modern comment component based on Github Issue and Preact.
|
||||
[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">
|
||||
@@ -172,7 +153,7 @@ Disqus comments. https://disqus.com/
|
||||
</script>
|
||||
```
|
||||
|
||||
## Navigation
|
||||
## Pagination
|
||||
|
||||
Pagination for docsify. By [@imyelo](https://github.com/imyelo)
|
||||
|
||||
@@ -181,3 +162,18 @@ Pagination for docsify. By [@imyelo](https://github.com/imyelo)
|
||||
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
||||
```
|
||||
|
||||
## codefund
|
||||
|
||||
a [plugin](https://github.com/njleonzhang/docsify-plugin-codefund) to make it easy to join up [codefund](https://codesponsor.io/)
|
||||
|
||||
> codefund is formerly known as "codesponsor"
|
||||
|
||||
```
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
|
||||
window.$docsify = {
|
||||
plugins: [
|
||||
DocsifyCodefund.create('xxxx-xxx-xxx') // change to your codefund id
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -54,3 +54,7 @@ If you have any ideas or would like to develop a new theme, you are welcome to s
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
## Other themes
|
||||
|
||||
- [docsify-themeable](https://jhildenbiddle.github.io/docsify-themeable/#/) A delightfully simple theme system for docsify.
|
||||
|
||||
+60
-59
@@ -14,8 +14,8 @@
|
||||
|
||||
## el
|
||||
|
||||
* 类型:`String`
|
||||
* 默认值:`#app`
|
||||
- 类型:`String`
|
||||
- 默认值:`#app`
|
||||
|
||||
docsify 初始化的挂载元素,可以是一个 CSS 选择器,默认为 `#app` 如果不存在就直接绑定在 `body` 上。
|
||||
|
||||
@@ -27,8 +27,8 @@ window.$docsify = {
|
||||
|
||||
## repo
|
||||
|
||||
* 类型:`String`
|
||||
* 默认值: `null`
|
||||
- 类型:`String`
|
||||
- 默认值: `null`
|
||||
|
||||
配置仓库地址或者 `username/repo` 的字符串,会在页面右上角渲染一个 [GitHub Corner](http://tholman.com/github-corners/) 挂件。
|
||||
|
||||
@@ -40,10 +40,10 @@ window.$docsify = {
|
||||
};
|
||||
```
|
||||
|
||||
## max-level
|
||||
## maxLevel
|
||||
|
||||
* 类型:`Number`
|
||||
* 默认值: `6`
|
||||
- 类型:`Number`
|
||||
- 默认值: `6`
|
||||
|
||||
默认情况下会抓取文档中所有标题渲染成目录,可配置最大支持渲染的标题层级。
|
||||
|
||||
@@ -53,23 +53,10 @@ window.$docsify = {
|
||||
};
|
||||
```
|
||||
|
||||
## maxLevel
|
||||
|
||||
* Type: `Number`
|
||||
* Default: `6`
|
||||
|
||||
Maximum Table of content level.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
maxLevel: 4
|
||||
};
|
||||
```
|
||||
|
||||
## loadNavbar
|
||||
|
||||
* 类型:`Boolean|String`
|
||||
* 默认值: `false`
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
|
||||
加载自定义导航栏,参考[定制导航栏](zh-cn/custom-navbar.md) 了解用法。设置为 `true` 后会加载 `_navbar.md` 文件,也可以自定义加载的文件名。
|
||||
|
||||
@@ -85,8 +72,8 @@ window.$docsify = {
|
||||
|
||||
## loadSidebar
|
||||
|
||||
* 类型:`Boolean|String`
|
||||
* 默认值: `false`
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
|
||||
加载自定义侧边栏,参考[多页文档](zh-cn/more-pages.md)。设置为 `true` 后会加载 `_sidebar.md` 文件,也可以自定义加载的文件名。
|
||||
|
||||
@@ -102,8 +89,8 @@ window.$docsify = {
|
||||
|
||||
## subMaxLevel
|
||||
|
||||
* 类型:`Number`
|
||||
* 默认值: `0`
|
||||
- 类型:`Number`
|
||||
- 默认值: `0`
|
||||
|
||||
自定义侧边栏后默认不会再生成目录,你也可以通过设置生成目录的最大层级开启这个功能。
|
||||
|
||||
@@ -115,8 +102,8 @@ window.$docsify = {
|
||||
|
||||
## auto2top
|
||||
|
||||
* 类型:`Boolean`
|
||||
* 默认值: `false`
|
||||
- 类型:`Boolean`
|
||||
- 默认值: `false`
|
||||
|
||||
切换页面后是否自动跳转到页面顶部。
|
||||
|
||||
@@ -128,8 +115,8 @@ window.$docsify = {
|
||||
|
||||
## homepage
|
||||
|
||||
* 类型:`String`
|
||||
* 默认值: `README.md`
|
||||
- 类型:`String`
|
||||
- 默认值: `README.md`
|
||||
|
||||
设置首页文件加载路径。适合不想将 `README.md` 作为入口文件渲染,或者是文档存放在其他位置的情况使用。
|
||||
|
||||
@@ -146,7 +133,7 @@ window.$docsify = {
|
||||
|
||||
## basePath
|
||||
|
||||
* 类型:`String`
|
||||
- 类型:`String`
|
||||
|
||||
文档加载的根路径,可以是二级路径或者是其他域名的路径。
|
||||
|
||||
@@ -165,8 +152,8 @@ window.$docsify = {
|
||||
|
||||
## coverpage
|
||||
|
||||
* 类型:`Boolean|String`
|
||||
* 默认值: `false`
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
|
||||
启用[封面页](zh-cn/cover.md)。开启后是加载 `_coverpage.md` 文件,也可以自定义文件名。
|
||||
|
||||
@@ -188,9 +175,21 @@ window.$docsify = {
|
||||
};
|
||||
```
|
||||
|
||||
## logo
|
||||
|
||||
- Type: `String`
|
||||
|
||||
Website logo as it appears in the sidebar, you can resize by CSS.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
logo: '/_media/icon.svg'
|
||||
};
|
||||
```
|
||||
|
||||
## name
|
||||
|
||||
* 类型:`String`
|
||||
- 类型:`String`
|
||||
|
||||
文档标题,会显示在侧边栏顶部。
|
||||
|
||||
@@ -202,8 +201,8 @@ window.$docsify = {
|
||||
|
||||
## nameLink
|
||||
|
||||
* 类型:`String`
|
||||
* 默认值:`window.location.pathname`
|
||||
- 类型:`String`
|
||||
- 默认值:`window.location.pathname`
|
||||
|
||||
点击文档标题后跳转的链接地址。
|
||||
|
||||
@@ -221,7 +220,7 @@ window.$docsify = {
|
||||
|
||||
## markdown
|
||||
|
||||
* 类型: `Object|Function`
|
||||
- 类型: `Object|Function`
|
||||
|
||||
参考 [Markdown 配置](zh-cn/markdown.md)。
|
||||
|
||||
@@ -247,7 +246,7 @@ window.$docsify = {
|
||||
|
||||
## themeColor
|
||||
|
||||
* 类型:`String`
|
||||
- 类型:`String`
|
||||
|
||||
替换主题色。利用 [CSS3 支持变量](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables)的特性,对于老的浏览器有 polyfill 处理。
|
||||
|
||||
@@ -259,7 +258,7 @@ window.$docsify = {
|
||||
|
||||
## alias
|
||||
|
||||
* 类型:`Object`
|
||||
- 类型:`Object`
|
||||
|
||||
定义路由别名,可以更自由的定义路由规则。 支持正则。
|
||||
|
||||
@@ -277,7 +276,7 @@ window.$docsify = {
|
||||
|
||||
## autoHeader
|
||||
|
||||
* 类型:`Boolean`
|
||||
- 类型:`Boolean`
|
||||
|
||||
同时设置 `loadSidebar` 和 `autoHeader` 后,可以根据 `_sidebar.md` 的内容自动为每个页面增加标题。[#78](https://github.com/QingWei-Li/docsify/issues/78)
|
||||
|
||||
@@ -290,7 +289,7 @@ window.$docsify = {
|
||||
|
||||
## executeScript
|
||||
|
||||
* 类型:`Boolean`
|
||||
- 类型:`Boolean`
|
||||
|
||||
执行文档里的 script 标签里的脚本,只执行第一个 script ([demo](zh-cn/themes.md))。 如果 Vue 存在,则自动开启。
|
||||
|
||||
@@ -312,7 +311,7 @@ window.$docsify = {
|
||||
|
||||
## noEmoji
|
||||
|
||||
* type: `Boolean`
|
||||
- type: `Boolean`
|
||||
|
||||
禁用 emoji 解析。
|
||||
|
||||
@@ -324,7 +323,7 @@ window.$docsify = {
|
||||
|
||||
## mergeNavbar
|
||||
|
||||
* type: `Boolean`
|
||||
- type: `Boolean`
|
||||
|
||||
小屏设备下合并导航栏到侧边栏。
|
||||
|
||||
@@ -336,7 +335,7 @@ window.$docsify = {
|
||||
|
||||
## formatUpdated
|
||||
|
||||
* type: `String|Function`
|
||||
- type: `String|Function`
|
||||
|
||||
我们可以显示文档更新日期通过 **{docsify-updated<span>}</span>** 变量. 并且格式化日期通过 `formatUpdated`。参考 https://github.com/lukeed/tinydate#patterns
|
||||
|
||||
@@ -354,8 +353,8 @@ window.$docsify = {
|
||||
|
||||
## externalLinkTarget
|
||||
|
||||
* type: `String`
|
||||
* default: `_blank`
|
||||
- type: `String`
|
||||
- default: `_blank`
|
||||
|
||||
当前默认为 \_blank, 配置一下就可以:
|
||||
|
||||
@@ -367,8 +366,8 @@ window.$docsify = {
|
||||
|
||||
## routerMode
|
||||
|
||||
* type: `String`
|
||||
* default: `history`
|
||||
- type: `String`
|
||||
- default: `history`
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -378,7 +377,7 @@ window.$docsify = {
|
||||
|
||||
## noCompileLinks
|
||||
|
||||
* 类型: `Array`
|
||||
- 类型: `Array`
|
||||
|
||||
有时我们不希望 docsify 处理我们的链接。 参考 [#203](https://github.com/QingWei-Li/docsify/issues/203)
|
||||
|
||||
@@ -390,7 +389,7 @@ window.$docsify = {
|
||||
|
||||
## requestHeaders
|
||||
|
||||
* type: `Object`
|
||||
- type: `Object`
|
||||
|
||||
设置请求资源的请求头。
|
||||
|
||||
@@ -404,7 +403,7 @@ window.$docsify = {
|
||||
|
||||
## ext
|
||||
|
||||
* type: `String`
|
||||
- type: `String`
|
||||
|
||||
资源的文件扩展名。
|
||||
|
||||
@@ -416,15 +415,15 @@ window.$docsify = {
|
||||
|
||||
## fallbackLanguages
|
||||
|
||||
* type: `Array<string>`
|
||||
- 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.
|
||||
- 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 = {
|
||||
@@ -434,9 +433,10 @@ window.$docsify = {
|
||||
|
||||
## notFoundPage
|
||||
|
||||
* type: `Boolean` | `String` | `Object`
|
||||
- type: `Boolean` | `String` | `Object`
|
||||
|
||||
Load the `_404.md` file:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: true
|
||||
@@ -444,6 +444,7 @@ window.$docsify = {
|
||||
```
|
||||
|
||||
Load the customised path of the 404 page:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: 'my404.md'
|
||||
@@ -451,14 +452,14 @@ window.$docsify = {
|
||||
```
|
||||
|
||||
Load the right 404 page according to the localisation:
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
notFoundPage: {
|
||||
'/': '_404.md',
|
||||
'/de': 'de/_404.md',
|
||||
'/de': 'de/_404.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
|
||||
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ _\_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)
|
||||
@@ -61,4 +61,4 @@ _\_navbar.md_
|
||||
|
||||
效果图
|
||||
|
||||

|
||||

|
||||
|
||||
+17
-4
@@ -5,24 +5,24 @@
|
||||
## GitHub Pages
|
||||
|
||||
GitHub Pages 支持从三个地方读取文件
|
||||
|
||||
- `docs/` 目录
|
||||
- master 分支
|
||||
- gh-pages 分支
|
||||
|
||||
我们推荐直接将文档放在 `docs/` 目录下,在设置页面开启 **GitHub Pages** 功能并选择 `master branch /docs folder` 选项。
|
||||
|
||||

|
||||

|
||||
|
||||
!> 可以将文档放在根目录下,然后选择 **master 分支** 作为文档目录。
|
||||
|
||||
|
||||
## GitLab Pages
|
||||
|
||||
如果你正在部署你的主分支, 在 `.gitlab-ci.yml` 中包含以下脚本:
|
||||
|
||||
?> `.public` 的解决方法是这样的,`cp` 不会无限循环的将 `public/` 复制到自身。
|
||||
|
||||
``` YAML
|
||||
```YAML
|
||||
pages:
|
||||
stage: deploy
|
||||
script:
|
||||
@@ -38,7 +38,6 @@ pages:
|
||||
|
||||
!> 你可以用 `- cp -r docs/. public` 替换脚本, 如果 `./docs` 是你的 docsify 子文件夹。
|
||||
|
||||
|
||||
## VPS
|
||||
|
||||
和部署所有静态网站一样,只需将服务器的访问根目录设定为 `index.html` 文件。
|
||||
@@ -56,3 +55,17 @@ server {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Netlify
|
||||
|
||||
1. Login to your [Netlify](https://www.netlify.com/) account.
|
||||
2. In the [dashboard](https://app.netlify.com/) page, click **New site from Git**.
|
||||
3. Choose a repository where you store your docs, leave the **Build Command** area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`.
|
||||
|
||||
### HTML5 router
|
||||
|
||||
When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, populate a `\redirects` file in the docs directory and you're all set:
|
||||
|
||||
```sh
|
||||
/* /index.html 200
|
||||
```
|
||||
|
||||
@@ -5,14 +5,14 @@ docsify 4.6 开始支持嵌入任何类型的文件到文档里。你可以将
|
||||
这是一个嵌入 Markdown 文件的例子。
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include')
|
||||
[filename](../_media/example.md ':include')
|
||||
```
|
||||
|
||||
`example.md` 文件的内容将会直接显示在这里
|
||||
|
||||
[filename](_media/example.md ':include')
|
||||
[filename](../_media/example.md ':include')
|
||||
|
||||
你可以查看 [example.md](_media/example.md ':ignore') 原始内容对比效果。
|
||||
你可以查看 [example.md](../_media/example.md ':ignore') 原始内容对比效果。
|
||||
|
||||
通常情况下,这样的语法将会被当作链接处理。但是在 docsify 里,如果你添加一个 `:include` 选项,它就会被当作文件嵌入。
|
||||
|
||||
@@ -29,12 +29,12 @@ docsify 4.6 开始支持嵌入任何类型的文件到文档里。你可以将
|
||||
当然,你也可以强制设置嵌入类型。例如你想将 Markdown 文件当作一个 `code block` 嵌入。
|
||||
|
||||
```markdown
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
[filename](../_media/example.md ':include :type=code')
|
||||
```
|
||||
|
||||
你将得到
|
||||
|
||||
[filename](_media/example.md ':include :type=code')
|
||||
[filename](../_media/example.md ':include :type=code')
|
||||
|
||||
## 标签属性
|
||||
|
||||
@@ -53,11 +53,11 @@ docsify 4.6 开始支持嵌入任何类型的文件到文档里。你可以将
|
||||
如果是嵌入一个代码块,你可以设置高亮的语言,或者让它自动识别。这里是手动设置高亮语言
|
||||
|
||||
```markdown
|
||||
[](_media/example.html ':include :type=code text')
|
||||
[](../_media/example.html ':include :type=code text')
|
||||
```
|
||||
|
||||
⬇️
|
||||
|
||||
[](_media/example.html ':include :type=code text')
|
||||
[](../_media/example.html ':include :type=code text')
|
||||
|
||||
?> 如何高亮代码?你可以查看[这份文档](language-highlight.md).
|
||||
|
||||
+22
-12
@@ -56,17 +56,27 @@ docsify 扩展了一些 Markdown 语法,可以让文档更易读。
|
||||
## Github 任务列表
|
||||
|
||||
```md
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
- [ ] foo
|
||||
- bar
|
||||
- [x] baz
|
||||
- [] bam <~ not working
|
||||
- [ ] bim
|
||||
- [ ] lim
|
||||
```
|
||||
|
||||
* [ ] foo
|
||||
* bar
|
||||
* [x] baz
|
||||
* [] bam <~ not working
|
||||
* [ ] bim
|
||||
* [ ] lim
|
||||
- [ ] foo
|
||||
- bar
|
||||
- [x] baz
|
||||
- [] bam <~ not working
|
||||
- [ ] bim
|
||||
- [ ] lim
|
||||
|
||||
## Image resizing
|
||||
|
||||
```md
|
||||

|
||||

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

|
||||

|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Markdown 配置
|
||||
|
||||
内置的 Markdown 解析器是 [marked](https://github.com/chjj/marked),可以修改它的配置。同时可以直接配置 `renderer`。
|
||||
内置的 Markdown 解析器是 [marked](https://github.com/markedjs/marked),可以修改它的配置。同时可以直接配置 `renderer`。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -15,7 +15,7 @@ window.$docsify = {
|
||||
}
|
||||
```
|
||||
|
||||
?> 完整配置参数参考 [marked 文档](https://github.com/chjj/marked#options-1)
|
||||
?> 完整配置参数参考 [marked 文档](https://github.com/markedjs/marked#options-1)
|
||||
|
||||
当然也可以完全定制 Markdown 解析规则。
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
|
||||
|
||||
默认情况下,侧边栏会根据当前文档的标题生成目录。也可以设置文档链接,通过 Markdown 文件生成,效果如当前的文档的侧边栏。
|
||||
|
||||
首先配置 `loadSidebar` 选项,具体配置规则见[配置项#loadSidebar](configuration.md#loadsidebar)。
|
||||
首先配置 `loadSidebar` 选项,具体配置规则见[配置项#loadSidebar](zh-cn/configuration.md#loadsidebar)。
|
||||
|
||||
```html
|
||||
<script>
|
||||
|
||||
+19
-21
@@ -4,7 +4,6 @@
|
||||
|
||||
全文搜索插件会根据当前页面上的超链接获取文档内容,在 `localStorage` 内建立文档索引。默认过期时间为一天,当然我们可以自己指定需要缓存的文件列表或者配置过期时间。
|
||||
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = {
|
||||
@@ -91,7 +90,6 @@ When readers expand the demo box, the source code and description are shown ther
|
||||
|
||||
[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 风格的图片缩放插件. 基于 [medium-zoom](https://github.com/francoischalifour/medium-zoom)。
|
||||
@@ -100,41 +98,26 @@ Medium's 风格的图片缩放插件. 基于 [medium-zoom](https://github.com/fr
|
||||
<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()
|
||||
]
|
||||
}
|
||||
<script src="//unpkg.com/docsify-copy-code"></script>
|
||||
```
|
||||
|
||||
See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.
|
||||
|
||||
|
||||
|
||||
## Disqus
|
||||
|
||||
Disqus comments. https://disqus.com/
|
||||
@@ -148,10 +131,9 @@ Disqus comments. https://disqus.com/
|
||||
<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.
|
||||
[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">
|
||||
@@ -171,7 +153,7 @@ Disqus comments. https://disqus.com/
|
||||
</script>
|
||||
```
|
||||
|
||||
## Navigation
|
||||
## Pagination
|
||||
|
||||
Pagination for docsify. By [@imyelo](https://github.com/imyelo)
|
||||
|
||||
@@ -179,3 +161,19 @@ Pagination for docsify. By [@imyelo](https://github.com/imyelo)
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
||||
```
|
||||
|
||||
## Code Fund
|
||||
|
||||
帮你快速接入[Code Fund](https://codesponsor.io/)的[插件](https://github.com/njleonzhang/docsify-plugin-codefund), 由[@njleonzhang](https://github.com/njleonzhang)提供。
|
||||
|
||||
> Code Fund 以前叫 codesponsor
|
||||
|
||||
```
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
|
||||
window.$docsify = {
|
||||
plugins: [
|
||||
DocsifyCodefund.create('51d43327-eea3-4e27-bd44-e075e67a84fb') // 把这个id改成你的codefund id
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
@@ -54,3 +54,8 @@
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
## Other themes
|
||||
|
||||
- [docsify-themeable](https://jhildenbiddle.github.io/docsify-themeable/#/) A delightfully simple theme system for docsify.
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ '\n\n----\n\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
|
||||
+119
-87
@@ -60,70 +60,74 @@ function isFn(obj) {
|
||||
return typeof obj === 'function'
|
||||
}
|
||||
|
||||
var config = merge(
|
||||
{
|
||||
el: '#app',
|
||||
repo: '',
|
||||
maxLevel: 6,
|
||||
subMaxLevel: 0,
|
||||
loadSidebar: null,
|
||||
loadNavbar: null,
|
||||
homepage: 'README.md',
|
||||
coverpage: '',
|
||||
basePath: '',
|
||||
auto2top: false,
|
||||
name: '',
|
||||
themeColor: '',
|
||||
nameLink: window.location.pathname,
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: '',
|
||||
ext: '.md',
|
||||
mergeNavbar: false,
|
||||
formatUpdated: '',
|
||||
externalLinkTarget: '_blank',
|
||||
routerMode: 'hash',
|
||||
noCompileLinks: []
|
||||
},
|
||||
window.$docsify
|
||||
);
|
||||
function config () {
|
||||
var config = merge(
|
||||
{
|
||||
el: '#app',
|
||||
repo: '',
|
||||
maxLevel: 6,
|
||||
subMaxLevel: 0,
|
||||
loadSidebar: null,
|
||||
loadNavbar: null,
|
||||
homepage: 'README.md',
|
||||
coverpage: '',
|
||||
basePath: '',
|
||||
auto2top: false,
|
||||
name: '',
|
||||
themeColor: '',
|
||||
nameLink: window.location.pathname,
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: '',
|
||||
ext: '.md',
|
||||
mergeNavbar: false,
|
||||
formatUpdated: '',
|
||||
externalLinkTarget: '_blank',
|
||||
routerMode: 'hash',
|
||||
noCompileLinks: []
|
||||
},
|
||||
window.$docsify
|
||||
);
|
||||
|
||||
var script =
|
||||
document.currentScript ||
|
||||
[].slice
|
||||
.call(document.getElementsByTagName('script'))
|
||||
.filter(function (n) { return /docsify\./.test(n.src); })[0];
|
||||
var script =
|
||||
document.currentScript ||
|
||||
[].slice
|
||||
.call(document.getElementsByTagName('script'))
|
||||
.filter(function (n) { return /docsify\./.test(n.src); })[0];
|
||||
|
||||
if (script) {
|
||||
for (var prop in config) {
|
||||
if (hasOwn.call(config, prop)) {
|
||||
var val = script.getAttribute('data-' + hyphenate(prop));
|
||||
if (script) {
|
||||
for (var prop in config) {
|
||||
if (hasOwn.call(config, prop)) {
|
||||
var val = script.getAttribute('data-' + hyphenate(prop));
|
||||
|
||||
if (isPrimitive(val)) {
|
||||
config[prop] = val === '' ? true : val;
|
||||
if (isPrimitive(val)) {
|
||||
config[prop] = val === '' ? true : val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config.loadSidebar === true) {
|
||||
config.loadSidebar = '_sidebar' + config.ext;
|
||||
}
|
||||
if (config.loadNavbar === true) {
|
||||
config.loadNavbar = '_navbar' + config.ext;
|
||||
}
|
||||
if (config.coverpage === true) {
|
||||
config.coverpage = '_coverpage' + config.ext;
|
||||
}
|
||||
if (config.repo === true) {
|
||||
config.repo = '';
|
||||
}
|
||||
if (config.name === true) {
|
||||
config.name = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (config.loadSidebar === true) {
|
||||
config.loadSidebar = '_sidebar' + config.ext;
|
||||
}
|
||||
if (config.loadNavbar === true) {
|
||||
config.loadNavbar = '_navbar' + config.ext;
|
||||
}
|
||||
if (config.coverpage === true) {
|
||||
config.coverpage = '_coverpage' + config.ext;
|
||||
}
|
||||
if (config.repo === true) {
|
||||
config.repo = '';
|
||||
}
|
||||
if (config.name === true) {
|
||||
config.name = '';
|
||||
}
|
||||
}
|
||||
window.$docsify = config;
|
||||
|
||||
window.$docsify = config;
|
||||
return config
|
||||
}
|
||||
|
||||
function initLifecycle(vm) {
|
||||
var hooks = [
|
||||
@@ -339,7 +343,9 @@ function main(config) {
|
||||
'</button>' +
|
||||
'<aside class="sidebar">' +
|
||||
(config.name ?
|
||||
("<h1><a class=\"app-name-link\" data-nosearch>" + (config.name) + "</a></h1>") :
|
||||
("<h1><a class=\"app-name-link\" data-nosearch>" + (config.logo ?
|
||||
("<img alt=" + (config.name) + " src=" + (config.logo) + ">") :
|
||||
config.name) + "</a></h1>") :
|
||||
'') +
|
||||
'<div class="sidebar-nav"><!--sidebar--></div>' +
|
||||
'</aside>';
|
||||
@@ -3015,7 +3021,11 @@ Compiler.prototype.compileEmbed = function compileEmbed (href, title) {
|
||||
|
||||
if (config.include) {
|
||||
if (!isAbsolutePath(href)) {
|
||||
href = getPath(this.contentBase, href);
|
||||
href = getPath(
|
||||
this.contentBase,
|
||||
getParentPath(this.router.getCurrentPath()),
|
||||
href
|
||||
);
|
||||
}
|
||||
|
||||
var media;
|
||||
@@ -3112,7 +3122,7 @@ Compiler.prototype._initRenderer = function _initRenderer () {
|
||||
title = str;
|
||||
|
||||
if (
|
||||
!/:|(\/{2})/.test(href) &&
|
||||
!isAbsolutePath(href) &&
|
||||
!_self._matchNotCompileLink(href) &&
|
||||
!config.ignore
|
||||
) {
|
||||
@@ -3167,8 +3177,18 @@ Compiler.prototype._initRenderer = function _initRenderer () {
|
||||
attrs += " title=\"" + title + "\"";
|
||||
}
|
||||
|
||||
var size = config.size;
|
||||
if (size) {
|
||||
var sizes = size.split('x');
|
||||
if (sizes[1]) {
|
||||
attrs += 'width=' + sizes[0] + ' height=' + sizes[1];
|
||||
} else {
|
||||
attrs += 'width=' + sizes[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAbsolutePath(href)) {
|
||||
url = getPath(contentBase, href);
|
||||
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
|
||||
}
|
||||
|
||||
return ("<img src=\"" + url + "\"data-origin=\"" + href + "\" alt=\"" + text + "\"" + attrs + ">")
|
||||
@@ -3200,7 +3220,6 @@ Compiler.prototype.sidebar = function sidebar (text, level) {
|
||||
|
||||
if (text) {
|
||||
html = this.compile(text);
|
||||
html = html && html.match(/<ul[^>]*>([\s\S]+)<\/ul>/g)[0];
|
||||
} else {
|
||||
var tree$$1 = this.cacheTree[currentPath] || genTree(this.toc, level);
|
||||
html = tree(tree$$1, '<ul>');
|
||||
@@ -3484,7 +3503,7 @@ function highlight(path) {
|
||||
if (!last) {
|
||||
return
|
||||
}
|
||||
var li = nav[getNavKey(path, last.getAttribute('data-id'))];
|
||||
var li = nav[getNavKey(decodeURIComponent(path), last.getAttribute('data-id'))];
|
||||
|
||||
if (!li || li === active) {
|
||||
return
|
||||
@@ -3582,38 +3601,45 @@ function scroll2Top(offset) {
|
||||
var cached$1 = {};
|
||||
|
||||
function walkFetchEmbed(ref, cb) {
|
||||
var step = ref.step; if ( step === void 0 ) step = 0;
|
||||
var embedTokens = ref.embedTokens;
|
||||
var compile = ref.compile;
|
||||
var fetch = ref.fetch;
|
||||
|
||||
var token = embedTokens[step];
|
||||
var token;
|
||||
var step = 0;
|
||||
var count = 1;
|
||||
|
||||
if (!token) {
|
||||
if (!embedTokens.length) {
|
||||
return cb({})
|
||||
}
|
||||
|
||||
var next = function (text) {
|
||||
var embedToken;
|
||||
if (text) {
|
||||
if (token.embed.type === 'markdown') {
|
||||
embedToken = compile.lexer(text);
|
||||
} else if (token.embed.type === 'code') {
|
||||
embedToken = compile.lexer(
|
||||
'```' +
|
||||
token.embed.lang +
|
||||
'\n' +
|
||||
text.replace(/`/g, '@DOCSIFY_QM@') +
|
||||
'\n```\n'
|
||||
);
|
||||
while ((token = embedTokens[step++])) {
|
||||
var next = (function (token) {
|
||||
return function (text) {
|
||||
var embedToken;
|
||||
if (text) {
|
||||
if (token.embed.type === 'markdown') {
|
||||
embedToken = compile.lexer(text);
|
||||
} else if (token.embed.type === 'code') {
|
||||
embedToken = compile.lexer(
|
||||
'```' +
|
||||
token.embed.lang +
|
||||
'\n' +
|
||||
text.replace(/`/g, '@DOCSIFY_QM@') +
|
||||
'\n```\n'
|
||||
);
|
||||
}
|
||||
}
|
||||
cb({token: token, embedToken: embedToken});
|
||||
if (++count >= step) {
|
||||
cb({});
|
||||
}
|
||||
}
|
||||
}
|
||||
cb({token: token, embedToken: embedToken});
|
||||
walkFetchEmbed({step: ++step, compile: compile, embedTokens: embedTokens, fetch: fetch}, cb);
|
||||
};
|
||||
})(token);
|
||||
|
||||
{
|
||||
get(token.embed.url).then(next);
|
||||
{
|
||||
get(token.embed.url).then(next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3698,7 +3724,9 @@ function formatUpdated(html, updated, fn) {
|
||||
updated =
|
||||
typeof fn === 'function' ?
|
||||
fn(updated) :
|
||||
typeof fn === 'string' ? tinydate(fn)(new Date(updated)) : updated;
|
||||
typeof fn === 'string' ?
|
||||
tinydate(fn)(new Date(updated)) :
|
||||
updated;
|
||||
|
||||
return html.replace(/{docsify-updated}/g, updated)
|
||||
}
|
||||
@@ -3903,6 +3931,10 @@ function initRender(vm) {
|
||||
html += cover();
|
||||
}
|
||||
|
||||
if (config.logo) {
|
||||
config.logo = getPath(vm.router.getBasePath(), config.logo);
|
||||
}
|
||||
|
||||
html += main(config);
|
||||
// Render main app
|
||||
vm._renderTo(el, html, true);
|
||||
@@ -4490,7 +4522,7 @@ function initFetch(vm) {
|
||||
function initMixin(proto) {
|
||||
proto._init = function () {
|
||||
var vm = this;
|
||||
vm.config = config || {};
|
||||
vm.config = config();
|
||||
|
||||
initLifecycle(vm); // Init hooks
|
||||
initPlugin(vm); // Install plugins
|
||||
@@ -4569,7 +4601,7 @@ initGlobalAPI();
|
||||
/**
|
||||
* Version
|
||||
*/
|
||||
Docsify.version = '4.6.7';
|
||||
Docsify.version = '4.7.0';
|
||||
|
||||
/**
|
||||
* Run Docsify
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -485,7 +485,7 @@ var install = function (hook, vm) {
|
||||
var attributes = ref.attributes;
|
||||
var body = ref.body;
|
||||
|
||||
Docsify.util.merge(vm.config, attributes.config);
|
||||
vm.frontmatter = attributes;
|
||||
|
||||
return body
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
!function(){var e=[],n=[],t=0,r={regLevel:new RegExp("^([\\s\\-]+)"),invalidLine:new RegExp("^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$"),dashesString:new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'),quotesString:new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"),float:new RegExp("^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$"),integer:new RegExp("^[+-]?[0-9]+$"),array:new RegExp("\\[\\s*(.*)\\s*\\]"),map:new RegExp("\\{\\s*(.*)\\s*\\}"),key_value:new RegExp("([a-z0-9_-][ a-z0-9_-]*):( .+)","i"),single_key_value:new RegExp("^([a-z0-9_-][ a-z0-9_-]*):( .+?)$","i"),key:new RegExp("([a-z0-9_-][ a-z0-9_-]+):( .+)?","i"),item:new RegExp("^-\\s+"),trim:new RegExp("^\\s+|\\s+$"),comment:new RegExp("([^\\'\\\"#]+([\\'\\\"][^\\'\\\"]*[\\'\\\"])*)*(#.*)?")};function i(e){return{parent:null,length:0,level:e,lines:[],children:[],addChild:function(e){this.children.push(e),e.parent=this,++this.length}}}function l(e){var n=null;if("true"==(e=e.replace(r.trim,"")))return!0;if("false"==e)return!1;if(".NaN"==e)return Number.NaN;if("null"==e)return null;if(".inf"==e)return Number.POSITIVE_INFINITY;if("-.inf"==e)return Number.NEGATIVE_INFINITY;if(n=e.match(r.dashesString))return n[1];if(n=e.match(r.quotesString))return n[1];if(n=e.match(r.float))return parseFloat(n[0]);if(n=e.match(r.integer))return parseInt(n[0]);if(isNaN(n=Date.parse(e))){if(n=e.match(r.single_key_value)){return(u={})[n[1]]=l(n[2]),u}if(n=e.match(r.array)){for(var t=0,i=" ",u=[],a="",s=!1,f=0,h=n[1].length;f<h;++f){if("'"==(i=n[1][f])||'"'==i){if(!1===s){s=i,a+=i;continue}if("'"==i&&"'"==s||'"'==i&&'"'==s){s=!1,a+=i;continue}}else if(!1!==s||"["!=i&&"{"!=i)if(!1!==s||"]"!=i&&"}"!=i){if(!1===s&&0==t&&","==i){u.push(l(a)),a="";continue}}else--t;else++t;a+=i}return a.length>0&&u.push(l(a)),u}if(n=e.match(r.map)){for(t=0,i=" ",u=[],a="",s=!1,f=0,h=n[1].length;f<h;++f){if("'"==(i=n[1][f])||'"'==i){if(!1===s){s=i,a+=i;continue}if("'"==i&&"'"==s||'"'==i&&'"'==s){s=!1,a+=i;continue}}else if(!1!==s||"["!=i&&"{"!=i)if(!1!==s||"]"!=i&&"}"!=i){if(!1===s&&0==t&&","==i){u.push(a),a="";continue}}else--t;else++t;a+=i}a.length>0&&u.push(a);var o={};for(f=0,h=u.length;f<h;++f)(n=u[f].match(r.key_value))&&(o[n[1]]=l(n[2]));return o}return e}return new Date(n)}function u(e){for(var n=e.lines,t=e.children,r=[n.join(" ")],i=0,l=t.length;i<l;++i)r.push(u(t[i]));return r.join("\n")}function a(e){for(var n=e.lines,t=e.children,r=n.join("\n"),i=0,l=t.length;i<l;++i)r+=a(t[i]);return r}function s(t){return function t(i){for(var s=null,f={},h=null,o=null,c=null,p=-1,g=[],v=!0,d=0,m=i.length;d<m;++d)if(-1==p||p==i[d].level){g.push(d),p=i[d].level,h=i[d].lines,o=i[d].children,c=null;for(var w=0,E=h.length;w<E;++w){var x=h[w];if(s=x.match(r.key)){var y=s[1];if("-"==y[0]&&(y=y.replace(r.item,""),v&&(v=!1,void 0===f.length&&(f=[])),null!=c&&f.push(c),c={},v=!0),void 0!==s[2]){var b=s[2].replace(r.trim,"");if("&"==b[0]){var R=t(o);null!=c?c[y]=R:f[y]=R,n[b.substr(1)]=R}else if("|"==b[0])null!=c?c[y]=a(o.shift()):f[y]=a(o.shift());else if("*"==b[0]){var N=b.substr(1),_={};if(void 0===n[N])e.push("Reference '"+N+"' not found!");else{for(var $ in n[N])_[$]=n[N][$];null!=c?c[y]=_:f[y]=_}}else">"==b[0]?null!=c?c[y]=u(o.shift()):f[y]=u(o.shift()):null!=c?c[y]=l(b):f[y]=l(b)}else null!=c?c[y]=t(o):f[y]=t(o)}else{if(x.match(/^-\s*$/)){v&&(v=!1,void 0===f.length&&(f=[])),null!=c&&f.push(c),c={},v=!0;continue}if(s=x.match(/^-\s*(.*)/)){null!=c?c.push(l(s[1])):(v&&(v=!1,void 0===f.length&&(f=[])),f.push(l(s[1])));continue}}}null!=c&&(v&&(v=!1,void 0===f.length&&(f=[])),f.push(c))}for(d=g.length-1;d>=0;--d)i.splice.call(i,g[d],1);return f}(t.children)}function f(l){e=[],n=[],t=(new Date).getTime();var u=s(function(n){var t,l=r.regLevel,u=r.invalidLine,a=n.split("\n"),s=0,f=0,h=[],o=new i(-1),c=new i(0);o.addChild(c);var p=[],g="";h.push(c),p.push(s);for(var v=0,d=a.length;v<d;++v)if(!(g=a[v]).match(u)){if((s=(t=l.exec(g))?t[1].length:0)>f){var m=c;c=new i(s),m.addChild(c),h.push(c),p.push(s)}else if(s<f){for(var w=!1,E=p.length-1;E>=0;--E)if(p[E]==s){c=new i(s),h.push(c),p.push(s),null!=h[E].parent&&h[E].parent.addChild(c),w=!0;break}if(!w)return void e.push("Error: Invalid indentation at line "+v+": "+g)}c.lines.push(g.replace(r.trim,"")),f=s}return o}(function(e){var n,t=e.split("\n"),i=r.comment;for(var l in t)(n=t[l].match(i))&&void 0!==n[3]&&(t[l]=n[0].substr(0,n[0].length-n[3].length));return t.join("\n")}(l)));return t=(new Date).getTime()-t,u}var h=new RegExp("^(\\ufeff?(= yaml =|---)$([\\s\\S]*?)(?:\\2|\\.\\.\\.)$(?:\\n)?)","m");function o(e){var n=(e=e||"").split(/(\r?\n)/);return n[0]&&/= yaml =|---/.test(n[0])?function(e){var n=h.exec(e);if(!n)return{attributes:{},body:e};var t=n[n.length-1].replace(/^\s+|\s+$/g,""),r=f(t)||{},i=e.replace(n[0],"");return{attributes:r,body:i,frontmatter:t}}(e):{attributes:{},body:e}}$docsify.plugins=[].concat(function(e,n){e.beforeEach(function(e){var t=o(e),r=t.attributes,i=t.body;return Docsify.util.merge(n.config,r.config),i})},$docsify.plugins)}();
|
||||
!function(){var e=[],n=[],t=0,r={regLevel:new RegExp("^([\\s\\-]+)"),invalidLine:new RegExp("^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$"),dashesString:new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'),quotesString:new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"),float:new RegExp("^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$"),integer:new RegExp("^[+-]?[0-9]+$"),array:new RegExp("\\[\\s*(.*)\\s*\\]"),map:new RegExp("\\{\\s*(.*)\\s*\\}"),key_value:new RegExp("([a-z0-9_-][ a-z0-9_-]*):( .+)","i"),single_key_value:new RegExp("^([a-z0-9_-][ a-z0-9_-]*):( .+?)$","i"),key:new RegExp("([a-z0-9_-][ a-z0-9_-]+):( .+)?","i"),item:new RegExp("^-\\s+"),trim:new RegExp("^\\s+|\\s+$"),comment:new RegExp("([^\\'\\\"#]+([\\'\\\"][^\\'\\\"]*[\\'\\\"])*)*(#.*)?")};function i(e){return{parent:null,length:0,level:e,lines:[],children:[],addChild:function(e){this.children.push(e),e.parent=this,++this.length}}}function l(e){var n=null;if("true"==(e=e.replace(r.trim,"")))return!0;if("false"==e)return!1;if(".NaN"==e)return Number.NaN;if("null"==e)return null;if(".inf"==e)return Number.POSITIVE_INFINITY;if("-.inf"==e)return Number.NEGATIVE_INFINITY;if(n=e.match(r.dashesString))return n[1];if(n=e.match(r.quotesString))return n[1];if(n=e.match(r.float))return parseFloat(n[0]);if(n=e.match(r.integer))return parseInt(n[0]);if(isNaN(n=Date.parse(e))){if(n=e.match(r.single_key_value)){return(u={})[n[1]]=l(n[2]),u}if(n=e.match(r.array)){for(var t=0,i=" ",u=[],a="",s=!1,f=0,h=n[1].length;f<h;++f){if("'"==(i=n[1][f])||'"'==i){if(!1===s){s=i,a+=i;continue}if("'"==i&&"'"==s||'"'==i&&'"'==s){s=!1,a+=i;continue}}else if(!1!==s||"["!=i&&"{"!=i)if(!1!==s||"]"!=i&&"}"!=i){if(!1===s&&0==t&&","==i){u.push(l(a)),a="";continue}}else--t;else++t;a+=i}return a.length>0&&u.push(l(a)),u}if(n=e.match(r.map)){for(t=0,i=" ",u=[],a="",s=!1,f=0,h=n[1].length;f<h;++f){if("'"==(i=n[1][f])||'"'==i){if(!1===s){s=i,a+=i;continue}if("'"==i&&"'"==s||'"'==i&&'"'==s){s=!1,a+=i;continue}}else if(!1!==s||"["!=i&&"{"!=i)if(!1!==s||"]"!=i&&"}"!=i){if(!1===s&&0==t&&","==i){u.push(a),a="";continue}}else--t;else++t;a+=i}a.length>0&&u.push(a);var o={};for(f=0,h=u.length;f<h;++f)(n=u[f].match(r.key_value))&&(o[n[1]]=l(n[2]));return o}return e}return new Date(n)}function u(e){for(var n=e.lines,t=e.children,r=[n.join(" ")],i=0,l=t.length;i<l;++i)r.push(u(t[i]));return r.join("\n")}function a(e){for(var n=e.lines,t=e.children,r=n.join("\n"),i=0,l=t.length;i<l;++i)r+=a(t[i]);return r}function s(t){return function t(i){for(var s=null,f={},h=null,o=null,c=null,p=-1,g=[],v=!0,d=0,m=i.length;d<m;++d)if(-1==p||p==i[d].level){g.push(d),p=i[d].level,h=i[d].lines,o=i[d].children,c=null;for(var w=0,E=h.length;w<E;++w){var x=h[w];if(s=x.match(r.key)){var b=s[1];if("-"==b[0]&&(b=b.replace(r.item,""),v&&(v=!1,void 0===f.length&&(f=[])),null!=c&&f.push(c),c={},v=!0),void 0!==s[2]){var y=s[2].replace(r.trim,"");if("&"==y[0]){var R=t(o);null!=c?c[b]=R:f[b]=R,n[y.substr(1)]=R}else if("|"==y[0])null!=c?c[b]=a(o.shift()):f[b]=a(o.shift());else if("*"==y[0]){var N=y.substr(1),_={};if(void 0===n[N])e.push("Reference '"+N+"' not found!");else{for(var $ in n[N])_[$]=n[N][$];null!=c?c[b]=_:f[b]=_}}else">"==y[0]?null!=c?c[b]=u(o.shift()):f[b]=u(o.shift()):null!=c?c[b]=l(y):f[b]=l(y)}else null!=c?c[b]=t(o):f[b]=t(o)}else{if(x.match(/^-\s*$/)){v&&(v=!1,void 0===f.length&&(f=[])),null!=c&&f.push(c),c={},v=!0;continue}if(s=x.match(/^-\s*(.*)/)){null!=c?c.push(l(s[1])):(v&&(v=!1,void 0===f.length&&(f=[])),f.push(l(s[1])));continue}}}null!=c&&(v&&(v=!1,void 0===f.length&&(f=[])),f.push(c))}for(d=g.length-1;d>=0;--d)i.splice.call(i,g[d],1);return f}(t.children)}function f(l){e=[],n=[],t=(new Date).getTime();var u=s(function(n){var t,l=r.regLevel,u=r.invalidLine,a=n.split("\n"),s=0,f=0,h=[],o=new i(-1),c=new i(0);o.addChild(c);var p=[],g="";h.push(c),p.push(s);for(var v=0,d=a.length;v<d;++v)if(!(g=a[v]).match(u)){if((s=(t=l.exec(g))?t[1].length:0)>f){var m=c;c=new i(s),m.addChild(c),h.push(c),p.push(s)}else if(s<f){for(var w=!1,E=p.length-1;E>=0;--E)if(p[E]==s){c=new i(s),h.push(c),p.push(s),null!=h[E].parent&&h[E].parent.addChild(c),w=!0;break}if(!w)return void e.push("Error: Invalid indentation at line "+v+": "+g)}c.lines.push(g.replace(r.trim,"")),f=s}return o}(function(e){var n,t=e.split("\n"),i=r.comment;for(var l in t)(n=t[l].match(i))&&void 0!==n[3]&&(t[l]=n[0].substr(0,n[0].length-n[3].length));return t.join("\n")}(l)));return t=(new Date).getTime()-t,u}var h=new RegExp("^(\\ufeff?(= yaml =|---)$([\\s\\S]*?)(?:\\2|\\.\\.\\.)$(?:\\n)?)","m");function o(e){var n=(e=e||"").split(/(\r?\n)/);return n[0]&&/= yaml =|---/.test(n[0])?function(e){var n=h.exec(e);if(!n)return{attributes:{},body:e};var t=n[n.length-1].replace(/^\s+|\s+$/g,""),r=f(t)||{},i=e.replace(n[0],"");return{attributes:r,body:i,frontmatter:t}}(e):{attributes:{},body:e}}$docsify.plugins=[].concat(function(e,n){e.beforeEach(function(e){var t=o(e),r=t.attributes,i=t.body;return n.frontmatter=r,i})},$docsify.plugins)}();
|
||||
|
||||
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
Generated
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "4.6.7",
|
||||
"version": "4.7.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -5019,9 +5019,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"medium-zoom": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-0.3.0.tgz",
|
||||
"integrity": "sha512-26CJAykAcm1IYx2XjUB04dmZ7iRLtyTDKZSrm5kEqHJWVMo7pafUZEPcRGvYCNWW4f1utlEOzbtbaOvwNg7g1g=="
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-0.4.0.tgz",
|
||||
"integrity": "sha512-0z7yMfd6I1BTCAa8QaR4cp5AqDkQD571GzhHIbbfefKEssGLSvs+4Xai/itOAncm4FBlF5gUoMQ22yW9/f8Sig=="
|
||||
},
|
||||
"mem": {
|
||||
"version": "1.1.0",
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "4.6.7",
|
||||
"version": "4.7.0",
|
||||
"description": "A magical documentation generator.",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
@@ -14,6 +14,7 @@
|
||||
"url": "git+https://github.com/QingWei-Li/docsify.git"
|
||||
},
|
||||
"main": "lib/docsify.js",
|
||||
"unpkg": "lib/docsify.min.js",
|
||||
"files": [
|
||||
"lib",
|
||||
"src",
|
||||
@@ -42,7 +43,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"marked": "^0.3.12",
|
||||
"medium-zoom": "^0.3.0",
|
||||
"medium-zoom": "^0.4.0",
|
||||
"opencollective": "^1.0.3",
|
||||
"prismjs": "^1.9.0",
|
||||
"tinydate": "^1.0.0",
|
||||
|
||||
+1
-1
@@ -37,5 +37,5 @@
|
||||
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
||||
}
|
||||
},
|
||||
"version": "4.6.7"
|
||||
"version": "4.7.0"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify-server-renderer",
|
||||
"version": "4.6.7",
|
||||
"version": "4.7.0",
|
||||
"description": "docsify server renderer",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
|
||||
+60
-58
@@ -1,68 +1,70 @@
|
||||
import {merge, hyphenate, isPrimitive, hasOwn} from './util/core'
|
||||
|
||||
const config = merge(
|
||||
{
|
||||
el: '#app',
|
||||
repo: '',
|
||||
maxLevel: 6,
|
||||
subMaxLevel: 0,
|
||||
loadSidebar: null,
|
||||
loadNavbar: null,
|
||||
homepage: 'README.md',
|
||||
coverpage: '',
|
||||
basePath: '',
|
||||
auto2top: false,
|
||||
name: '',
|
||||
themeColor: '',
|
||||
nameLink: window.location.pathname,
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: '',
|
||||
ext: '.md',
|
||||
mergeNavbar: false,
|
||||
formatUpdated: '',
|
||||
externalLinkTarget: '_blank',
|
||||
routerMode: 'hash',
|
||||
noCompileLinks: []
|
||||
},
|
||||
window.$docsify
|
||||
)
|
||||
export default function () {
|
||||
const config = merge(
|
||||
{
|
||||
el: '#app',
|
||||
repo: '',
|
||||
maxLevel: 6,
|
||||
subMaxLevel: 0,
|
||||
loadSidebar: null,
|
||||
loadNavbar: null,
|
||||
homepage: 'README.md',
|
||||
coverpage: '',
|
||||
basePath: '',
|
||||
auto2top: false,
|
||||
name: '',
|
||||
themeColor: '',
|
||||
nameLink: window.location.pathname,
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: '',
|
||||
ext: '.md',
|
||||
mergeNavbar: false,
|
||||
formatUpdated: '',
|
||||
externalLinkTarget: '_blank',
|
||||
routerMode: 'hash',
|
||||
noCompileLinks: []
|
||||
},
|
||||
window.$docsify
|
||||
)
|
||||
|
||||
const script =
|
||||
document.currentScript ||
|
||||
[].slice
|
||||
.call(document.getElementsByTagName('script'))
|
||||
.filter(n => /docsify\./.test(n.src))[0]
|
||||
const script =
|
||||
document.currentScript ||
|
||||
[].slice
|
||||
.call(document.getElementsByTagName('script'))
|
||||
.filter(n => /docsify\./.test(n.src))[0]
|
||||
|
||||
if (script) {
|
||||
for (const prop in config) {
|
||||
if (hasOwn.call(config, prop)) {
|
||||
const val = script.getAttribute('data-' + hyphenate(prop))
|
||||
if (script) {
|
||||
for (const prop in config) {
|
||||
if (hasOwn.call(config, prop)) {
|
||||
const val = script.getAttribute('data-' + hyphenate(prop))
|
||||
|
||||
if (isPrimitive(val)) {
|
||||
config[prop] = val === '' ? true : val
|
||||
if (isPrimitive(val)) {
|
||||
config[prop] = val === '' ? true : val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config.loadSidebar === true) {
|
||||
config.loadSidebar = '_sidebar' + config.ext
|
||||
}
|
||||
if (config.loadNavbar === true) {
|
||||
config.loadNavbar = '_navbar' + config.ext
|
||||
}
|
||||
if (config.coverpage === true) {
|
||||
config.coverpage = '_coverpage' + config.ext
|
||||
}
|
||||
if (config.repo === true) {
|
||||
config.repo = ''
|
||||
}
|
||||
if (config.name === true) {
|
||||
config.name = ''
|
||||
}
|
||||
}
|
||||
|
||||
if (config.loadSidebar === true) {
|
||||
config.loadSidebar = '_sidebar' + config.ext
|
||||
}
|
||||
if (config.loadNavbar === true) {
|
||||
config.loadNavbar = '_navbar' + config.ext
|
||||
}
|
||||
if (config.coverpage === true) {
|
||||
config.coverpage = '_coverpage' + config.ext
|
||||
}
|
||||
if (config.repo === true) {
|
||||
config.repo = ''
|
||||
}
|
||||
if (config.name === true) {
|
||||
config.name = ''
|
||||
}
|
||||
window.$docsify = config
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
window.$docsify = config
|
||||
|
||||
export default config
|
||||
|
||||
@@ -53,7 +53,7 @@ function highlight(path) {
|
||||
if (!last) {
|
||||
return
|
||||
}
|
||||
const li = nav[getNavKey(path, last.getAttribute('data-id'))]
|
||||
const li = nav[getNavKey(decodeURIComponent(path), last.getAttribute('data-id'))]
|
||||
|
||||
if (!li || li === active) {
|
||||
return
|
||||
|
||||
@@ -9,7 +9,7 @@ import {isFn} from '../util/core'
|
||||
export function initMixin(proto) {
|
||||
proto._init = function () {
|
||||
const vm = this
|
||||
vm.config = config || {}
|
||||
vm.config = config()
|
||||
|
||||
initLifecycle(vm) // Init hooks
|
||||
initPlugin(vm) // Install plugins
|
||||
|
||||
@@ -4,7 +4,7 @@ import {helper as helperTpl, tree as treeTpl} from './tpl'
|
||||
import {genTree} from './gen-tree'
|
||||
import {slugify} from './slugify'
|
||||
import {emojify} from './emojify'
|
||||
import {isAbsolutePath, getPath} from '../router/util'
|
||||
import {isAbsolutePath, getPath, getParentPath} from '../router/util'
|
||||
import {isFn, merge, cached, isPrimitive} from '../util/core'
|
||||
|
||||
const cachedLinks = {}
|
||||
@@ -112,7 +112,11 @@ export class Compiler {
|
||||
|
||||
if (config.include) {
|
||||
if (!isAbsolutePath(href)) {
|
||||
href = getPath(process.env.SSR ? '' : this.contentBase, href)
|
||||
href = getPath(
|
||||
process.env.SSR ? '' : this.contentBase,
|
||||
getParentPath(this.router.getCurrentPath()),
|
||||
href
|
||||
)
|
||||
}
|
||||
|
||||
let media
|
||||
@@ -200,7 +204,7 @@ export class Compiler {
|
||||
title = str
|
||||
|
||||
if (
|
||||
!/:|(\/{2})/.test(href) &&
|
||||
!isAbsolutePath(href) &&
|
||||
!_self._matchNotCompileLink(href) &&
|
||||
!config.ignore
|
||||
) {
|
||||
@@ -253,8 +257,18 @@ export class Compiler {
|
||||
attrs += ` title="${title}"`
|
||||
}
|
||||
|
||||
const size = config.size
|
||||
if (size) {
|
||||
const sizes = size.split('x')
|
||||
if (sizes[1]) {
|
||||
attrs += 'width=' + sizes[0] + ' height=' + sizes[1]
|
||||
} else {
|
||||
attrs += 'width=' + sizes[0]
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAbsolutePath(href)) {
|
||||
url = getPath(contentBase, href)
|
||||
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href)
|
||||
}
|
||||
|
||||
return `<img src="${url}"data-origin="${href}" alt="${text}"${attrs}>`
|
||||
@@ -286,7 +300,6 @@ export class Compiler {
|
||||
|
||||
if (text) {
|
||||
html = this.compile(text)
|
||||
html = html && html.match(/<ul[^>]*>([\s\S]+)<\/ul>/g)[0]
|
||||
} else {
|
||||
const tree = this.cacheTree[currentPath] || genTree(this.toc, level)
|
||||
html = treeTpl(tree, '<ul>')
|
||||
|
||||
+32
-24
@@ -3,36 +3,44 @@ import {merge} from '../util/core'
|
||||
|
||||
const cached = {}
|
||||
|
||||
function walkFetchEmbed({step = 0, embedTokens, compile, fetch}, cb) {
|
||||
const token = embedTokens[step]
|
||||
function walkFetchEmbed({embedTokens, compile, fetch}, cb) {
|
||||
let token
|
||||
let step = 0
|
||||
let count = 1
|
||||
|
||||
if (!token) {
|
||||
if (!embedTokens.length) {
|
||||
return cb({})
|
||||
}
|
||||
|
||||
const next = text => {
|
||||
let embedToken
|
||||
if (text) {
|
||||
if (token.embed.type === 'markdown') {
|
||||
embedToken = compile.lexer(text)
|
||||
} else if (token.embed.type === 'code') {
|
||||
embedToken = compile.lexer(
|
||||
'```' +
|
||||
token.embed.lang +
|
||||
'\n' +
|
||||
text.replace(/`/g, '@DOCSIFY_QM@') +
|
||||
'\n```\n'
|
||||
)
|
||||
while ((token = embedTokens[step++])) {
|
||||
const next = (function (token) {
|
||||
return text => {
|
||||
let embedToken
|
||||
if (text) {
|
||||
if (token.embed.type === 'markdown') {
|
||||
embedToken = compile.lexer(text)
|
||||
} else if (token.embed.type === 'code') {
|
||||
embedToken = compile.lexer(
|
||||
'```' +
|
||||
token.embed.lang +
|
||||
'\n' +
|
||||
text.replace(/`/g, '@DOCSIFY_QM@') +
|
||||
'\n```\n'
|
||||
)
|
||||
}
|
||||
}
|
||||
cb({token, embedToken})
|
||||
if (++count >= step) {
|
||||
cb({})
|
||||
}
|
||||
}
|
||||
}
|
||||
cb({token, embedToken})
|
||||
walkFetchEmbed({step: ++step, compile, embedTokens, fetch}, cb)
|
||||
}
|
||||
})(token)
|
||||
|
||||
if (process.env.SSR) {
|
||||
fetch(token.embed.url).then(next)
|
||||
} else {
|
||||
get(token.embed.url).then(next)
|
||||
if (process.env.SSR) {
|
||||
fetch(token.embed.url).then(next)
|
||||
} else {
|
||||
get(token.embed.url).then(next)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ function formatUpdated(html, updated, fn) {
|
||||
updated =
|
||||
typeof fn === 'function' ?
|
||||
fn(updated) :
|
||||
typeof fn === 'string' ? tinydate(fn)(new Date(updated)) : updated
|
||||
typeof fn === 'string' ?
|
||||
tinydate(fn)(new Date(updated)) :
|
||||
updated
|
||||
|
||||
return html.replace(/{docsify-updated}/g, updated)
|
||||
}
|
||||
@@ -229,6 +231,10 @@ export function initRender(vm) {
|
||||
html += tpl.cover()
|
||||
}
|
||||
|
||||
if (config.logo) {
|
||||
config.logo = getPath(vm.router.getBasePath(), config.logo)
|
||||
}
|
||||
|
||||
html += tpl.main(config)
|
||||
// Render main app
|
||||
vm._renderTo(el, html, true)
|
||||
|
||||
@@ -36,7 +36,11 @@ export function main(config) {
|
||||
'</button>' +
|
||||
'<aside class="sidebar">' +
|
||||
(config.name ?
|
||||
`<h1><a class="app-name-link" data-nosearch>${config.name}</a></h1>` :
|
||||
`<h1><a class="app-name-link" data-nosearch>${
|
||||
config.logo ?
|
||||
`<img alt=${config.name} src=${config.logo}>` :
|
||||
config.name
|
||||
}</a></h1>` :
|
||||
'') +
|
||||
'<div class="sidebar-nav"><!--sidebar--></div>' +
|
||||
'</aside>'
|
||||
|
||||
@@ -4,7 +4,7 @@ const install = function (hook, vm) {
|
||||
hook.beforeEach(content => {
|
||||
const {attributes, body} = parser(content)
|
||||
|
||||
Docsify.util.merge(vm.config, attributes.config)
|
||||
vm.frontmatter = attributes
|
||||
|
||||
return body
|
||||
})
|
||||
|
||||
@@ -112,6 +112,7 @@ $sidebar-width = 16rem
|
||||
padding 0 10px 12px 0
|
||||
overflow auto
|
||||
word-wrap normal
|
||||
position relative
|
||||
|
||||
/* code highlight */
|
||||
.token.cdata, .token.comment, .token.doctype, .token.prolog
|
||||
|
||||
Reference in New Issue
Block a user