Skip to content

Commit 036fdac

Browse files
committed
feat: add edit button demo, close #162
1 parent a64cee1 commit 036fdac

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

docs/de-de/write-a-plugin.md

+24
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ window.$docsify = {
4747

4848
## Beispiel
4949

50+
### footer
51+
5052
Füge jeder Seite eine footer Komponente hinzu:
5153

5254
```js
@@ -68,3 +70,25 @@ window.$docsify = {
6870
]
6971
}
7072
```
73+
74+
75+
### Edit Button
76+
77+
```js
78+
window.$docsify = {
79+
plugins: [
80+
function(hook, vm) {
81+
hook.beforeEach(function (html) {
82+
var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm.router.getFile()
83+
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
84+
85+
return editHtml
86+
+ html
87+
+ '\n----\n'
88+
+ 'Last modified {docsify-updated} '
89+
+ editHtml
90+
})
91+
}
92+
]
93+
}
94+
```

docs/write-a-plugin.md

+23
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ window.$docsify = {
4747

4848
## Example
4949

50+
#### footer
51+
5052
Add footer component in each pages.
5153

5254
```js
@@ -68,3 +70,24 @@ window.$docsify = {
6870
]
6971
}
7072
```
73+
74+
### Edit Button
75+
76+
```js
77+
window.$docsify = {
78+
plugins: [
79+
function(hook, vm) {
80+
hook.beforeEach(function (html) {
81+
var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm.router.getFile()
82+
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
83+
84+
return editHtml
85+
+ html
86+
+ '\n----\n'
87+
+ 'Last modified {docsify-updated} '
88+
+ editHtml
89+
})
90+
}
91+
]
92+
}
93+
```

docs/zh-cn/write-a-plugin.md

+25
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ window.$docsify = {
4646

4747
## 例子
4848

49+
50+
### footer
51+
4952
给每个页面的末尾加上 `footer`
5053

5154
```js
@@ -66,4 +69,26 @@ window.$docsify = {
6669
}
6770
]
6871
}
72+
```
73+
74+
75+
### Edit Button
76+
77+
```js
78+
window.$docsify = {
79+
plugins: [
80+
function(hook, vm) {
81+
hook.beforeEach(function (html) {
82+
var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm.router.getFile()
83+
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
84+
85+
return editHtml
86+
+ html
87+
+ '\n----\n'
88+
+ 'Last modified {docsify-updated} '
89+
+ editHtml
90+
})
91+
}
92+
]
93+
}
6994
```

0 commit comments

Comments
 (0)