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

gitbook-plugin-blackbeard

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-blackbeard - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

17

index.js
"use strict";
let references = {};
let configRefs = {};
const slug = require("slug");
const path = require("path");

@@ -28,6 +27,9 @@

module.exports = {
book: {},
hooks: {
init: function() {
configRefs = this.options.pluginsConfig.references || {}
},
"page:before": function(page) {
const frontpageLink = "/" + require("path").relative(page.path, "docs");
const frontpageLink = path.relative(path.dirname(page.path), ".");

@@ -80,5 +82,10 @@ let content, references;

for(let key in configRefs) {
references[key] = path.relative(path.dirname(page.path), path.dirname(configRefs[key]));
references[key] = path.join(references[key], path.basename(configRefs[key]));
}
for(let key in references) {
let link = references[key];
link = link.indexOf("/") !== -1 ? link : `#${link}`;
link = link.indexOf("/") !== -1 || link.indexOf(".html") !== -1 ? link : `#${link}`;

@@ -85,0 +92,0 @@ content += `[\`${key}\`]: ${link}\n`;

@@ -6,2 +6,4 @@ "use strict";

const marked = require("marked");
/**

@@ -46,3 +48,3 @@ * Generates a table of contents for Markdown files

return `<${header} id="${slug}">${$2}</${header}>\n`;
return `<${header} id="${slug}">${marked($2)}</${header}>\n`;
}

@@ -49,0 +51,0 @@

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

"description": "Blackbeard documentation plugin for Gitbook",
"devDependencies": {},
"devDependencies": {
"marked": "^0.3.5"
},
"directories": {},

@@ -20,3 +22,3 @@ "engines": {

"scripts": {},
"version": "1.0.1",
"version": "1.0.2",
"repository": {

@@ -23,0 +25,0 @@ "type": "git",

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