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

doctasia

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doctasia - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

lib/template/beauty/css/beauty.css

68

lib/doctasia.js

@@ -6,2 +6,3 @@

var wrench = require("wrench")
var path = require("path")
var fs = require("fs")

@@ -53,2 +54,4 @@

var lastIndex = 0
for(var j = 0 ; j < page.menu.length ; j++) {

@@ -59,3 +62,10 @@ var menuItem = page.menu[j]

console.log("replacing ["+menuItem.original+"] with ["+replaceString+"]")
page.htmlContent = page.htmlContent.replace(menuItem.original, replaceString)
var index = page.htmlContent.indexOf(menuItem.original, lastIndex);
if(index !== -1) {
page.htmlContent = page.htmlContent.substring(0, index) + replaceString + page.htmlContent.substring(index + menuItem.original.length, page.htmlContent.length)
lastIndex = index;
}
}

@@ -70,2 +80,23 @@

}
if(manifest.sections) {
for(var j = 0 ; j < manifest.sections.length ; j++) {
var section = manifest.sections[j]
if(section.title === page.section) {
console.log("** Adding page ["+page.title+"] to section ["+section.title+"]")
if(!section.pages) {
section.pages = []
}
section.pages.push(page)
break
}
}
}
}

@@ -79,2 +110,4 @@

copyAssets(manifest, path.dirname(manifestFilePath), outputDir)
compilePages(outputDir, manifest, theme, function(err) {

@@ -91,2 +124,19 @@ if(err) {

function copyAssets(manifest, sourceDir, outputDir) {
if(manifest.assets) {
var assetsDir = outputDir+"/assets/"
if(!fs.existsSync(assetsDir)) {
console.log("Creating directory ["+assetsDir+"]")
fs.mkdirSync(assetsDir)
}
for(var i = 0 ; i < manifest.assets.length ; i++) {
var asset = manifest.assets[i]
fs.createReadStream(process.env.PWD + "/" + asset).pipe(fs.createWriteStream(assetsDir+path.basename(asset)));
}
}
}
function loadTemplate(theme) {

@@ -147,2 +197,5 @@ // TODO: make template configurable

var reservedMenuIds = {}
var count = 1;
while(result !== null) {

@@ -157,6 +210,15 @@

level: level,
original: result[0],
id: result[2].replace(/[^a-z0-9]/ig, "_")
original: result[0]
}
var menuId = result[2].replace(/[^a-z0-9]/ig, "_")
if(reservedMenuIds.hasOwnProperty(menuId)) {
reservedMenuIds[menuId] ++
menuId = menuId + "_" + reservedMenuIds[menuId]
} else {
reservedMenuIds[menuId] = 0
}
menuItem.id = menuId
menu.push(menuItem)

@@ -163,0 +225,0 @@ }

2

package.json
{
"name": "doctasia",
"version": "0.0.5",
"version": "0.0.6",
"author": "Nicolas Herment <nherment@gmail.com>",

@@ -5,0 +5,0 @@ "preferGlobal": "true",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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