Socket
Socket
Sign inDemoInstall

markdown-documentation-generator

Package Overview
Dependencies
113
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.0 to 2.4.1

test/config-file/about.md

67

index.js

@@ -61,5 +61,2 @@ #!/usr/bin/env node

//Set up identifiers
_sg.uniqueIdentifier = 'md-sg';
//Argument methods

@@ -142,2 +139,3 @@ const arg = {

* Merge custom options with default options.
* Resolves paths and makes sure they're output in a relative format.
*

@@ -186,4 +184,6 @@ * @param {Object} customOptions - user-provided options

* Read configuration
*
* @param {Object} customOptions - user-provided options
* @return {Object} - Merged user and default options
*/
function registerConfig(customOptions) {

@@ -193,2 +193,3 @@

listFiles(_sg.brand('Configuration'));
//Read passed object or .styleguide file
customOptions = customOptions || fs.readJSONSync('.styleguide', 'utf8');

@@ -268,3 +269,3 @@ }

if (_.isUndefined(currentSection)){
//Use the "default" section (the one using no pattern match)
//Use the "default" section (the section without a pattern match)
currentSection = _.invert(options.sections)[''];

@@ -306,2 +307,8 @@ sectionIdentifier = '';

//Grab the filelocation and store it
$article(tags.file).each(function () {
articleData.filelocation = $article(this).text().trim();
}).remove();
$article(tags.section).each(function () {

@@ -314,3 +321,3 @@ articleData.currentSection = $article(this).text().trim();

console.info(_sg.logPre + _sg.warn("Warning: '" + chalk.bold(articleData.currentSection) +
"' is not a registered section in your configuration."));
"' is not a registered section in your configuration. (" + articleData.filelocation + ")"));
sectionIdentifier = '';

@@ -324,5 +331,8 @@ }

if (articleData.category === '') {
articleData.category = $article(this).text()
articleData.category = $article(this)
.text()
.replace(/^\s+|\s+$/g, '')
.replace(sectionIdentifier, '').trim();
.replace(sectionIdentifier, '')
.trim();
$article(this).remove();

@@ -352,8 +362,2 @@ }

//Grab the filelocation and store it
$article(tags.file).each(function () {
articleData.filelocation = $article(this).text().trim();
}).remove();
//Grab priority tag data and convert them to meaningful values

@@ -418,3 +422,2 @@ $article(tags.priority).each(function() {

sectionIdentifier = sectionInfo[1];
}

@@ -438,4 +441,6 @@ else if (previousArticle !== undefined) {

//Move category data to master
return checkData(articleData);
//Move and place article data into master
articleData = checkData(articleData);
return articleData;
});

@@ -462,3 +467,3 @@

//If the section's ID has already been cached,
// just append its data to the previous object
//append its data to the previous object
if (idCache.hasOwnProperty(articleData.id)) {

@@ -478,6 +483,9 @@

}
if (articleData.code.length > 0 ) {
if (articleData.code.length > 0) {
selectedSection.code = _.union(selectedSection.code, articleData.code);
}
//Set previous article so we can refer back if necessary
previousArticle = selectedSection;
return;

@@ -499,7 +507,8 @@ }

//Set previous article so we can refer back if necessary
previousArticle = articleData;
//Append new section to master data
sanitize.objectPush(masterData.sections[currentSection], articleData);
previousArticle = articleData;
}

@@ -523,3 +532,3 @@ }

//Sort Sections
Object.keys(data.sections).forEach(function(category){
Object.keys(data.sections).forEach(function(category) {
data.sections[category] = sorting(data.sections[category]);

@@ -572,3 +581,3 @@ });

//Create menu and section JSON
Object.keys(options.sections).forEach(function(section){
Object.keys(options.sections).forEach(function(section) {
data.menus[section] = formatSections(section, true);

@@ -610,3 +619,3 @@ data.sections[section] = formatSections(section, false);

*/
function readSGFile(fileExtension, root, name, fileContents) {
function readSGFile(fileExtension, root, name, fileContents, callback) {

@@ -631,2 +640,4 @@ fs.readFile(path.join(root, name), 'utf8', function (err, content) {

}
callback();
});

@@ -701,7 +712,6 @@ }

walker.on("file", function (root, fileStats, next) {
let fileExtension = fileStats.name.substr((~-fileStats.name.lastIndexOf(".") >>> 0) + 2).toLowerCase();
const fileExtension = fileStats.name.substr((~-fileStats.name.lastIndexOf(".") >>> 0) + 2).toLowerCase();
if (options.fileExtensions[fileExtension]) {
readSGFile(fileExtension, root, fileStats.name, fileContents);
next();
readSGFile(fileExtension, root, fileStats.name, fileContents, next);
}

@@ -728,6 +738,5 @@ else {

'\n * If you\'re using the default settings, try using the "init" argument.'+
'\n If you\'re still receiving this error, please check the documentation or file an issue at '+
'\n If you\'re still receiving this error, please check the documentation or file an issue at: \n'+
chalk.blue.bold('github.com/UWHealth/markdown-documentation-generator/')
);
return false;
}

@@ -734,0 +743,0 @@

@@ -9,2 +9,3 @@ /* jshint node: true */

module.exports = {
uniqueIdentifier: "md-sg",
error: chalk.red,

@@ -11,0 +12,0 @@ good: chalk.green,

@@ -61,2 +61,3 @@ /* jshint node: true */

var processedText = '';
const langPrefix = options.markedOptions.langPrefix || " ";

@@ -73,3 +74,3 @@ if (lang) {

'<code class="hljs sg-code '+
options.markedOptions.langPrefix+'">' +
langPrefix+'">' +
processedText +

@@ -76,0 +77,0 @@ '\n</code></pre>'+

@@ -191,3 +191,2 @@ /* jshint node: true */

sanitize.path = function(from, to){

@@ -194,0 +193,0 @@ return path.relative(from, path.join(__dirname, '../', to));

{
"name": "markdown-documentation-generator",
"version": "2.4.0",
"version": "2.4.1",
"description": "Searches files for markdown and generates a static style/documentation guide. A fork of markdown-styleguide-generator.",

@@ -36,3 +36,3 @@ "main": "index.js",

"cheerio": "^0.20.0",
"fs-extra": "^0.30.0",
"fs-extra": "^3.0.1",
"handlebars": "^4.0.0",

@@ -51,7 +51,3 @@ "highlight.js": "^9.5.0",

},
"readmeFilename": "README.md",
"gitHead": "058fe1fab36c2957cff03ea43d896ec7f47acddf",
"_id": "markdown-documentation-generator@1.3.0",
"_shasum": "3803bbd214de1ddbbb8e1c1c9fac54ce79711d7a",
"_from": "markdown-documentation-generator@>=1.2.0 <2.0.0"
"readmeFilename": "README.md"
}
# markdown-documentation-generator
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bb0cc50ea95f47cfba2ccece0ef73cbb)](https://www.codacy.com/app/cleecanth/markdown-documentation-generator?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=UWHealth/markdown-documentation-generator&amp;utm_campaign=Badge_Grade)
### Screenshot

@@ -4,0 +6,0 @@ ![Screenshot](https://raw.githubusercontent.com/UWHealth/markdown-documentation-generator/master/docs/screenshot-example.jpg)

@@ -26,5 +26,6 @@ // "use strict";

var nodemon = require('nodemon');
var config = require('../nodemon-watch.js');
nodemon('../../index.js lf').on('exit', function(){
process.exit(0);
nodemon(config, "ls").on('log', function(event) {
console.log(event.colour);
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc