feat: add edit button demo, close #162

This commit is contained in:
qingwei.li 2017-05-30 20:14:31 +08:00
parent a64cee1236
commit 036fdac131
No known key found for this signature in database
GPG Key ID: B6DDC2F7AE80B2F4
3 changed files with 72 additions and 0 deletions

View File

@ -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
})
}
]
}
```

View File

@ -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
})
}
]
}
```

View File

@ -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
})
}
]
}
```