mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 21:36:10 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25ccc79e56 | ||
|
|
890d29f982 | ||
|
|
76c041ad48 | ||
|
|
2c277b8f79 | ||
|
|
a5f6ccd1d1 | ||
|
|
11c94b2149 | ||
|
|
2653849a3e | ||
|
|
d7b0d1b949 | ||
|
|
6911fb879b | ||
|
|
137a93c7b2 | ||
|
|
5d5caa1f89 | ||
|
|
1dfd6cdcfe | ||
|
|
91c6db2902 | ||
|
|
94d6603c06 | ||
|
|
920f624b5c | ||
|
|
8fb1350728 | ||
|
|
c1df94662a | ||
|
|
9b7e5f5814 | ||
|
|
432bcfb54b | ||
|
|
4f98497284 | ||
|
|
9220523a40 | ||
|
|
b8100c0755 | ||
|
|
be0230ebe9 | ||
|
|
aa6d2afce8 | ||
|
|
a706203879 | ||
|
|
fbc75bdb95 | ||
|
|
5af174bd20 | ||
|
|
e70327ab2b | ||
|
|
7209b82982 | ||
|
|
594299ffbd | ||
|
|
e9bbfd4c53 | ||
|
|
96bc09211e | ||
|
|
8f11653b41 | ||
|
|
6aae64fd54 | ||
|
|
33b7c512bb | ||
|
|
bf35471a2b | ||
|
|
b022aaf14e | ||
|
|
03d8281868 | ||
|
|
4a0cfa799e |
@@ -0,0 +1 @@
|
||||
.git/
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"extends": ["vue"],
|
||||
"extends": [
|
||||
"vue"
|
||||
],
|
||||
"env": {
|
||||
"browser": true
|
||||
},
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
.DS_Store
|
||||
*.log
|
||||
.DS_Store
|
||||
/themes
|
||||
node_modules
|
||||
/themes
|
||||
@@ -0,0 +1,5 @@
|
||||
.eslintignore
|
||||
.eslintrc
|
||||
.github/
|
||||
.gitignore
|
||||
.travis.yml
|
||||
+4
-1
@@ -1,6 +1,9 @@
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.yarn-cache
|
||||
- $HOME/.yarn-cache
|
||||
language: node_js
|
||||
node_js: stable
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
+57
-18
@@ -1,90 +1,129 @@
|
||||
# Changelog
|
||||
|
||||
# 3.4.4 / 2017-03-17
|
||||
## 3.6.4 / 2017-04-28
|
||||
|
||||
|
||||
* fix(util): correctly clean up duplicate slashes, fixed ([#153](https://github.com/QingWei-Li/docsify/issues/153)
|
||||
|
||||
## 3.6.3 / 2017-04-25
|
||||
|
||||
* fix(external-script): script attrs
|
||||
|
||||
## 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)
|
||||
|
||||
## 3.6.1 / 2017-04-09
|
||||
|
||||
* 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)
|
||||
|
||||
## 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))
|
||||
|
||||
## 3.5.1 / 2017-03-25
|
||||
|
||||
* fix: .md file extension regex
|
||||
|
||||
## 3.5.0 / 2017-03-25
|
||||
|
||||
* feat(route): auto remove .md extension
|
||||
* fix: adjust display on small screens [@jrappen](https://github.com/jrappen)
|
||||
* fix: navbar labels for German [@jrappen](https://github.com/jrappen)
|
||||
|
||||
## 3.4.4 / 2017-03-17
|
||||
|
||||
* fix(search): fix input style
|
||||
* fix search plugin match bug
|
||||
|
||||
# 3.4.3 / 2017-03-16
|
||||
## 3.4.3 / 2017-03-16
|
||||
|
||||
* Add ability to ignore headers when generating toc ([#127](https://github.com/QingWei-Li/docsify/issues/127) [@christopherwk210](https://github.com/christopherwk210))
|
||||
* fix external-script not inserting script at right place [@Leopoldthecoder](https://github.com/Leopoldthecoder)
|
||||
* add German docs [@jrappen](https://github.com/jrappen)
|
||||
|
||||
# 3.4.2 / 2017-03-11
|
||||
## 3.4.2 / 2017-03-11
|
||||
|
||||
* feat(emojify): add no-emoji option
|
||||
|
||||
# 3.4.1 / 2017-03-10
|
||||
## 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
|
||||
## 3.4.0 / 2017-03-09
|
||||
|
||||
* feat(zoom-image): add plugin
|
||||
|
||||
# 3.3.0 / 2017-03-07
|
||||
## 3.3.0 / 2017-03-07
|
||||
|
||||
* add front-matter plugin
|
||||
* add external-script plugin, [@Leopoldthecoder](https://github.com/Leopoldthecoder)
|
||||
* Fix nav showing while loading ([#112](https://github.com/QingWei-Li/docsify/issues/112))
|
||||
|
||||
# 3.2.0 / 2017-02-28
|
||||
## 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
|
||||
## 3.1.2 / 2017-02-27
|
||||
|
||||
* fix(search): dont search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102)
|
||||
|
||||
# 3.1.1 / 2017-02-24
|
||||
## 3.1.1 / 2017-02-24
|
||||
|
||||
* fix(search): dont search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102)
|
||||
* fix(render): custom cover background image
|
||||
* fix(tpl): extra character, fixed [#101](https://github.com/QingWei-Li/docsify/issues/101)
|
||||
|
||||
# 3.1.0 / 2017-02-22
|
||||
## 3.1.0 / 2017-02-22
|
||||
|
||||
* fix(search): incorrect anchor link, fixed [#90](https://github.com/QingWei-Li/docsify/issues/90)
|
||||
* feat(emoji): add emoji plugin
|
||||
|
||||
# 3.0.5 / 2017-02-21
|
||||
## 3.0.5 / 2017-02-21
|
||||
|
||||
* 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)
|
||||
|
||||
# 3.0.4 / 2017-02-20
|
||||
## 3.0.4 / 2017-02-20
|
||||
|
||||
* fix(render): execute script
|
||||
* fix(render): disable rendering sub list when loadSidebar is false
|
||||
|
||||
# 3.0.3 / 2017-02-19
|
||||
## 3.0.3 / 2017-02-19
|
||||
|
||||
* fixed look of links in blockquote
|
||||
* fix(scroll) highlight bug
|
||||
|
||||
# 3.0.2 / 2017-02-19
|
||||
## 3.0.2 / 2017-02-19
|
||||
|
||||
* fix(search): add lazy input
|
||||
* fix(compiler): link
|
||||
|
||||
# 3.0.1 / 2017-02-19
|
||||
## 3.0.1 / 2017-02-19
|
||||
|
||||
* fix(route): empty alias
|
||||
|
||||
# 3.0.0 / 2017-02-19
|
||||
## 3.0.0 / 2017-02-19
|
||||
|
||||
#### Breaking change
|
||||
##### Breaking change
|
||||
|
||||
* Not support IE9
|
||||
* The route becomes: `/#/page?id=slug`. The previous route will be redirected
|
||||
|
||||
#### Features
|
||||
##### Features
|
||||
|
||||
* Faster rendering
|
||||
* Clearer source code
|
||||
|
||||
@@ -64,6 +64,8 @@ These open-source projects are using docsify to generate their sites. Pull reque
|
||||
| [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. |
|
||||
|
||||
## Similar projects
|
||||
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
'/zh-cn/changelog': '/changelog',
|
||||
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
|
||||
},
|
||||
auto2top: true,
|
||||
basePath: '/docs/',
|
||||
executeScript: true,
|
||||
loadNavbar: true,
|
||||
executeScript: true
|
||||
loadSidebar: true,
|
||||
name: 'docsify',
|
||||
subMaxLevel: 2,
|
||||
mergeNavbar: true
|
||||
}
|
||||
</script>
|
||||
<script
|
||||
src="/lib/docsify.js"
|
||||
data-name="docsify"
|
||||
data-base-path="/docs/"
|
||||
data-load-sidebar
|
||||
data-sub-max-level="2"
|
||||
data-auto2top></script>
|
||||
<script src="/lib/docsify.js"></script>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -4,9 +4,9 @@
|
||||
|
||||
## What is it
|
||||
|
||||
docsify generates your documentation website on the fly. Unlike GitBook, it does not generate static html files. Instead, it smartly loads and parses your Markdown files and displays them as website. All you need to do is create an `index.html` to start and [deploy it on GitHub Pages](/deploy).
|
||||
docsify generates your documentation website on the fly. Unlike GitBook, it does not generate static html files. Instead, it smartly loads and parses your Markdown files and displays them as website. All you need to do is create an `index.html` to start and [deploy it on GitHub Pages](deploy.md).
|
||||
|
||||
See the [Quick start](/quickstart) for more details.
|
||||
See the [Quick start](quickstart.md) for more details.
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# docsify <small>3.4</small>
|
||||
# docsify <small>3.6</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
- :uk:
|
||||
- [:cn: 中文](/zh-cn/)
|
||||
- [:de: German](/de-de/)
|
||||
- [:uk: English](/)
|
||||
- Translations
|
||||
- [:cn: 中文](/zh-cn/)
|
||||
- [:de: Deutsch](/de-de/)
|
||||
- [:uk: English](/)
|
||||
|
||||
+16
-16
@@ -1,22 +1,22 @@
|
||||
- Getting started
|
||||
- [Quick start](/quickstart)
|
||||
- [Writing more pages](/more-pages)
|
||||
- [Custom navbar](/custom-navbar)
|
||||
- [Cover page](/cover)
|
||||
- [Quick start](quickstart.md)
|
||||
- [Writing more pages](more-pages.md)
|
||||
- [Custom navbar](custom-navbar.md)
|
||||
- [Cover page](cover.md)
|
||||
|
||||
- Customization
|
||||
- [Configuration](/configuration)
|
||||
- [Themes](/themes)
|
||||
- [List of Plugins](/plugins)
|
||||
- [Write a Plugin](/write-a-plugin)
|
||||
- [Markdown configuration](/markdown)
|
||||
- [Language highlighting](/language-highlight)
|
||||
- [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)
|
||||
- [Helpers](/helpers)
|
||||
- [Vue compatibility](/vue)
|
||||
- [CDN](/cdn)
|
||||
- [Offline Mode(PWA)](/pwa)
|
||||
- [Deploy](deploy.md)
|
||||
- [Helpers](helpers.md)
|
||||
- [Vue compatibility](vue.md)
|
||||
- [CDN](cdn.md)
|
||||
- [Offline Mode(PWA)](pwa.md)
|
||||
|
||||
- [Changelog](/changelog)
|
||||
- [Changelog](changelog.md)
|
||||
|
||||
+4
-1
@@ -44,4 +44,7 @@ Alternatively, use [compressed files](#compressed-files).
|
||||
|
||||
## Other CDN
|
||||
|
||||
[jsDelivr](http://www.jsdelivr.com/projects/docsify) is available.
|
||||
- http://www.bootcdn.cn/docsify
|
||||
- http://www.jsdelivr.com/projects/docsify
|
||||
- https://cdnjs.com/libraries/docsify
|
||||
|
||||
|
||||
+13
-3
@@ -166,7 +166,7 @@ window.$docsify = {
|
||||
- Type: `Boolean|String`
|
||||
- Default: `false`
|
||||
|
||||
Activate the [cover feature](/cover). If true, it will load from `_coverpage.md`.
|
||||
Activate the [cover feature](cover.md). If true, it will load from `_coverpage.md`.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -212,7 +212,7 @@ window.$docsify = {
|
||||
|
||||
- Type: `Function`
|
||||
|
||||
See [Markdown configuration](/markdown).
|
||||
See [Markdown configuration](markdown.md).
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -294,7 +294,7 @@ window.$docsify = {
|
||||
</script>
|
||||
```
|
||||
|
||||
Note that if you are running an external script, e.g. an embedded jsfiddle demo, make sure to include the [external-script](plugins?id=external-script) plugin.
|
||||
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
|
||||
|
||||
@@ -305,3 +305,13 @@ window.$docsify = {
|
||||
noEmoji: true
|
||||
}
|
||||
```
|
||||
|
||||
## merge-navbar
|
||||
|
||||
Navbar will be merged with the sidebar on smaller screens.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
mergeNavbar: true
|
||||
}
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Cover
|
||||
|
||||
Activate the cover feature by setting `coverpage` to **true**, compare [coverpage configuration](configuration#coverpage).
|
||||
Activate the cover feature by setting `coverpage` to **true**, compare [coverpage configuration](configuration.md#coverpage).
|
||||
|
||||
## Basic usage
|
||||
|
||||
|
||||
+10
-10
@@ -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#load-navbar).
|
||||
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).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -52,17 +52,17 @@ You can create sub-lists by indenting items that are under a certain parent.
|
||||
<!-- _navbar.md -->
|
||||
|
||||
- Getting started
|
||||
- [Quick start](/quickstart)
|
||||
- [Writing more pages](/more-pages)
|
||||
- [Custom navbar](/custom-navbar)
|
||||
- [Cover page](/cover)
|
||||
- [Quick start](quickstart.md)
|
||||
- [Writing more pages](more-pages.md)
|
||||
- [Custom navbar](custom-navbar.md)
|
||||
- [Cover page](cover.md)
|
||||
|
||||
- Configuration
|
||||
- [Configuration](/configuration)
|
||||
- [Themes](/themes)
|
||||
- [Using plugins](/plugins)
|
||||
- [Markdown configuration](/markdown)
|
||||
- [Language highlight](/language-highlight)
|
||||
- [Configuration](configuration.md)
|
||||
- [Themes](themes.md)
|
||||
- [Using plugins](plugins.md)
|
||||
- [Markdown configuration](markdown.md)
|
||||
- [Language highlight](language-highlight.md)
|
||||
```
|
||||
|
||||
renders as
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
## Was ist das
|
||||
|
||||
**docsify** generiert deine Dokumentationswebseite zeitgleich (mit der Darstellung). Im Gegensatz zu GitBook, werden keine statischen HTML Seiten generiert. Stattdessen, werden im Hintergrund Markdown Dateien geladen und umgewandelt, und als Webseite dargestellt. Alles, was du brauchst, ist eine Datei namens `index.html`, um sie über [GitHub Pages zu veröffentlichen](/de-de/deploy).
|
||||
**docsify** generiert deine Dokumentationswebseite zeitgleich (mit der Darstellung). Im Gegensatz zu GitBook, werden keine statischen HTML Seiten generiert. Stattdessen, werden im Hintergrund Markdown Dateien geladen und umgewandelt, und als Webseite dargestellt. Alles, was du brauchst, ist eine Datei namens `index.html`, um sie über [GitHub Pages zu veröffentlichen](de-de/deploy.md).
|
||||
|
||||
Siehe [Schnellstart](/de-de/quickstart) für weitere Informationen.
|
||||
Siehe [Schnellstart](de-de/quickstart.md) für weitere Informationen.
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
- :de:
|
||||
- [:cn: 中文](/zh-cn/)
|
||||
- [:de: German](/de-de/)
|
||||
- [:uk: English](/)
|
||||
+16
-16
@@ -1,22 +1,22 @@
|
||||
- Loslegen
|
||||
- [Schnellstart](/de-de/quickstart)
|
||||
- [Schreiben weiterer Seiten](/de-de/more-pages)
|
||||
- [Navigationsleiste anpassen](/de-de/custom-navbar)
|
||||
- [Titelseite](/de-de/cover)
|
||||
- [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)
|
||||
|
||||
- Anpassen
|
||||
- [Einstellungen](/de-de/configuration)
|
||||
- [Themen](/de-de/themes)
|
||||
- [Liste der Erweiterungen](/de-de/plugins)
|
||||
- [Schreiben eigener Erweiterungen](/de-de/write-a-plugin)
|
||||
- [Markdown-Einstellungen](/de-de/markdown)
|
||||
- [Hervorheben von Sprachen](/de-de/language-highlight)
|
||||
- [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)
|
||||
- [Helfer](/de-de/helpers)
|
||||
- [Vue Kompatibilität](/de-de/vue)
|
||||
- [CDN](/de-de/cdn)
|
||||
- [Offline Modus (PWA)](/de-de/pwa)
|
||||
- [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)
|
||||
|
||||
- [Changelog](/de-de/changelog)
|
||||
- [Changelog](de-de/changelog.md)
|
||||
|
||||
+3
-1
@@ -44,4 +44,6 @@ Alternativ kannst du auch die [komprimierten Dateien](#komprimierte-dateien) ver
|
||||
|
||||
## Andere CDN
|
||||
|
||||
[jsDelivr](http://www.jsdelivr.com/projects/docsify) ist auch verfügbar.
|
||||
- http://www.bootcdn.cn/docsify
|
||||
- http://www.jsdelivr.com/projects/docsify
|
||||
- https://cdnjs.com/libraries/docsify
|
||||
|
||||
@@ -166,7 +166,7 @@ window.$docsify = {
|
||||
- Typ: `Boolean|String`
|
||||
- Standard: `false`
|
||||
|
||||
Aktiviere das [Titelseitenfeature](/de-de/cover). Falls `true`, wird sie von `_coverpage.md` geladen.
|
||||
Aktiviere das [Titelseitenfeature](de-de/cover.md). Falls `true`, wird sie von `_coverpage.md` geladen.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -212,7 +212,7 @@ window.$docsify = {
|
||||
|
||||
- Typ: `Function`
|
||||
|
||||
Siehe [Markdown Konfiguration](/de-de/markdown).
|
||||
Siehe [Markdown Konfiguration](de-de/markdown.md).
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -278,7 +278,7 @@ window.$docsify = {
|
||||
|
||||
- Typ: `Boolean`
|
||||
|
||||
Führe das Skript auf der Seite aus. Analysiere nur das erste script tag ([demo](/de-de/themes)). 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 = {
|
||||
@@ -294,7 +294,7 @@ window.$docsify = {
|
||||
</script>
|
||||
```
|
||||
|
||||
?> Nehme zur Kenntnis, dass, solltest du ein externes Skript ausführen, z.B. ein eingebettete jsfiddle demo, du sicher gehen solltest, das [external-script](plugins?id=external-script) plugin zu verwenden.
|
||||
?> 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
|
||||
|
||||
@@ -305,3 +305,13 @@ window.$docsify = {
|
||||
noEmoji: true
|
||||
}
|
||||
```
|
||||
|
||||
## merge-navbar
|
||||
|
||||
Navbar will be merged with the sidebar on smaller screens.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
mergeNavbar: true
|
||||
}
|
||||
```
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Titelseite
|
||||
|
||||
Aktiviere die Unterstützung für Titelseiten, indem du `coverpage` auf **true** einstellst, vergleiche [coverpage Einstellungen](/de-de/configuration#coverpage).
|
||||
Aktiviere die Unterstützung für Titelseiten, indem du `coverpage` auf **true** einstellst, vergleiche [coverpage Einstellungen](configuration.md#coverpage).
|
||||
|
||||
## Einfache Verwendung
|
||||
|
||||
|
||||
+11
-11
@@ -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](/de-de/configuration#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 [load-navbar Einstellungen](configuration.md#load-navbar).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -52,17 +52,17 @@ Du kannst untergeordnete Listen erstellen, indem du untergeordnete Punkte einem
|
||||
<!-- _navbar.md -->
|
||||
|
||||
- Getting started
|
||||
- [Quick start](/quickstart)
|
||||
- [Writing more pages](/more-pages)
|
||||
- [Custom navbar](/custom-navbar)
|
||||
- [Cover page](/cover)
|
||||
- [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](/configuration)
|
||||
- [Themes](/themes)
|
||||
- [Using plugins](/plugins)
|
||||
- [Markdown configuration](/markdown)
|
||||
- [Language highlight](/language-highlight)
|
||||
- [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
|
||||
@@ -71,7 +71,7 @@ wird also wie folgt aussehen
|
||||
|
||||
## Angepasste Navigationsleisten in Verbindung mit dem emoji Erweiterung
|
||||
|
||||
Solltest du die [emoji Erweiterung](/de-de/plugins#emoji) verwenden:
|
||||
Solltest du die [emoji Erweiterung](plugins.md#emoji) verwenden:
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
|
||||
@@ -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](/de-de/configuration#load-sidebar).
|
||||
Als Erstes musst du `loadSidebar` auf **true** setzen, vergleiche [Einstellungen für das seitliche Inhaltsverzeichnis](configuration.md#load-sidebar).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -46,7 +46,7 @@ Als Zweites erstellst du eine Datei namens `_sidebar.md`:
|
||||
<!-- docs/_sidebar.md -->
|
||||
|
||||
- [Home](/)
|
||||
- [Guide](/guide)
|
||||
- [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.
|
||||
@@ -55,7 +55,7 @@ Als Zweites erstellst du eine Datei namens `_sidebar.md`:
|
||||
|
||||
## Inhaltsverzeichnis
|
||||
|
||||
Eine angepasste Seitenleist kann auch automatisch ein Inhaltsverzeichnis generieren, indem ein `subMaxLevel` gesetzt wird, vergleiche [sub-max-level Einstellungen](/de-de/configuration#sub-max-level).
|
||||
Eine angepasste Seitenleist kann auch automatisch ein Inhaltsverzeichnis generieren, indem ein `subMaxLevel` gesetzt wird, vergleiche [sub-max-level Einstellungen](configuration.md#sub-max-level).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
|
||||
@@ -22,7 +22,7 @@ Nachdem der Befehl `init` vollständig ausgeführt wurde, kannst du folgende Dat
|
||||
* `README.md` als die Startseite für die Dokumentation
|
||||
* `.nojekyll` verhindert, dass Github Pages Dateien ignoriert, die mit einem Unterstrich beginnen.
|
||||
|
||||
Du kannst die Dokumentation über die Datei `./docs/README.md` nach Belieben ändern, und natürlich [weitere Seiten](/de-de/more-pages) hinzufügen.
|
||||
Du kannst die Dokumentation über die Datei `./docs/README.md` nach Belieben ändern, und natürlich [weitere Seiten](de-de/more-pages.md) hinzufügen.
|
||||
|
||||
## Vorschau der eigenen Seiten
|
||||
|
||||
@@ -84,4 +84,4 @@ Du solltest das `data-app` Attribut anpassen, wenn du `el` geändert hast:
|
||||
</script>
|
||||
```
|
||||
|
||||
Vergleiche [el Einstellungen](/de-de/configuration#el).
|
||||
Vergleiche [el Einstellungen](configuration.md#el).
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
executeScript: true,
|
||||
loadSidebar: true,
|
||||
loadNavbar: true,
|
||||
mergeNavbar: true,
|
||||
maxLevel: 4,
|
||||
name: 'docsify',
|
||||
search: {
|
||||
|
||||
+3
-3
@@ -27,7 +27,7 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
|
||||
|
||||
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):
|
||||
|
||||
First, you need to set `loadSidebar` to **true**. Details are available in the [configuration paragraph](configuration#load-sidebar).
|
||||
First, you need to set `loadSidebar` to **true**. Details are available in the [configuration paragraph](configuration.md#load-sidebar).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
@@ -46,7 +46,7 @@ Create the `_sidebar.md`:
|
||||
<!-- docs/_sidebar.md -->
|
||||
|
||||
- [Home](/)
|
||||
- [Guide](/guide)
|
||||
- [Guide](guide.md)
|
||||
```
|
||||
|
||||
!> You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
|
||||
@@ -55,7 +55,7 @@ Create the `_sidebar.md`:
|
||||
|
||||
## Table of Contents
|
||||
|
||||
A custom sidebar can also automatically generate a table of contents by setting a `subMaxLevel`, compare [sub-max-level configuration](configuration#sub-max-level).
|
||||
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).
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ After the `init` is complete, you can see the file list in the `./docs` subdirec
|
||||
* `README.md` as the home page
|
||||
* `.nojekyll` prevents GitHub Pages from ignoring files that begin with an underscore
|
||||
|
||||
You can easily update the documentation in `./docs/README.md`, of course you can add [more pages](more-pages).
|
||||
You can easily update the documentation in `./docs/README.md`, of course you can add [more pages](more-pages.md).
|
||||
|
||||
## Preview your site
|
||||
|
||||
@@ -84,4 +84,4 @@ You should set the `data-app` attribute if you changed `el`:
|
||||
</script>
|
||||
```
|
||||
|
||||
Compare [el configuration](/configuration#el).
|
||||
Compare [el configuration](configuration.md#el).
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
docsify 是一个动态生成文档网站的工具。不同于 GitBook、Hexo 的地方是它不会生成将 `.md` 转成 `.html` 文件,所有转换工作都是在运行时进行。
|
||||
|
||||
这将非常实用,如果只是需要快速的搭建一个小型的文档网站,或者不想因为生成的一堆 `.html` 文件“污染” commit 记录,只需要创建一个 `index.html` 就可以开始写文档而且直接[部署在 GitHub Pages](zh-cn/deploy)。
|
||||
这将非常实用,如果只是需要快速的搭建一个小型的文档网站,或者不想因为生成的一堆 `.html` 文件“污染” commit 记录,只需要创建一个 `index.html` 就可以开始写文档而且直接[部署在 GitHub Pages](zh-cn/deploy.md)。
|
||||
|
||||
查看[快速开始](zh-cn/quickstart)了解详情。
|
||||
查看[快速开始](zh-cn/quickstart.md)了解详情。
|
||||
|
||||
## 特性
|
||||
- 无需构建,写完文档直接发布
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
- :cn:
|
||||
- [:cn: 中文](/zh-cn/)
|
||||
- [:de: German](/de-de/)
|
||||
- [:uk: English](/)
|
||||
+16
-16
@@ -1,22 +1,22 @@
|
||||
- 入门
|
||||
- [快速开始](zh-cn/quickstart)
|
||||
- [多页文档](zh-cn/more-pages)
|
||||
- [定制导航栏](zh-cn/custom-navbar)
|
||||
- [封面](zh-cn/cover)
|
||||
- [快速开始](zh-cn/quickstart.md)
|
||||
- [多页文档](zh-cn/more-pages.md)
|
||||
- [定制导航栏](zh-cn/custom-navbar.md)
|
||||
- [封面](zh-cn/cover.md)
|
||||
|
||||
- 定制化
|
||||
- [配置项](zh-cn/configuration)
|
||||
- [主题](zh-cn/themes)
|
||||
- [插件列表](zh-cn/plugins)
|
||||
- [开发插件](zh-cn/write-a-plugin)
|
||||
- [Markdown 配置](zh-cn/markdown)
|
||||
- [代码高亮](zh-cn/language-highlight)
|
||||
- [配置项](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)
|
||||
- [文档助手](zh-cn/helpers)
|
||||
- [兼容 Vue](zh-cn/vue)
|
||||
- [CDN](zh-cn/cdn)
|
||||
- [离线模式(PWA)](zh-cn/pwa)
|
||||
- [部署](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)
|
||||
- [Changelog](zh-cn/changelog.md)
|
||||
|
||||
+3
-2
@@ -44,5 +44,6 @@ JS 的压缩文件是原有文件路径的基础上加 `.min`后缀
|
||||
|
||||
## 其他 CDN
|
||||
|
||||
[jsDelivr](http://www.jsdelivr.com/projects/docsify) 也是可用的,具体用法参考其文档。
|
||||
|
||||
- http://www.bootcdn.cn/docsify
|
||||
- http://www.jsdelivr.com/projects/docsify
|
||||
- https://cdnjs.com/libraries/docsify
|
||||
|
||||
@@ -74,7 +74,7 @@ window.$docsify = {
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
|
||||
加载自定义导航栏,参考[定制导航栏](zh-cn/custom-navbar) 了解用法。设置为 `true` 后会加载 `_navbar.md` 文件,也可以自定义加载的文件名。
|
||||
加载自定义导航栏,参考[定制导航栏](zh-cn/custom-navbar.md) 了解用法。设置为 `true` 后会加载 `_navbar.md` 文件,也可以自定义加载的文件名。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -91,7 +91,7 @@ window.$docsify = {
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
|
||||
加载自定义侧边栏,参考[多页文档](zh-cn/more-pages)。设置为 `true` 后会加载 `_sidebar.md` 文件,也可以自定义加载的文件名。
|
||||
加载自定义侧边栏,参考[多页文档](zh-cn/more-pages.md)。设置为 `true` 后会加载 `_sidebar.md` 文件,也可以自定义加载的文件名。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -173,7 +173,7 @@ window.$docsify = {
|
||||
- 类型:`Boolean|String`
|
||||
- 默认值: `false`
|
||||
|
||||
启用[封面页](/zh-cn/cover)。开启后是加载 `_coverpage.md` 文件,也可以自定义文件名。
|
||||
启用[封面页](zh-cn/cover.md)。开启后是加载 `_coverpage.md` 文件,也可以自定义文件名。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -220,7 +220,7 @@ window.$docsify = {
|
||||
|
||||
- 类型: `Object|Function`
|
||||
|
||||
参考 [Markdown 配置](/zh-cn/markdown)。
|
||||
参考 [Markdown 配置](zh-cn/markdown.md)。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -287,7 +287,7 @@ window.$docsify = {
|
||||
|
||||
- 类型:`Boolean`
|
||||
|
||||
执行文档里的 script 标签里的脚本,只执行第一个 script ([demo](zh-cn/themes))。 如果 Vue 存在,则自动开启。
|
||||
执行文档里的 script 标签里的脚本,只执行第一个 script ([demo](zh-cn/themes.md))。 如果 Vue 存在,则自动开启。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
@@ -304,7 +304,7 @@ window.$docsify = {
|
||||
|
||||
```
|
||||
|
||||
注意如果执行的是一个外链脚本,比如 jsfiddle 的内嵌 demo,请确保引入 [external-script](zh-cn/plugins?id=外链脚本-external-script) 插件。
|
||||
注意如果执行的是一个外链脚本,比如 jsfiddle 的内嵌 demo,请确保引入 [external-script](plugins.md?id=外链脚本-external-script) 插件。
|
||||
|
||||
## no-emoji
|
||||
|
||||
@@ -315,3 +315,14 @@ window.$docsify = {
|
||||
noEmoji: true
|
||||
}
|
||||
```
|
||||
|
||||
## merge-navbar
|
||||
|
||||
小屏设备下合并导航栏到侧边栏。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
mergeNavbar: true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# 封面
|
||||
|
||||
通过设置 `coverpage` 参数,可以开启渲染封面的功能。具体用法见[配置项#coverpage](zh-cn/configuration#coverpage)。
|
||||
通过设置 `coverpage` 参数,可以开启渲染封面的功能。具体用法见[配置项#coverpage](configuration.md#coverpage)。
|
||||
|
||||
## 基本用法
|
||||
|
||||
|
||||
+10
-10
@@ -17,7 +17,7 @@
|
||||
|
||||
## 配置文件
|
||||
|
||||
那我们可以通过 Markdown 文件来配置导航。首先配置 `loadNavbar`,默认加载的文件为 `_navbar.md`。具体配置规则见[配置项#load-navbar](zh-cn/configuration#load-navbar)。
|
||||
那我们可以通过 Markdown 文件来配置导航。首先配置 `loadNavbar`,默认加载的文件为 `_navbar.md`。具体配置规则见[配置项#load-navbar](configuration.md#load-navbar)。
|
||||
|
||||
*index.html*
|
||||
|
||||
@@ -49,17 +49,17 @@
|
||||
|
||||
```markdown
|
||||
- 基础
|
||||
- [快速开始](zh-cn/quickstart)
|
||||
- [多页文档](zh-cn/more-pages)
|
||||
- [定制导航栏](zh-cn/custom-navbar)
|
||||
- [封面](zh-cn/cover)
|
||||
- [快速开始](zh-cn/quickstart.md)
|
||||
- [多页文档](zh-cn/more-pages.md)
|
||||
- [定制导航栏](zh-cn/custom-navbar.md)
|
||||
- [封面](zh-cn/cover.md)
|
||||
|
||||
- 配置
|
||||
- [配置项](zh-cn/configuration)
|
||||
- [主题](zh-cn/themes)
|
||||
- [使用插件](zh-cn/plugins)
|
||||
- [Markdown 配置](zh-cn/markdown)
|
||||
- [代码高亮](zh-cn/language-highlight)
|
||||
- [配置项](zh-cn/configuration.md)
|
||||
- [主题](zh-cn/themes.md)
|
||||
- [使用插件](zh-cn/plugins.md)
|
||||
- [Markdown 配置](zh-cn/markdown.md)
|
||||
- [代码高亮](zh-cn/language-highlight.md)
|
||||
```
|
||||
|
||||
效果图
|
||||
|
||||
@@ -26,7 +26,7 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
|
||||
|
||||
默认情况下,侧边栏会根据当前文档的标题生成目录。也可以设置文档链接,通过 Markdown 文件生成,效果如当前的文档的侧边栏。
|
||||
|
||||
首先配置 `loadSidebar` 选项,具体配置规则见[配置项#load-sidebar](zh-cn/configuration#load-sidebar)。
|
||||
首先配置 `loadSidebar` 选项,具体配置规则见[配置项#load-sidebar](configuration.md#load-sidebar)。
|
||||
|
||||
```html
|
||||
<script>
|
||||
|
||||
@@ -22,7 +22,7 @@ docsify init ./docs
|
||||
- `README.md` 会做为主页内容渲染
|
||||
- `.nojekyll` 用于阻止 GitHub Pages 会忽略掉下划线开头的文件
|
||||
|
||||
直接编辑 `docs/README.md` 就能更新网站内容,当然也可以[写多个页面](zh-cn/more-pages)。
|
||||
直接编辑 `docs/README.md` 就能更新网站内容,当然也可以[写多个页面](zh-cn/more-pages.md)。
|
||||
|
||||
## 本地预览网站
|
||||
|
||||
|
||||
+32
-16
@@ -76,7 +76,8 @@ var config = merge({
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: ''
|
||||
ga: '',
|
||||
mergeNavbar: false
|
||||
}, window.$docsify);
|
||||
|
||||
var script = document.currentScript ||
|
||||
@@ -313,7 +314,7 @@ var getParentPath = cached(function (path) {
|
||||
});
|
||||
|
||||
var cleanPath = cached(function (path) {
|
||||
return path.replace(/\/+/g, '/')
|
||||
return path.replace(/([^:])\/{2,}/g, '$1/')
|
||||
});
|
||||
|
||||
function replaceHash (path) {
|
||||
@@ -380,12 +381,17 @@ function parse (path) {
|
||||
* to URL
|
||||
* @param {string} path
|
||||
* @param {object} qs query params
|
||||
* @param {string} currentRoute optional current route
|
||||
*/
|
||||
function toURL (path, params) {
|
||||
function toURL (path, params, currentRoute) {
|
||||
var local = currentRoute && path[0] === '#';
|
||||
var route = parse(replaceSlug(path));
|
||||
|
||||
route.query = merge({}, route.query, params);
|
||||
path = route.path + stringifyQuery(route.query);
|
||||
path = path.replace(/\.md(\?)|\.md$/, '$1');
|
||||
|
||||
if (local) { path = currentRoute + path; }
|
||||
|
||||
return cleanPath('#/' + path)
|
||||
}
|
||||
@@ -410,17 +416,20 @@ var title = $.title;
|
||||
* Toggle button
|
||||
*/
|
||||
function btn (el) {
|
||||
var toggle = function () { return body.classList.toggle('close'); };
|
||||
var toggle = function (_) { return body.classList.toggle('close'); };
|
||||
|
||||
el = getNode(el);
|
||||
on(el, 'click', toggle);
|
||||
on(el, 'click', function (e) {
|
||||
e.stopPropagation();
|
||||
toggle();
|
||||
});
|
||||
|
||||
var sidebar = getNode('.sidebar');
|
||||
|
||||
on(sidebar, 'click', function () {
|
||||
isMobile && toggle();
|
||||
setTimeout(function () { return getAndActive(sidebar, true, true); }, 0);
|
||||
});
|
||||
isMobile && on(body, 'click', function (_) { return body.classList.contains('close') && toggle(); }
|
||||
);
|
||||
on(sidebar, 'click', function (_) { return setTimeout((function (_) { return getAndActive(sidebar, true, true); }, 0)); }
|
||||
);
|
||||
}
|
||||
|
||||
function sticky () {
|
||||
@@ -3024,7 +3033,7 @@ renderer.code = function (code, lang) {
|
||||
renderer.link = function (href, title, text) {
|
||||
var blank = '';
|
||||
if (!/:|(\/{2})/.test(href)) {
|
||||
href = toURL(href);
|
||||
href = toURL(href, null, currentPath);
|
||||
} else {
|
||||
blank = ' target="_blank"';
|
||||
}
|
||||
@@ -3258,12 +3267,8 @@ function initRender (vm) {
|
||||
|
||||
var el = find(id);
|
||||
var html = '';
|
||||
var navAppendToTarget = body;
|
||||
|
||||
navEl.classList.add('app-nav');
|
||||
|
||||
if (!config.repo) {
|
||||
navEl.classList.add('no-badge');
|
||||
}
|
||||
if (!el) {
|
||||
el = create(id);
|
||||
appendTo(body, el);
|
||||
@@ -3278,8 +3283,19 @@ function initRender (vm) {
|
||||
html += main(config);
|
||||
// Render main app
|
||||
vm._renderTo(el, html, true);
|
||||
|
||||
if (config.mergeNavbar && isMobile) {
|
||||
navAppendToTarget = find('.sidebar');
|
||||
} else {
|
||||
navEl.classList.add('app-nav');
|
||||
|
||||
if (!config.repo) {
|
||||
navEl.classList.add('no-badge');
|
||||
}
|
||||
}
|
||||
|
||||
// Add nav
|
||||
before(body, navEl);
|
||||
before(navAppendToTarget, navEl);
|
||||
|
||||
if (config.themeColor) {
|
||||
$.head.innerHTML += theme(config.themeColor);
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
@@ -4,15 +4,21 @@ this.D = this.D || {};
|
||||
|
||||
function handleExternalScript () {
|
||||
var container = Docsify.dom.getNode('#main');
|
||||
var script = Docsify.dom.find(container, 'script');
|
||||
var scripts = Docsify.dom.findAll(container, 'script');
|
||||
|
||||
if (script && script.src) {
|
||||
var newScript = document.createElement('script');['src', 'async', 'defer'].forEach(function (attribute) {
|
||||
newScript[attribute] = script[attribute];
|
||||
});
|
||||
for (var i = scripts.length; i--;) {
|
||||
var script = scripts[i];
|
||||
|
||||
script.parentNode.insertBefore(newScript, script);
|
||||
script.parentNode.removeChild(script);
|
||||
if (script && script.src) {
|
||||
var newScript = document.createElement('script');
|
||||
|
||||
Array.prototype.slice.call(script.attributes).forEach(function (attribute) {
|
||||
newScript[attribute.name] = attribute.value;
|
||||
});
|
||||
|
||||
script.parentNode.insertBefore(newScript, script);
|
||||
script.parentNode.removeChild(script);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
this.D=this.D||{},function(){"use strict";function i(){var i=Docsify.dom.getNode("#main"),n=Docsify.dom.find(i,"script");if(n&&n.src){var o=document.createElement("script");["src","async","defer"].forEach(function(i){o[i]=n[i]}),n.parentNode.insertBefore(o,n),n.parentNode.removeChild(n)}}var n=function(n){n.doneEach(i)};window.$docsify.plugins=[].concat(n,window.$docsify.plugins)}();
|
||||
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)}();
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ function init (id) {
|
||||
|
||||
function collect () {
|
||||
init(window.$docsify.ga);
|
||||
window.ga('set', 'page', location.href);
|
||||
window.ga('set', 'page', location.hash);
|
||||
window.ga('send', 'pageview');
|
||||
}
|
||||
|
||||
|
||||
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.href),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)}();
|
||||
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)}();
|
||||
|
||||
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
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "3.4.4",
|
||||
"version": "3.6.4",
|
||||
"description": "A magical documentation generator.",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
@@ -32,13 +32,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cssnano": "^3.10.0",
|
||||
"eslint": "^3.17.1",
|
||||
"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.5",
|
||||
"rollup": "^0.41.6",
|
||||
"rollup-plugin-buble": "^0.15.0",
|
||||
"rollup-plugin-commonjs": "^8.0.2",
|
||||
"rollup-plugin-node-resolve": "^2.0.0",
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@ const config = merge({
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: ''
|
||||
ga: '',
|
||||
mergeNavbar: false
|
||||
}, window.$docsify)
|
||||
|
||||
const script = document.currentScript ||
|
||||
|
||||
@@ -7,17 +7,22 @@ const title = dom.$.title
|
||||
* Toggle button
|
||||
*/
|
||||
export function btn (el) {
|
||||
const toggle = () => dom.body.classList.toggle('close')
|
||||
const toggle = _ => dom.body.classList.toggle('close')
|
||||
|
||||
el = dom.getNode(el)
|
||||
dom.on(el, 'click', toggle)
|
||||
dom.on(el, 'click', e => {
|
||||
e.stopPropagation()
|
||||
toggle()
|
||||
})
|
||||
|
||||
const sidebar = dom.getNode('.sidebar')
|
||||
|
||||
dom.on(sidebar, 'click', () => {
|
||||
isMobile && toggle()
|
||||
setTimeout(() => getAndActive(sidebar, true, true), 0)
|
||||
})
|
||||
isMobile && dom.on(dom.body, 'click', _ =>
|
||||
dom.body.classList.contains('close') && toggle()
|
||||
)
|
||||
dom.on(sidebar, 'click', _ =>
|
||||
setTimeout((_ => getAndActive(sidebar, true, true), 0))
|
||||
)
|
||||
}
|
||||
|
||||
export function sticky () {
|
||||
|
||||
@@ -82,7 +82,7 @@ renderer.code = function (code, lang = '') {
|
||||
renderer.link = function (href, title, text) {
|
||||
let blank = ''
|
||||
if (!/:|(\/{2})/.test(href)) {
|
||||
href = toURL(href)
|
||||
href = toURL(href, null, currentPath)
|
||||
} else {
|
||||
blank = ' target="_blank"'
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { markdown, sidebar, subSidebar, cover } from './compiler'
|
||||
import { callHook } from '../init/lifecycle'
|
||||
import { getBasePath, getPath, isAbsolutePath } from '../route/util'
|
||||
import { isPrimitive } from '../util/core'
|
||||
import { isMobile } from '../util/env'
|
||||
|
||||
function executeScript () {
|
||||
const script = dom.findAll('.markdown-section>script')
|
||||
@@ -153,12 +154,8 @@ export function initRender (vm) {
|
||||
|
||||
let el = dom.find(id)
|
||||
let html = ''
|
||||
let navAppendToTarget = dom.body
|
||||
|
||||
navEl.classList.add('app-nav')
|
||||
|
||||
if (!config.repo) {
|
||||
navEl.classList.add('no-badge')
|
||||
}
|
||||
if (!el) {
|
||||
el = dom.create(id)
|
||||
dom.appendTo(dom.body, el)
|
||||
@@ -173,8 +170,19 @@ export function initRender (vm) {
|
||||
html += tpl.main(config)
|
||||
// Render main app
|
||||
vm._renderTo(el, html, true)
|
||||
|
||||
if (config.mergeNavbar && isMobile) {
|
||||
navAppendToTarget = dom.find('.sidebar')
|
||||
} else {
|
||||
navEl.classList.add('app-nav')
|
||||
|
||||
if (!config.repo) {
|
||||
navEl.classList.add('no-badge')
|
||||
}
|
||||
}
|
||||
|
||||
// Add nav
|
||||
dom.before(dom.body, navEl)
|
||||
dom.before(navAppendToTarget, navEl)
|
||||
|
||||
if (config.themeColor) {
|
||||
dom.$.head.innerHTML += tpl.theme(config.themeColor)
|
||||
|
||||
@@ -64,12 +64,17 @@ export function parse (path = window.location.href) {
|
||||
* to URL
|
||||
* @param {string} path
|
||||
* @param {object} qs query params
|
||||
* @param {string} currentRoute optional current route
|
||||
*/
|
||||
export function toURL (path, params) {
|
||||
export function toURL (path, params, currentRoute) {
|
||||
const local = currentRoute && path[0] === '#'
|
||||
const route = parse(replaceSlug(path))
|
||||
|
||||
route.query = merge({}, route.query, params)
|
||||
path = route.path + stringifyQuery(route.query)
|
||||
path = path.replace(/\.md(\?)|\.md$/, '$1')
|
||||
|
||||
if (local) path = currentRoute + path
|
||||
|
||||
return cleanPath('#/' + path)
|
||||
}
|
||||
|
||||
@@ -54,5 +54,5 @@ export const getParentPath = cached(path => {
|
||||
})
|
||||
|
||||
export const cleanPath = cached(path => {
|
||||
return path.replace(/\/+/g, '/')
|
||||
return path.replace(/([^:])\/{2,}/g, '$1/')
|
||||
})
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
function handleExternalScript () {
|
||||
const container = Docsify.dom.getNode('#main')
|
||||
const script = Docsify.dom.find(container, 'script')
|
||||
const scripts = Docsify.dom.findAll(container, 'script')
|
||||
|
||||
if (script && script.src) {
|
||||
const newScript = document.createElement('script')
|
||||
for (let i = scripts.length; i--;) {
|
||||
const script = scripts[i]
|
||||
|
||||
;['src', 'async', 'defer'].forEach(attribute => {
|
||||
newScript[attribute] = script[attribute]
|
||||
})
|
||||
if (script && script.src) {
|
||||
const newScript = document.createElement('script')
|
||||
|
||||
script.parentNode.insertBefore(newScript, script)
|
||||
script.parentNode.removeChild(script)
|
||||
Array.prototype.slice.call(script.attributes).forEach(attribute => {
|
||||
newScript[attribute.name] = attribute.value
|
||||
})
|
||||
|
||||
script.parentNode.insertBefore(newScript, script)
|
||||
script.parentNode.removeChild(script)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ function init (id) {
|
||||
|
||||
function collect () {
|
||||
init(window.$docsify.ga)
|
||||
window.ga('set', 'page', location.href)
|
||||
window.ga('set', 'page', location.hash)
|
||||
window.ga('send', 'pageview')
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
body:not(.ready) {
|
||||
overflow: hidden;
|
||||
|
||||
[data-cloak], nav {
|
||||
[data-cloak], .app-nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ kbd {
|
||||
}
|
||||
|
||||
/* navbar */
|
||||
nav.app-nav {
|
||||
.app-nav {
|
||||
left: 0;
|
||||
margin: 25px 60px 0 0;
|
||||
position: absolute;
|
||||
@@ -238,6 +238,11 @@ main {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.app-nav {
|
||||
display: block;
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
@@ -325,7 +330,7 @@ body.sticky {
|
||||
.markdown-section {
|
||||
margin: 0 auto;
|
||||
max-width: 800px;
|
||||
padding: 20px 15px 40px 15px;
|
||||
padding: 30px 15px 40px 15px;
|
||||
position: relative;
|
||||
|
||||
> * {
|
||||
@@ -425,16 +430,26 @@ body.close {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
@media print {
|
||||
.github-corner, .sidebar-toggle, .sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app-nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.github-corner, .sidebar-toggle, .sidebar {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
nav {
|
||||
.app-nav {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
nav li ul {
|
||||
.app-nav li ul {
|
||||
top: 30px;
|
||||
}
|
||||
|
||||
@@ -455,7 +470,7 @@ body.close {
|
||||
transition: transform 250ms ease;
|
||||
}
|
||||
|
||||
nav, .github-corner {
|
||||
.app-nav, .github-corner {
|
||||
transition: transform 250ms ease-out;
|
||||
}
|
||||
|
||||
@@ -479,7 +494,7 @@ body.close {
|
||||
transform: translateX($sidebar-width);
|
||||
}
|
||||
|
||||
nav, .github-corner {
|
||||
.app-nav, .github-corner {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user