From 036fdac131b649268143bbe74089067df3e3f797 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Tue, 30 May 2017 20:14:31 +0800 Subject: [PATCH] feat: add edit button demo, close #162 --- docs/de-de/write-a-plugin.md | 24 ++++++++++++++++++++++++ docs/write-a-plugin.md | 23 +++++++++++++++++++++++ docs/zh-cn/write-a-plugin.md | 25 +++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/docs/de-de/write-a-plugin.md b/docs/de-de/write-a-plugin.md index 5ce3b2d6e..9450c86c4 100644 --- a/docs/de-de/write-a-plugin.md +++ b/docs/de-de/write-a-plugin.md @@ -47,6 +47,8 @@ window.$docsify = { ## Beispiel +### footer + Füge jeder Seite eine footer Komponente hinzu: ```js @@ -68,3 +70,25 @@ window.$docsify = { ] } ``` + + +### Edit Button + +```js +window.$docsify = { + plugins: [ + function(hook, vm) { + hook.beforeEach(function (html) { + var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm.router.getFile() + var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n' + + return editHtml + + html + + '\n----\n' + + 'Last modified {docsify-updated} ' + + editHtml + }) + } + ] +} +``` \ No newline at end of file diff --git a/docs/write-a-plugin.md b/docs/write-a-plugin.md index 045cd6157..df5fec038 100644 --- a/docs/write-a-plugin.md +++ b/docs/write-a-plugin.md @@ -47,6 +47,8 @@ window.$docsify = { ## Example +#### footer + Add footer component in each pages. ```js @@ -68,3 +70,24 @@ window.$docsify = { ] } ``` + +### Edit Button + +```js +window.$docsify = { + plugins: [ + function(hook, vm) { + hook.beforeEach(function (html) { + var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm.router.getFile() + var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n' + + return editHtml + + html + + '\n----\n' + + 'Last modified {docsify-updated} ' + + editHtml + }) + } + ] +} +``` diff --git a/docs/zh-cn/write-a-plugin.md b/docs/zh-cn/write-a-plugin.md index 27544e450..1608e2956 100644 --- a/docs/zh-cn/write-a-plugin.md +++ b/docs/zh-cn/write-a-plugin.md @@ -46,6 +46,9 @@ window.$docsify = { ## 例子 + +### footer + 给每个页面的末尾加上 `footer` ```js @@ -66,4 +69,26 @@ window.$docsify = { } ] } +``` + + +### Edit Button + +```js +window.$docsify = { + plugins: [ + function(hook, vm) { + hook.beforeEach(function (html) { + var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm.router.getFile() + var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n' + + return editHtml + + html + + '\n----\n' + + 'Last modified {docsify-updated} ' + + editHtml + }) + } + ] +} ``` \ No newline at end of file