-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Edit file button #162
Comments
Hi, @Kikobeats function(hook, vm) {
const path = window.Docsify.route.parse().path
console.log(vm.$getFile(path)) // such as `/README.md`
} Do you want to submit a PR to implement it? 👻 |
could be good idea place the html for the button and put the href using js? |
We can insert html by hook function. See https://github.com/QingWei-Li/docsify/blob/master/docs/index.html#L56 and https://docsify.js.org/#/write-a-plugin |
Hi, @Kikobeats I have added it to the doc, you can refer to this example. window.$docsify = {
plugins: [
function(hook, vm) {
hook.beforeEach(function (html) {
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs' + vm.router.getFile()
var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'
return editHtml
+ html
+ '\n----\n'
+ 'Last modified {docsify-updated} '
+ editHtml
})
}
]
} |
amazing, let me try it into mythbusters website, thanks! |
@QingWei-Li any idea how I can insert int after the first |
Is it possible to use regular expression? |
@QingWei-Li sounds very weird |
Hello!
I'm using docsify at JS MythBusters, thanks for the project, it looks amazing 😄.
One of my goals of the project is make easy people add more information.
Because every item of the table of contents is mapped with a markdown file, do you think that could be more or less easy add a "Edit file" button (like Wikipedia) and automatically create a PR associated with the project?
Maybe it could be written as a plugin.
The text was updated successfully, but these errors were encountered: