feat: add edit button demo, close #162
This commit is contained in:
parent
a64cee1236
commit
036fdac131
3 changed files with 72 additions and 0 deletions
|
|
@ -47,6 +47,8 @@ window.$docsify = {
|
||||||
|
|
||||||
## Beispiel
|
## Beispiel
|
||||||
|
|
||||||
|
### footer
|
||||||
|
|
||||||
Füge jeder Seite eine footer Komponente hinzu:
|
Füge jeder Seite eine footer Komponente hinzu:
|
||||||
|
|
||||||
```js
|
```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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
@ -47,6 +47,8 @@ window.$docsify = {
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
#### footer
|
||||||
|
|
||||||
Add footer component in each pages.
|
Add footer component in each pages.
|
||||||
|
|
||||||
```js
|
```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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,9 @@ window.$docsify = {
|
||||||
|
|
||||||
## 例子
|
## 例子
|
||||||
|
|
||||||
|
|
||||||
|
### footer
|
||||||
|
|
||||||
给每个页面的末尾加上 `footer`
|
给每个页面的末尾加上 `footer`
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
@ -67,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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue