Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/njleonzhang/docsify-edit-on-github
https://github.com/njleonzhang/docsify-edit-on-github
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/njleonzhang/docsify-edit-on-github
- Owner: njleonzhang
- License: mit
- Created: 2017-08-31T06:55:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-02T15:57:08.000Z (5 months ago)
- Last Synced: 2024-10-07T02:17:24.255Z (about 1 month ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 76
- Watchers: 1
- Forks: 21
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docsify-edit-on-github
A plugin for docsify to generate a `edit on github` button on every pages. click the button to open corresponding `md` editing page on github.```html
```
```html
window.$docsify = {
// your config
// ...
plugins: [
EditOnGithubPlugin.create(docBase, docEditBase, title)
]
}```
* `docBase`: [String] the document folder of your github project (e.g.: https://github.com/docsifyjs/docsify/blob/master/docs/)
* `docEditBase`: [String] edit link of your github pages, by default, this is set automatically according to `docBase`
* `title`: [String | Function] the text of the button, default value: `Edit on github`. If passed as function, then the title can be customized according to file path. for example:
```
EditOnGithubPlugin.create(
'https://github.com/docsifyjs/docsify/blob/master/docs/',
null,
function(file) {
if (file.indexOf('en') === -1) {
return '编辑'
} else {
return 'edit on git'
}
}
)
```[Code example](https://github.com/njleonzhang/vue-data-tables/blob/6bb632419506a14ceff559708180883097d5afa2/docs/index.html#L179-L181)
[Result example](https://www.njleonzhang.com/vue-data-tables/#/en-us/basic)