New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gitbook-plugin-edit-link

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-edit-link

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.

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
886
decreased by-26.53%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Usage

  1. In you gitbook's book.json file, add edit-link to plugins list.
  2. Set rtEditLinkBase value which is base path to your github or gitlab or other code repo. Trailing slash is NOT required.
  3. Run gitbook install. It will automatically install edit-this-page-link gitbook plugin for your book. This is needed only once.
  4. Finally build your book (gitbook build) or serve (gitbook serve) as usual.

By default link label will be "Edit This Page". You can change it using plugin config rtEditLinkLabel.

Sample book.json file

Important: Make sure you edit value of rtEditLinkBase. You can replace edit with tree if you want source file to open in read-mode, rather than edit-mode directly on github/gitlab.

{
    "plugins": ["edit-link"],
    "pluginsConfig": {
        "rtEditLinkBase": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
        "rtEditLinkLabel": "Edit This Page"
    }
}

Above snippet can be used as complete book.json file, if your book doesn't have one yet.

Troubleshooting

  1. If you are not seeing the "Edit this page" link, check if your book.json is valid. You can use this online tool - http://json.parser.online.fr/beta/
  2. Check if you are using default gitbook theme. It is NOT recommended to modify gitbook themes directly.

How this work?

This plugin simply looks for HTML comment <!-- Actions Right --> in parsed page content and insert HTML will be that page's source file on Github or Gitlab or any repo.

Keywords

FAQs

Package last updated on 11 Jan 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc