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 - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

39

index.js
module.exports = {
book: {
// assets: "./book",
// js: [
// "test.js"
// ],
// css: [
// "test.css"
// ],
// html: {
// "html:start": function() {
// return "<!-- Start book "+this.options.title+" -->"
// },
// "html:end": function() {
// return "<!-- End of book "+this.options.title+" -->"
// },
//
// "head:start": "<!-- head:start -->",
// "head:end": "<!-- head:end -->",
//
// "body:start": "<!-- body:start -->",
// "body:end": "<!-- body:end -->"
// }
// },
hooks: {

@@ -29,6 +6,16 @@ // After html generation

page.content = page.content.replace(
rtEditLinkBase = this.options.pluginsConfig.rtEditLinkBase;
if (typeof this.options.pluginsConfig.rtEditLinkLabel === 'undefined') {
rtEditLinkLabel = "Edit This Page";
} else {
rtEditLinkLabel = this.options.pluginsConfig.rtEditLinkLabel;
}
rtEditLink = '<a href="' + this.options.pluginsConfig.rtEditLinkBase + '/' + page.path + '" class="btn fa fa-edit pull-left">&nbsp;&nbsp;' + rtEditLinkLabel + '</a>';
page.content = page.content.replace (
'<!-- Actions Right -->',
'<a href="' + this.options.pluginsConfig.rtEditLinkBase + '/' + page.path + '" class="btn fa fa-edit pull-left"><b>Edit This Page on Github</b></a>' + '<!-- Actions Right -->'
)
rtEditLink + '<!-- Actions Right -->'
)

@@ -35,0 +22,0 @@ return page;

@@ -5,3 +5,3 @@ {

"main": "index.js",
"version": "1.0.0",
"version": "1.1.0",
"author": "rtCamp <admin@rtcamp.com>",

@@ -8,0 +8,0 @@ "contributors": [{

@@ -15,2 +15,6 @@ GitBook Plugin: Edit Link

### Changing Link Label (Localization)
By default link label will be "Edit This Page". You can change it using plugin config `rtEditLinkLabel`.
## Sample `book.json` file

@@ -24,3 +28,4 @@

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

@@ -27,0 +32,0 @@ }

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