\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+""+n+">\n"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?" ":" "},r.prototype.del=function(e){return""+e+""},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(o(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var i='"+n+""},r.prototype.image=function(e,t,n){var r='":">"},r.prototype.text=function(e){return e},i.parse=function(e,t,n){var r=new i(t,n);return r.parse(e)},i.prototype.parse=function(e){var t=this;this.inline=new n(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var r="";this.next();)r+=t.tok();return r},i.prototype.next=function(){return this.token=this.tokens.pop()},i.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},i.prototype.parseText=function(){for(var e=this,t=this.token.text;"text"===this.peek().type;)t+="\n"+e.next().text;return this.inline.output(t)},i.prototype.tok=function(){var e=this;switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var t,n,r,i,a,o="",s="";for(r="",t=0;te.length)break e;if(!(y instanceof i)){c.lastIndex=0;var k=c.exec(y),w=1;if(!k&&d&&v!=a.length-1){if(c.lastIndex=b,k=c.exec(e),!k)break;for(var x=k.index+(h?k[1].length:0),_=k.index+k[0].length,L=v,S=b,C=a.length;L=S&&(++v,b=S);if(a[v]instanceof i||a[L-1].greedy)continue;w=L-v,y=e.slice(b,S),k.index-=b}if(k){h&&(g=k[1].length);var x=k.index+g,k=k[0].slice(g),_=x+k.length,E=y.slice(0,x),$=y.slice(_),T=[v,w];E&&T.push(E);var A=new i(s,p?r.tokenize(k,p):k,f,k,d);T.push(A),$&&T.push($),Array.prototype.splice.apply(a,T)}}}}}return a},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,a=0;i=n[a++];)i(t)}}},i=r.Token=function(e,t,n,r,i){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!i};if(i.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join("");var a={type:e.type,content:i.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if("comment"==a.type&&(a.attributes.spellcheck="true"),e.alias){var o="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(a.classes,o)}r.hooks.run("wrap",a);var s=Object.keys(a.attributes).map(function(e){return e+'="'+(a.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+a.tag+' class="'+a.classes.join(" ")+'"'+(s?" "+s:"")+">"+a.content+""+a.tag+">"},!t.document)return t.addEventListener?(t.addEventListener("message",function(e){var n=JSON.parse(e.data),i=n.language,a=n.code,o=n.immediateClose;t.postMessage(r.highlight(a,r.languages[i],i)),o&&t.close()},!1),t.Prism):t.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(r.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(r.highlightAll):window.setTimeout(r.highlightAll,16):document.addEventListener("DOMContentLoaded",r.highlightAll))),t.Prism}();e.exports&&(e.exports=n),"undefined"!=typeof Re&&(Re.Prism=n),n.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},n.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),n.languages.xml=n.languages.markup,n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},n.languages.css.atrule.inside.rest=n.util.clone(n.languages.css),n.languages.markup&&(n.languages.insertBefore("markup","tag",{style:{pattern:/(
diff --git a/docs/vue.md b/docs/vue.md
index b9714ee..4eaa1fe 100644
--- a/docs/vue.md
+++ b/docs/vue.md
@@ -1,19 +1,21 @@
# Compatible with Vue
-You can write Vue components directly in the Markdown file, and it will be parsed.
-You can use this feature to write vue demo and documentation together.
+You can write Vue components directly in the Markdown file, and it will be parsed. You can use this feature to write vue demo and documentation together.
## Basic usage
-Load the Vue in `index.html`.
+Load the Vue in `./index.html`.
```html
+
+
+
+
```
-Then you can immediately write Vue code at Markdown file.
-`new Vue({ el: '#main' })` script is executed by default to create instance.
+Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main' })` script is executed by default to create instance.
*README.md*
@@ -62,6 +64,11 @@ You can manually initialize a Vue instance.
+
+
+
+
+
```
*README.md*
@@ -85,5 +92,4 @@ You can manually initialize a Vue instance.
```
-?> Example Refer to the vuep [documentation](https://qingwei-li.github.io/vuep/).
-
+?> Example Refer to the [vuep documentation](https://qingwei-li.github.io/vuep/).
diff --git a/docs/write-a-plugin.md b/docs/write-a-plugin.md
index 71a74a5..045cd61 100644
--- a/docs/write-a-plugin.md
+++ b/docs/write-a-plugin.md
@@ -1,7 +1,6 @@
# Write a plugin
-A plugin is simply a function that takes `hook` as arguments.
-The hook supports handling asynchronous tasks.
+A plugin is simply a function that takes `hook` as an argument. The hook supports handling of asynchronous tasks.
## Full configuration
@@ -68,4 +67,4 @@ window.$docsify = {
}
]
}
-```
\ No newline at end of file
+```
diff --git a/docs/zh-cn/_sidebar.md b/docs/zh-cn/_sidebar.md
index d9376b4..1802cf6 100644
--- a/docs/zh-cn/_sidebar.md
+++ b/docs/zh-cn/_sidebar.md
@@ -1,8 +1,8 @@
- 入门
- - [快速开始](zh-cn/quickstart)
- - [多页文档](zh-cn/more-pages)
- - [定制导航栏](zh-cn/custom-navbar)
- - [封面](zh-cn/cover)
+ - [快速开始](zh-cn/quickstart)
+ - [多页文档](zh-cn/more-pages)
+ - [定制导航栏](zh-cn/custom-navbar)
+ - [封面](zh-cn/cover)
- 定制化
- [配置项](zh-cn/configuration)
@@ -19,4 +19,4 @@
- [CDN](zh-cn/cdn)
- [离线模式(PWA)](zh-cn/pwa)
-- [Changelog](zh-cn/changelog)
\ No newline at end of file
+- [Changelog](zh-cn/changelog)
From 0b1fc2343f6a0a43b2550fa195fc4c08f67fa70f Mon Sep 17 00:00:00 2001
From: Johannes Rappen
Date: Thu, 9 Mar 2017 22:19:57 +0100
Subject: [PATCH 100/733] update main markdown files
---
CHANGELOG.md | 109 +++++++--------
HISTORY.md | 368 ++++++++++++++++++++++++++++++++++-----------------
README.md | 27 ++--
3 files changed, 314 insertions(+), 190 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2018549..5295581 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,86 +1,75 @@
+# 3.4.0 / 2017-03-09
-3.4.0 / 2017-03-09
-==================
+* feat(zoom-image): add plugin
- * 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
+* Fix nav showing while loading ([#112](https://github.com/QingWei-Li/docsify/issues/112))
+* Fix a typo ([#111](https://github.com/QingWei-Li/docsify/issues/111))
+* Update changelog
- * add front-matter plugin
- * add external-script plugin
- * Fix nav showing while loading (#112)
- * Fix a typo (#111)
- * Update changelog
+# 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)
- * 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)
- * 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)
- * 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
- * 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)
- * 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
- * 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
- * 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
- * fix(search): add lazy input
- * fix(compiler): link
+# 3.0.1 / 2017-02-19
-3.0.1 / 2017-02-19
-==================
+* fix(route): empty alias
- * fix(route): empty alias
-
-3.0.0 / 2017-02-19
-==================
+# 3.0.0 / 2017-02-19
#### Breaking change
-- Not support IE9
-- The route becomes: `/#/page?id=slug`. The previous route will be redirected
+
+* Not support IE9
+* The route becomes: `/#/page?id=slug`. The previous route will be redirected
#### Features
-- Faster rendering
-- Clearer source code
-- More powerful API
-- Auto header for each page [#78](https://github.com/QingWei-Li/docsify/issues/78)
-- Localization for search plugin [#80](https://github.com/QingWei-Li/docsify/issues/80)
-- Execute the script in markdown (see `executeScript`)
+
+* Faster rendering
+* Clearer source code
+* More powerful API
+* Auto header for each page [#78](https://github.com/QingWei-Li/docsify/issues/78)
+* Localization for search plugin [#80](https://github.com/QingWei-Li/docsify/issues/80)
+* Execute the script in markdown (see `executeScript`)
diff --git a/HISTORY.md b/HISTORY.md
index 6c9358e..77331ed 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -3,22 +3,24 @@
> 2017-02-15
#### Bug fixes
-* fix emoji replacing error (#76)
+
+* fix emoji replacing error ([#76](https://github.com/QingWei-Li/docsify/issues/76))
### 2.4.2
> 2017-02-14
#### Bug fixes
-- fix(index): load file path error
+* fix(index): load file path error
### 2.4.1
> 2017-02-13
#### Bug fixes
-- fix(index): cover page
+
+* fix(index): cover page
### 2.4.0
@@ -26,8 +28,7 @@
#### Features
-- feat(hook): add `doneEach`
-
+* feat(hook): add `doneEach`
### 2.3.0
@@ -35,352 +36,477 @@
#### Features
-- feat(src): add alias feature
-- docs: update all documents
-- feat(src): dynamic title
-- feat(hook): support custom plugin
-- feat(themes): add dark theme
+* feat(src): add alias feature
+* docs: update all documents
+* feat(src): dynamic title
+* feat(hook): support custom plugin
+* feat(themes): add dark theme
#### Bug fixes
-- fix(event): `auto2top` has no effect on a FF mobile browser, fixed #67
-- fix: sidebar style
-- fix(render): fix render link
+
+* fix(event): `auto2top` has no effect on a FF mobile browser, fixed #67
+* fix: sidebar style
+* fix(render): fix render link
### 2.2.1
> 2017-02-11
#### Bug fixes
-- fix(search): crash when not content, fixed #68
-- fix(event): scroll active sidebar
-- fix(search): not work in mobile
+
+* fix(search): crash when not content, fixed [#68](https://github.com/QingWei-Li/docsify/issues/68)
+* fix(event): scroll active sidebar
+* fix(search): not work in mobile
### 2.2.0
#### Features
-- Add `Google Analytics` plugin.
-```html
-
-
-```
+
+* Add `Google Analytics` plugin.
+ ```html
+
+
+ ```
### 2.1.0
+
#### Features
-- Add search plugin
-```html
-
-
-```
+
+* Add search plugin
+ ```html
+
+
+ ```
#### Bug fixes
-- fix sidebar style
+
+* fix sidebar style
### 2.0.3
+
#### Bug fixes
-- fix: rendering emojis
-- fix: css var polyfill
+
+* fix: rendering emojis
+* fix: css var polyfill
### 2.0.2
#### Bug fixes
-- fix button style in cover page.
+
+* fix button style in cover page.
### 2.0.1
+
#### Bug fixes
-- border style.
+
+* border style.
### 2.0.0
+
#### Features
-- Customize the theme color
+
+* Customize the theme color
#### Break change
-- Remove `data-router`, `data-sidebar`, `data-sidebar-toggle` APIs
+
+* Remove `data-router`, `data-sidebar`, `data-sidebar-toggle` APIs
### 1.10.5
+
#### Bug fixes
-- fix initialize the Vue instance
+
+* fix initialize the Vue instance
### 1.10.4
+
#### Bug fixes
-- fix execute script
+
+* fix execute script
### 1.10.3
+
#### Bug fixes
-- compatible vuep QingWei-Li/vuep/issues/2
-- fix sidebar scroll, fixed #63
+
+* compatible vuep ([#2](https://github.com/QingWei-Li/vuep/issues/2))
+* fix sidebar scroll, fixed [#63](https://github.com/QingWei-Li/docsify/issues/63)
### 1.10.2
+
#### Bug fixes
-- Fix render emojis again
+
+* Fix render emojis again
### 1.10.1
+
#### Bug fixes
-- Fix render emojis
+
+* Fix render emojis
### 1.10.0
+
#### Features
-- Support emoji :laughing:
+
+* Support emoji :laughing:
### 1.9.0
#### Bug fixes
-- Destroys the vue instance when the route is changed
+
+* Destroys the vue instance when the route is changed
#### Features
-- Add `!>` and `?>` doc helper.
+
+* Add `!>` and `?>` doc helper.
#### Break change
-- Remove `!` doc helper.
+
+* Remove `!` doc helper.
### 1.8.0
+
#### Bug fixes
-- Using `v-pre` skip compilation.
+
+* Using `v-pre` skip compilation.
### Features
-- Execute script when vue exists.
+
+* Execute script when vue exists.
### 1.7.4
+
#### Bug fixes
-- Fix bugs caused by the previous version
+
+* Fix bugs caused by the previous version
### 1.7.3
+
#### Bug fixes
-- Add `hr` style
-- Fixed option is an empty string
+
+* Add `hr` style
+* Fixed option is an empty string
### 1.7.2
+
#### Bug fixes
-- Fix sidebar click event in mobile browser.
+
+* Fix sidebar click event in mobile browser.
### 1.7.1
+
#### Bug fixes
-- Fix sidebar style in mobile browser.
+
+* Fix sidebar style in mobile browser.
### 1.7.0
#### Bug fixes
-- Fixed custom cover background, fixed #52
-- Fixed sticky sidebar
+
+* Fixed custom cover background, fixed [#52](https://github.com/QingWei-Li/docsify/issues/52)
+* Fixed sticky sidebar
### Features
-- Add `name` and `nameLink`
+
+* Add `name` and `nameLink`
### 1.6.1
+
#### Bug fixes
-- Fixed sidebar bug when the coverpage exist
+
+* Fixed sidebar bug when the coverpage exist
### 1.6.0
+
#### Features
-- Improve sidebar performance. The active item is automatically scrolled in the visible view.
-- New doc helper: `! `. e.g. `! content` will be rendered as `
content
`
+
+* Improve sidebar performance. The active item is automatically scrolled in the visible view.
+* New doc helper: `! `. e.g. `! content` will be rendered as `
+
+
+```
+
+!> In Markdown Dateien wird nur das Skript innerhalb des ersten script tag Blocks ausgeführt.
+
+## Kombiniere Vuep um Demos zu erschaffen
+
+[Vuep](https://github.com/QingWei-Li/vuep) ist eine Komponente zur Darstellung von Vue Komponenten mit einem Liveeditor und einer Vorschau.Unterstützt die Vue Komponenten spec und JSX.
+
+*index.html*
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+*README.md*
+
+```markdown
+# Vuep
+
+
+
+
+
+```
+
+?> Zum Beispiel vergleich auch die [vuep Dokumentation](https://qingwei-li.github.io/vuep/).
diff --git a/docs/de-de/write-a-plugin.md b/docs/de-de/write-a-plugin.md
new file mode 100644
index 0000000..5ce3b2d
--- /dev/null
+++ b/docs/de-de/write-a-plugin.md
@@ -0,0 +1,70 @@
+# Schreiben einer Erweiterung
+
+Eine Erweiterung ist schlicht eine Funktion, welche `hook` als Argument nimmt. hook unterstützt dabei das Verwalten von asynchrononen Tasks.
+
+## Volle Konfiguration
+
+```js
+window.$docsify = {
+ plugins: [
+ function (hook, vm) {
+ hook.init(function() {
+ // Called when the script starts running, only trigger once, no arguments,
+ })
+
+ hook.beforeEach(function(content) {
+ // Invoked each time before parsing the Markdown file.
+ // ...
+ return content
+ })
+
+ hook.afterEach(function(html, next) {
+ // Invoked each time after the Markdown file is parsed.
+ // beforeEach and afterEach support asynchronous。
+ // ...
+ // call `next(html)` when task is done.
+ next(html)
+ })
+
+ hook.doneEach(function() {
+ // Invoked each time after the data is fully loaded, no arguments,
+ // ...
+ })
+
+ hook.mounted(function() {
+ // Called after initial completion. Only trigger once, no arguments.
+ })
+
+ hook.ready(function() {
+ // Called after initial completion, no arguments.
+ })
+ }
+ ]
+}
+```
+
+!> Du kannst auf interne Methoden über `window.Docsify` zugreifen. Greife auf die aktuelle Instanz über das zweite Argument zu.
+
+## Beispiel
+
+Füge jeder Seite eine footer Komponente hinzu:
+
+```js
+window.$docsify = {
+ plugins: [
+ function (hook) {
+ var footer = [
+ '',
+ ''
+ ].join('')
+
+ hook.afterEach(function (html) {
+ return html + footer
+ })
+ }
+ ]
+}
+```
diff --git a/docs/index.html b/docs/index.html
index 0e500a9..0a4dc94 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -11,27 +11,44 @@
+
-
+
Loading ...
diff --git a/docs/sw.js b/docs/sw.js
deleted file mode 100644
index 92df1f4..0000000
--- a/docs/sw.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ===========================================================
- * docsify sw.js
- * ===========================================================
- * Copyright 2016 @huxpro
- * Licensed under Apache 2.0
- * Register service worker.
- * ========================================================== */
-
-const RUNTIME = 'docsify'
-const HOSTNAME_WHITELIST = [
- self.location.hostname,
- 'raw.githubusercontent.com',
- 'fonts.gstatic.com',
- 'fonts.googleapis.com',
- 'unpkg.com'
-]
-
-// The Util Function to hack URLs of intercepted requests
-const getFixedUrl = (req) => {
- var now = Date.now()
- var url = new URL(req.url)
-
- // 1. fixed http URL
- // Just keep syncing with location.protocol
- // fetch(httpURL) belongs to active mixed content.
- // And fetch(httpRequest) is not supported yet.
- url.protocol = self.location.protocol
-
- // 2. add query for caching-busting.
- // Github Pages served with Cache-Control: max-age=600
- // max-age on mutable content is error-prone, with SW life of bugs can even extend.
- // Until cache mode of Fetch API landed, we have to workaround cache-busting with query string.
- // Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190
- if (url.hostname === self.location.hostname) {
- url.search += (url.search ? '&' : '?') + 'cache-bust=' + now
- }
- return url.href
-}
-
-/**
- * @Lifecycle Activate
- * New one activated when old isnt being used.
- *
- * waitUntil(): activating ====> activated
- */
-self.addEventListener('activate', event => {
- event.waitUntil(self.clients.claim())
-})
-
-/**
- * @Functional Fetch
- * All network requests are being intercepted here.
- *
- * void respondWith(Promise r)
- */
-self.addEventListener('fetch', event => {
- // Skip some of cross-origin requests, like those for Google Analytics.
- if (HOSTNAME_WHITELIST.indexOf(new URL(event.request.url).hostname) > -1) {
- // Stale-while-revalidate
- // similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale
- // Upgrade from Jake's to Surma's: https://gist.github.com/surma/eb441223daaedf880801ad80006389f1
- const cached = caches.match(event.request)
- const fixedUrl = getFixedUrl(event.request)
- const fetched = fetch(fixedUrl, { cache: 'no-store' })
- const fetchedCopy = fetched.then(resp => resp.clone())
-
- // Call respondWith() with whatever we get first.
- // If the fetch fails (e.g disconnected), wait for the cache.
- // If there’s nothing in cache, wait for the fetch.
- // If neither yields a response, return offline pages.
- event.respondWith(
- Promise.race([fetched.catch(_ => cached), cached])
- .then(resp => resp || fetched)
- .catch(_ => { /* eat any errors */ })
- )
-
- // Update the cache with the version we fetched (only for ok status)
- event.waitUntil(
- Promise.all([fetchedCopy, caches.open(RUNTIME)])
- .then(([response, cache]) => response.ok && cache.put(event.request, response))
- .catch(_ => { /* eat any errors */ })
- )
- }
-})
diff --git a/docs/zh-cn/_navbar.md b/docs/zh-cn/_navbar.md
new file mode 100644
index 0000000..2528a73
--- /dev/null
+++ b/docs/zh-cn/_navbar.md
@@ -0,0 +1,4 @@
+- [:cn:](/zh-cn/)
+ - [:cn: 中文](/zh-cn/)
+ - [:de: German](/de-de/)
+ - [:uk: EN](/)
diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js
index 78250f2..bb2aeea 100644
--- a/src/core/render/compiler.js
+++ b/src/core/render/compiler.js
@@ -75,7 +75,7 @@ renderer.link = function (href, title, text) {
if (title) {
title = ` title="${title}"`
}
- return `${text}`
+ return `${text}`
}
renderer.paragraph = function (text) {
if (/^!>/.test(text)) {
From de0ad0f04c6b6ddb28f85da0e3d2f97f09189a10 Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Sun, 12 Mar 2017 08:44:52 +0800
Subject: [PATCH 113/733] docs(index.html): update languages
---
dev.html | 10 ++++++----
docs/_navbar.md | 4 ++--
docs/de-de/_navbar.md | 4 ++--
docs/index.html | 3 ---
docs/zh-cn/_navbar.md | 4 ++--
5 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/dev.html b/dev.html
index d928711..1f0ebef 100644
--- a/dev.html
+++ b/dev.html
@@ -7,12 +7,13 @@
+
-
diff --git a/docs/_navbar.md b/docs/_navbar.md
index 74aa775..0957c69 100644
--- a/docs/_navbar.md
+++ b/docs/_navbar.md
@@ -1,4 +1,4 @@
-- [:uk:](/)
+- :uk:
- [:cn: 中文](/zh-cn/)
- [:de: German](/de-de/)
- - [:uk: EN](/)
+ - [:uk: English](/)
diff --git a/docs/de-de/_navbar.md b/docs/de-de/_navbar.md
index e8b3274..95260cd 100644
--- a/docs/de-de/_navbar.md
+++ b/docs/de-de/_navbar.md
@@ -1,4 +1,4 @@
-- [:de:](/de-de/)
+- :de:
- [:cn: 中文](/zh-cn/)
- [:de: German](/de-de/)
- - [:uk: EN](/)
+ - [:uk: English](/)
diff --git a/docs/index.html b/docs/index.html
index 8e0d267..001d688 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -15,9 +15,6 @@
nav.app-nav li ul {
min-width: 100px;
}
- nav.app-nav a.active {
- border-bottom: none;
- }
diff --git a/docs/zh-cn/_navbar.md b/docs/zh-cn/_navbar.md
index 2528a73..47bc8f7 100644
--- a/docs/zh-cn/_navbar.md
+++ b/docs/zh-cn/_navbar.md
@@ -1,4 +1,4 @@
-- [:cn:](/zh-cn/)
+- :cn:
- [:cn: 中文](/zh-cn/)
- [:de: German](/de-de/)
- - [:uk: EN](/)
+ - [:uk: English](/)
From 92070e309920d058dd7360079c14958f3a98680c Mon Sep 17 00:00:00 2001
From: Leopoldthecoder
Date: Sun, 12 Mar 2017 19:51:30 +0800
Subject: [PATCH 114/733] fix external-script not inserting script at right
place
---
lib/plugins/external-script.js | 2 +-
lib/plugins/external-script.min.js | 2 +-
src/plugins/external-script.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/plugins/external-script.js b/lib/plugins/external-script.js
index 3a10883..fa46e39 100644
--- a/lib/plugins/external-script.js
+++ b/lib/plugins/external-script.js
@@ -11,8 +11,8 @@ function handleExternalScript () {
newScript[attribute] = script[attribute];
});
+ script.parentNode.insertBefore(newScript, script);
script.parentNode.removeChild(script);
- container.appendChild(newScript);
}
}
diff --git a/lib/plugins/external-script.min.js b/lib/plugins/external-script.min.js
index 6f7712b..b0093c6 100644
--- a/lib/plugins/external-script.min.js
+++ b/lib/plugins/external-script.min.js
@@ -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 c=document.createElement("script");["src","async","defer"].forEach(function(i){c[i]=n[i]}),n.parentNode.removeChild(n),i.appendChild(c)}}var n=function(n){n.doneEach(i)};window.$docsify.plugins=[].concat(n,window.$docsify.plugins)}();
+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)}();
diff --git a/src/plugins/external-script.js b/src/plugins/external-script.js
index 5d2771b..5b8b0dd 100644
--- a/src/plugins/external-script.js
+++ b/src/plugins/external-script.js
@@ -9,8 +9,8 @@ function handleExternalScript () {
newScript[attribute] = script[attribute]
})
+ script.parentNode.insertBefore(newScript, script)
script.parentNode.removeChild(script)
- container.appendChild(newScript)
}
}
From d57b80e224d73089d20a70094670e8bd18f2c522 Mon Sep 17 00:00:00 2001
From: Chris Anselmo
Date: Wed, 15 Mar 2017 03:50:26 -0400
Subject: [PATCH 115/733] Add ability to ignore headers when generating toc
(#127)
* Added ability to ignore some or all headings when generating toc in sidebar
* Added documentation for ignoring sub headers
* Fixed minor test issues
---
docs/more-pages.md | 22 ++++++++++++++++++++++
lib/docsify.js | 24 +++++++++++++++++++++---
lib/docsify.min.js | 2 --
lib/plugins/emoji.min.js | 1 -
lib/plugins/external-script.min.js | 1 -
lib/plugins/front-matter.min.js | 1 -
lib/plugins/ga.min.js | 1 -
lib/plugins/search.min.js | 1 -
lib/plugins/zoom-image.min.js | 1 -
lib/themes/buble.css | 1 -
lib/themes/dark.css | 1 -
lib/themes/pure.css | 1 -
lib/themes/vue.css | 1 -
src/core/render/compiler.js | 22 ++++++++++++++++++++--
14 files changed, 63 insertions(+), 17 deletions(-)
delete mode 100644 lib/docsify.min.js
delete mode 100644 lib/plugins/emoji.min.js
delete mode 100644 lib/plugins/external-script.min.js
delete mode 100644 lib/plugins/front-matter.min.js
delete mode 100644 lib/plugins/ga.min.js
delete mode 100644 lib/plugins/search.min.js
delete mode 100644 lib/plugins/zoom-image.min.js
delete mode 100644 lib/themes/buble.css
delete mode 100644 lib/themes/dark.css
delete mode 100644 lib/themes/pure.css
delete mode 100644 lib/themes/vue.css
diff --git a/docs/more-pages.md b/docs/more-pages.md
index 59ceb33..dbe2e7f 100644
--- a/docs/more-pages.md
+++ b/docs/more-pages.md
@@ -68,3 +68,25 @@ A custom sidebar can also automatically generate a table of contents by setting
```
+
+## Ignoring Subheaders
+
+When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it.
+
+```markdown
+# Getting Started
+
+## Header {docsify-ignore}
+This header won't appear in the sidebar table of contents.
+```
+
+To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
+
+```markdown
+# Getting Started {docsify-ignore-all}
+
+## Header
+This header won't appear in the sidebar table of contents.
+```
+
+Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used.
diff --git a/lib/docsify.js b/lib/docsify.js
index 7b60b40..e76a23f 100644
--- a/lib/docsify.js
+++ b/lib/docsify.js
@@ -2992,10 +2992,24 @@ markdown.update = function () {
* @link https://github.com/chjj/marked#overriding-renderer-methods
*/
renderer.heading = function (text, level) {
+ var nextToc = { level: level, title: text };
+
+ if (/{docsify-ignore}/g.test(text)) {
+ text = text.replace('{docsify-ignore}','');
+ nextToc.title = text;
+ nextToc.ignoreSubHeading = true;
+ }
+
+ if (/{docsify-ignore-all}/g.test(text)) {
+ text = text.replace('{docsify-ignore-all}','');
+ nextToc.title = text;
+ nextToc.ignoreAllSubs = true;
+ }
+
var slug = slugify(text);
var url = toURL(currentPath, { id: slug });
-
- toc.push({ level: level, slug: url, title: text });
+ nextToc.slug = url;
+ toc.push(nextToc);
return ("" + text + "")
};
@@ -3017,7 +3031,7 @@ renderer.link = function (href, title, text) {
if (title) {
title = " title=\"" + title + "\"";
}
- return ("" + text + "")
+ return ("" + text + "")
};
renderer.paragraph = function (text) {
if (/^!>/.test(text)) {
@@ -3061,7 +3075,11 @@ function sidebar (text, level) {
*/
function subSidebar (el, level) {
if (el) {
+ toc[0] && toc[0].ignoreAllSubs && (toc = []);
toc[0] && toc[0].level === 1 && toc.shift();
+ toc.forEach(function (node, i) {
+ node.ignoreSubHeading && toc.splice(i, 1);
+ });
var tree$$1 = cacheTree[currentPath] || genTree(toc, level);
el.parentNode.innerHTML += tree(tree$$1, '