Skip to content

Commit

Permalink
feat: add edit button demo, close #162
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed May 30, 2017
1 parent a64cee1 commit 036fdac
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/de-de/write-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ window.$docsify = {

## Beispiel

### footer

Füge jeder Seite eine footer Komponente hinzu:

```js
Expand All @@ -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
})
}
]
}
```
23 changes: 23 additions & 0 deletions docs/write-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ window.$docsify = {

## Example

#### footer

Add footer component in each pages.

```js
Expand All @@ -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
})
}
]
}
```
25 changes: 25 additions & 0 deletions docs/zh-cn/write-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ window.$docsify = {

## 例子


### footer

给每个页面的末尾加上 `footer`

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

0 comments on commit 036fdac

Please sign in to comment.