Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
gitbook-plugin-edit-link
Advanced tools
GitBook Plugin to add "Edit this page" link on every page. Link target will be that page's source file on Github or Gitlab or any repo.
This GitBook Plugin adds "Edit This Page" link on every page.
Link target will be that page's source file on Github or Gitlab or any repo.
book.json
filebook.json
file, add edit-link
to plugins
list.pluginsConfig
, Set base
value which is base path to your github or gitlab or other code repo. Trailing slash is NOT required.label
.book.json
file for gitbook version 2.0.1 and above{
"gitbook": "2.0.1",
"plugins": ["edit-link"],
"pluginsConfig": {
"edit-link": {
"base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
"label": "Edit This Page"
}
}
}
book.json
file for gitbook version 2.0.1+ and multilingual labels{
"gitbook": "2.0.1",
"plugins": ["edit-link"],
"pluginsConfig": {
"edit-link": {
"base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
"label": {
"en": "Edit This Page",
"de": "Seite bearbeiten"
}
}
}
}
book.json
file for older gitbook versions <= 1.5.0{
"gitbook": "1.5.0",
"plugins": ["edit-link@1.1.0"],
"pluginsConfig": {
"edit-link": {
"base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
"label": "Edit This Page"
}
}
}
Note: Above snippet can be used as complete book.json
file, if your book doesn't have one yet.
Github/Gitlab: In string ...REPO/edit/BRANCH...
, you may replace edit
with tree
if you want source file to open in read-mode, rather than edit-mode directly on github/gitlab.
gitbook install
. It will automatically install edit-link
gitbook plugin for your book. This is needed only once.gitbook build
) or serve (gitbook serve
) as usual.book.json
is valid. You can use this online tool - http://json.parser.online.fr/beta/Gitbook 2.0.1 has removed page:after
hook which this plugin needs. An issue has been reported here - https://github.com/GitbookIO/gitbook/issues/724 but meanwhile this plugin is using workaround added by this pull request - https://github.com/rtCamp/gitbook-plugin-edit-link/pull/4
So when using Gitbook 2.0.1, you may see following warning in console at the time of running build:
warn: hook 'page' used by plugin 'gitbook-plugin-edit-link' is deprecated, and will be remove in the coming versions
You can safely ignore above warning for now.
This plugin simply looks for HTML comment <!-- Actions Right -->
in parsed page content and insert "edit link" HTML just before <!-- Actions Right -->
.
This means if that HTML comment changes, this plugin will break but I hope to fix it easily whenever that happen.
1.3 - 28 April 2015
1.2 - 03 April 2015
1.1.3 - 11 Jan 2015
FAQs
GitBook Plugin to add "Edit this page" link on every page. Link target will be that page's source file on Github or Gitlab or any repo.
We found that gitbook-plugin-edit-link demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.