Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsdoc-to-markdown

Package Overview
Dependencies
Maintainers
1
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdoc-to-markdown - npm Package Compare versions

Comparing version 2.0.0-alpha.12 to 2.0.0-alpha.13

11

docs/API.md

@@ -22,2 +22,3 @@ <a name="module_jsdoc-to-markdown"></a>

* [~JsdocOptions](#module_jsdoc-to-markdown..JsdocOptions)
* [.cache](#module_jsdoc-to-markdown..JsdocOptions.JsdocOptions+cache)
* [.files](#module_jsdoc-to-markdown..JsdocOptions.JsdocOptions+files) : <code>string</code> &#124; <code>Array.&lt;string&gt;</code>

@@ -166,2 +167,3 @@ * [.source](#module_jsdoc-to-markdown..JsdocOptions.JsdocOptions+source) : <code>string</code>

* [~JsdocOptions](#module_jsdoc-to-markdown..JsdocOptions)
* [.cache](#module_jsdoc-to-markdown..JsdocOptions.JsdocOptions+cache)
* [.files](#module_jsdoc-to-markdown..JsdocOptions.JsdocOptions+files) : <code>string</code> &#124; <code>Array.&lt;string&gt;</code>

@@ -175,2 +177,11 @@ * [.source](#module_jsdoc-to-markdown..JsdocOptions.JsdocOptions+source) : <code>string</code>

<a name="module_jsdoc-to-markdown..JsdocOptions.JsdocOptions+cache"></a>
#### jsdocOptions.cache
Set to false to disable memoisation cache. Defaults to true.
**Kind**: instance property of <code>[JsdocOptions](#module_jsdoc-to-markdown..JsdocOptions)</code>
-
<a name="module_jsdoc-to-markdown..JsdocOptions.JsdocOptions+files"></a>

@@ -177,0 +188,0 @@

1

es5/bin/cli.js
'use strict';
var tool = require('command-line-tool');
var path = require('path');
var version = require('../../package').version;

@@ -6,0 +5,0 @@

'use strict';
var jsdocDefinitions = [{
name: 'files', alias: 'f', type: String, multiple: true, defaultOption: true,
name: 'files',
alias: 'f',
type: String,
multiple: true,
defaultOption: true,
description: 'A list of jsdoc explain files (or glob expressions) to parse for documentation. Either this or [bold]{--source} must be supplied.',
typeLabel: '[underline]{file} ...'
}, {
name: 'source', type: String,
name: 'source',
type: String,
description: 'A string containing source code to parse for documentation. Either this or [bold]{--files} must be supplied.'

@@ -16,51 +21,100 @@ }, {

description: 'Path to a jsdoc configuration file, passed directly to `jsdoc -c`.'
}, { name: 'html', type: Boolean, description: "Enable experimental parsing of .html files. When specified, any configuration supplied via [bold]{--configure} is ignored." }];
}, {
name: 'html',
type: Boolean,
description: 'Enable experimental parsing of .html files. When specified, any configuration supplied via [bold]{--configure} is ignored.'
}];
var jsdoc2mdDefinitions = [{
name: 'help', description: 'Print usage information',
alias: 'h', type: Boolean
name: 'help',
description: 'Print usage information',
alias: 'h',
type: Boolean
}, {
name: 'config', description: 'Print all options supplied (from command line, `.jsdoc2md.json` or `package.json` under the `jsdoc2md` property) and exit. Useful for checking the tool is receiving the correct config.',
name: 'config',
description: 'Print all options supplied (from command line, `.jsdoc2md.json` or `package.json` under the `jsdoc2md` property) and exit. Useful for checking the tool is receiving the correct config.',
type: Boolean
}, {
name: 'json', type: Boolean,
name: 'json',
type: Boolean,
description: 'Prints the data (jsdoc-parse output) supplied to the template (dmd).'
}, {
name: 'jsdoc', type: Boolean,
name: 'jsdoc',
type: Boolean,
description: 'Prints the raw jsdoc data.'
}, { name: 'version', type: Boolean }, {
name: 'clear', type: Boolean,
description: "Clears the cache."
name: 'clear',
type: Boolean,
description: 'Clears the cache.'
}, { name: 'no-usage-stats', type: Boolean }, { name: 'debug', type: Boolean }, { name: 'no-cache', type: Boolean }];
var dmdDefinitions = [{ name: 'template', alias: 't', type: String, typeLabel: '<file>',
var dmdDefinitions = [{
name: 'template',
alias: 't',
type: String,
typeLabel: '<file>',
description: 'A custom handlebars template file to insert documentation into. The default template is `{{>main}}`.'
}, {
name: 'private', type: Boolean,
name: 'private',
type: Boolean,
description: 'Include identifiers marked [bold]{@private} in the output'
}, { name: 'heading-depth', type: Number, alias: 'd',
}, {
name: 'heading-depth',
type: Number,
alias: 'd',
description: 'Root markdown heading depth, defaults to 2 ([bold]{##}).'
}, { name: 'plugin', type: String, typeLabel: '[underline]{module} ...', multiple: true,
}, {
name: 'plugin',
type: String,
typeLabel: '[underline]{module} ...',
multiple: true,
description: 'Use an installed package containing helper and/or partial overrides.'
}, { name: 'helper', type: String, typeLabel: '[underline]{module} ...', multiple: true,
}, {
name: 'helper',
type: String,
typeLabel: '[underline]{module} ...',
multiple: true,
description: 'Handlebars helper modules to override or extend the default set.'
}, { name: 'partial', type: String, typeLabel: '[underline]{file} ...', multiple: true,
}, {
name: 'partial',
type: String,
typeLabel: '[underline]{file} ...',
multiple: true,
description: 'Handlebars partial files to override or extend the default set.'
}, { name: 'example-lang', type: String, alias: 'l',
}, {
name: 'example-lang',
type: String,
alias: 'l',
description: 'Specifies the default language used in [bold]{@example} blocks (for syntax-highlighting purposes). In the default gfm mode, each [bold]{@example} is wrapped in a fenced-code block. Example usage: [bold]{--example-lang js}. Use the special value [bold]{none} for no specific language. While using this option, you can override the supplied language for any [bold]{@example} by specifying the [bold]{@lang} subtag, e.g [bold]{@example @lang hbs}. Specifying [bold]{@example @lang off} will disable code blocks for that example.'
}, { name: 'name-format', type: Boolean,
description: 'Format identifier names as code'
}, { name: 'no-gfm', type: Boolean,
}, { name: 'name-format', type: Boolean, description: 'Format identifier names as code' }, {
name: 'no-gfm',
type: Boolean,
description: 'By default, dmd generates github-flavoured markdown. Not all markdown parsers render gfm correctly. If your generated docs look incorrect on sites other than Github (e.g. npmjs.org) try enabling this option to disable Github-specific syntax. '
}, { name: 'separators', type: Boolean,
}, {
name: 'separators',
type: Boolean,
description: 'Put [bold]{<hr>} breaks between identifiers. Improves readability on bulky docs. '
}, { name: 'module-index-format', type: String, alias: 'm',
}, {
name: 'module-index-format',
type: String,
alias: 'm',
description: 'When muliple modules are found in the input source code, an index is generated. It can be styled by one of the following options: [bold]{none}, [bold]{grouped}, [bold]{table} or [bold]{dl}.'
}, { name: 'global-index-format', type: String, alias: 'g',
}, {
name: 'global-index-format',
type: String,
alias: 'g',
description: 'When muliple global-scope identifiers are found in the input source code, an index is generated. It can be styled by one of the following options: [bold]{none}, [bold]{grouped}, [bold]{table} or [bold]{dl}.'
}, { name: 'param-list-format', type: String, alias: 'p',
}, {
name: 'param-list-format',
type: String,
alias: 'p',
description: 'Two options to render [bold]{@param} lists: [bold]{list} or [bold]{table} (default). Table format works well in most cases but switch to [bold]{list} if things begin to look crowded. '
}, { name: 'property-list-format', type: String, alias: 'r',
}, {
name: 'property-list-format',
type: String,
alias: 'r',
description: 'Two options to render [bold]{@property} lists: [bold]{list} or [bold]{table} (default).'
}, { name: 'member-index-format', type: String,
}, {
name: 'member-index-format',
type: String,
description: 'Two options to render member lists: [bold]{list} or [bold]{grouped} (default). The [bold]{list} view is loosely-based on the nodejs docs.'

@@ -67,0 +121,0 @@ }];

@@ -9,15 +9,8 @@ 'use strict';

var UsageStats = require('usage-stats');
var homePath = require('home-path');
var path = require('path');
var cacheDir = path.resolve(homePath(), '.jsdoc2md');
var jsdocApi = require('jsdoc-api');
var dmd = require('dmd');
jsdocApi.cache.dir = path.resolve(cacheDir, 'jsdoc-api');
dmd.cache.dir = path.resolve(cacheDir, 'dmd');
var usageStats = new UsageStats('UA-70853320-3', {
name: 'jsdoc2md',
version: version,
dir: cacheDir
version: version
});

@@ -164,16 +157,13 @@

response.data = response.data ? response.data.toString() : response.data;
console.error(require('util').inspect(response, { depth: 3, colors: true }));
});
}
req.catch(function (err) {
return console.error('.send() failed', err.stack);
});
if (sync) {
try {
var output = command(options);
if (!debug) usageStats.abort();
return {
v: command(options)
v: output
};
usageStats.abort();
} catch (err) {

@@ -185,3 +175,3 @@ commandFailed(err, debug);

v: command(options).then(function (output) {
usageStats.abort();
if (!debug) usageStats.abort();
return output;

@@ -202,6 +192,8 @@ }).catch(function (err) {

var req = usageStats.end().send({ debug: debug });
if (debug) req.then(function (response) {
console.error(require('util').inspect(response, { depth: 3, colors: true }));
});
if (debug) {
req.then(function (response) {
console.error(require('util').inspect(response, { depth: 3, colors: true }));
});
}
throw err;
}
{
"name": "jsdoc-to-markdown",
"author": "Lloyd Brookes",
"version": "2.0.0-alpha.12",
"version": "2.0.0-alpha.13",
"description": "jsdoc-annotated source in, markdown API docs out.",

@@ -34,18 +34,18 @@ "repository": "https://github.com/jsdoc2md/jsdoc-to-markdown",

"feature-detect-es6": "^1.3.1",
"home-path": "^1.0.3",
"jsdoc-api": "^2.0.1",
"jsdoc-parse": "^2.0.5-0",
"usage-stats": "^0.3.1",
"usage-stats": "^0.3.2",
"walk-back": "^2.0.1"
},
"devDependencies": {
"babel-preset-es2015": "^6.13.2",
"babel-preset-es2015": "^6.14.0",
"coveralls": "^2.11.12",
"test-runner": "^0.2.1"
"test-runner": "^0.2.3"
},
"standard": {
"ignore": [
"es5"
"es5",
"src/test/fixture"
]
}
}
'use strict'
const tool = require('command-line-tool')
const path = require('path')
const version = require('../../package').version

@@ -27,3 +26,2 @@

jsdoc2md.clear().catch(tool.halt)
} else {

@@ -30,0 +28,0 @@ const jsdoc2md = require('../../')

@@ -6,3 +6,7 @@ 'use strict'

{
name: 'files', alias: 'f', type: String, multiple: true, defaultOption: true,
name: 'files',
alias: 'f',
type: String,
multiple: true,
defaultOption: true,
description: 'A list of jsdoc explain files (or glob expressions) to parse for documentation. Either this or [bold]{--source} must be supplied.',

@@ -12,3 +16,4 @@ typeLabel: '[underline]{file} ...'

{
name: 'source', type: String,
name: 'source',
type: String,
description: 'A string containing source code to parse for documentation. Either this or [bold]{--files} must be supplied.'

@@ -23,3 +28,7 @@ },

},
{ name: 'html', type: Boolean, description: "Enable experimental parsing of .html files. When specified, any configuration supplied via [bold]{--configure} is ignored." },
{
name: 'html',
type: Boolean,
description: 'Enable experimental parsing of .html files. When specified, any configuration supplied via [bold]{--configure} is ignored.'
}
]

@@ -29,15 +38,20 @@

{
name: 'help', description: 'Print usage information',
alias: 'h', type: Boolean
name: 'help',
description: 'Print usage information',
alias: 'h',
type: Boolean
},
{
name: 'config', description: 'Print all options supplied (from command line, `.jsdoc2md.json` or `package.json` under the `jsdoc2md` property) and exit. Useful for checking the tool is receiving the correct config.',
name: 'config',
description: 'Print all options supplied (from command line, `.jsdoc2md.json` or `package.json` under the `jsdoc2md` property) and exit. Useful for checking the tool is receiving the correct config.',
type: Boolean
},
{
name: 'json', type: Boolean,
name: 'json',
type: Boolean,
description: 'Prints the data (jsdoc-parse output) supplied to the template (dmd).'
},
{
name: 'jsdoc', type: Boolean,
name: 'jsdoc',
type: Boolean,
description: 'Prints the raw jsdoc data.'

@@ -47,4 +61,5 @@ },

{
name: 'clear', type: Boolean,
description: "Clears the cache."
name: 'clear',
type: Boolean,
description: 'Clears the cache.'
},

@@ -57,46 +72,85 @@ { name: 'no-usage-stats', type: Boolean },

const dmdDefinitions = [
{ name: 'template', alias: 't', type: String, typeLabel: '<file>',
{
name: 'template',
alias: 't',
type: String,
typeLabel: '<file>',
description: 'A custom handlebars template file to insert documentation into. The default template is `{{>main}}`.'
},
{
name: 'private', type: Boolean,
name: 'private',
type: Boolean,
description: 'Include identifiers marked [bold]{@private} in the output'
},
{ name: 'heading-depth', type: Number, alias: 'd',
{
name: 'heading-depth',
type: Number,
alias: 'd',
description: 'Root markdown heading depth, defaults to 2 ([bold]{##}).'
},
{ name: 'plugin', type: String, typeLabel: '[underline]{module} ...', multiple: true,
{
name: 'plugin',
type: String,
typeLabel: '[underline]{module} ...',
multiple: true,
description: 'Use an installed package containing helper and/or partial overrides.'
},
{ name: 'helper', type: String, typeLabel: '[underline]{module} ...', multiple: true,
{
name: 'helper',
type: String,
typeLabel: '[underline]{module} ...',
multiple: true,
description: 'Handlebars helper modules to override or extend the default set.'
},
{ name: 'partial', type: String, typeLabel: '[underline]{file} ...', multiple: true,
{
name: 'partial',
type: String,
typeLabel: '[underline]{file} ...',
multiple: true,
description: 'Handlebars partial files to override or extend the default set.'
},
{ name: 'example-lang', type: String, alias: 'l',
{
name: 'example-lang',
type: String,
alias: 'l',
description: 'Specifies the default language used in [bold]{@example} blocks (for syntax-highlighting purposes). In the default gfm mode, each [bold]{@example} is wrapped in a fenced-code block. Example usage: [bold]{--example-lang js}. Use the special value [bold]{none} for no specific language. While using this option, you can override the supplied language for any [bold]{@example} by specifying the [bold]{@lang} subtag, e.g [bold]{@example @lang hbs}. Specifying [bold]{@example @lang off} will disable code blocks for that example.'
},
{ name: 'name-format', type: Boolean,
description: 'Format identifier names as code'
},
{ name: 'no-gfm', type: Boolean,
{ name: 'name-format', type: Boolean, description: 'Format identifier names as code' },
{
name: 'no-gfm',
type: Boolean,
description: 'By default, dmd generates github-flavoured markdown. Not all markdown parsers render gfm correctly. If your generated docs look incorrect on sites other than Github (e.g. npmjs.org) try enabling this option to disable Github-specific syntax. '
},
{ name: 'separators', type: Boolean,
{
name: 'separators',
type: Boolean,
description: 'Put [bold]{<hr>} breaks between identifiers. Improves readability on bulky docs. '
},
{ name: 'module-index-format', type: String, alias: 'm',
{
name: 'module-index-format',
type: String,
alias: 'm',
description: 'When muliple modules are found in the input source code, an index is generated. It can be styled by one of the following options: [bold]{none}, [bold]{grouped}, [bold]{table} or [bold]{dl}.'
},
{ name: 'global-index-format', type: String, alias: 'g',
{
name: 'global-index-format',
type: String,
alias: 'g',
description: 'When muliple global-scope identifiers are found in the input source code, an index is generated. It can be styled by one of the following options: [bold]{none}, [bold]{grouped}, [bold]{table} or [bold]{dl}.'
},
{ name: 'param-list-format', type: String, alias: 'p',
{
name: 'param-list-format',
type: String,
alias: 'p',
description: 'Two options to render [bold]{@param} lists: [bold]{list} or [bold]{table} (default). Table format works well in most cases but switch to [bold]{list} if things begin to look crowded. '
},
{ name: 'property-list-format', type: String, alias: 'r',
{
name: 'property-list-format',
type: String,
alias: 'r',
description: 'Two options to render [bold]{@property} lists: [bold]{list} or [bold]{table} (default).'
},
{ name: 'member-index-format', type: String,
{
name: 'member-index-format',
type: String,
description: 'Two options to render member lists: [bold]{list} or [bold]{grouped} (default). The [bold]{list} view is loosely-based on the nodejs docs.'

@@ -132,9 +186,9 @@ }

{
cmmd: '$ jsdoc2md <jsdoc-options> [<dmd-options>]',
cmmd: '$ jsdoc2md <jsdoc-options> [<dmd-options>]'
},
{
cmmd: '$ jsdoc2md <jsdoc-options> [bold]{--jsdoc}',
cmmd: '$ jsdoc2md <jsdoc-options> [bold]{--jsdoc}'
},
{
cmmd: '$ jsdoc2md <jsdoc-options> [bold]{--json}',
cmmd: '$ jsdoc2md <jsdoc-options> [bold]{--json}'
},

@@ -141,0 +195,0 @@ {

'use strict'
const version = require('../../package').version
const UsageStats = require('usage-stats')
const homePath = require('home-path')
const path = require('path')
const cacheDir = path.resolve(homePath(), '.jsdoc2md')
const jsdocApi = require('jsdoc-api')
const dmd = require('dmd')
jsdocApi.cache.dir = path.resolve(cacheDir, 'jsdoc-api')
dmd.cache.dir = path.resolve(cacheDir, 'dmd')
const usageStats = new UsageStats('UA-70853320-3', {
name: 'jsdoc2md',
version: version,
dir: cacheDir
version: version
})

@@ -316,15 +309,12 @@

req.then(response => {
// responses = responses.map(response => {
response.data = response.data ? response.data.toString() : response.data
// return response
// })
console.error(require('util').inspect(response, { depth: 3, colors: true }))
})
}
req.catch(err => console.error('.send() failed', err.stack))
if (sync) {
try {
return command(options)
usageStats.abort()
const output = command(options)
if (!debug) usageStats.abort()
return output
} catch (err) {

@@ -336,3 +326,3 @@ commandFailed(err, debug)

.then(output => {
usageStats.abort()
if (!debug) usageStats.abort()
return output

@@ -350,6 +340,8 @@ })

const req = usageStats.end().send({ debug })
if (debug) req.then(response => {
console.error(require('util').inspect(response, { depth: 3, colors: true }))
})
if (debug) {
req.then(response => {
console.error(require('util').inspect(response, { depth: 3, colors: true }))
})
}
throw err
}

@@ -33,5 +33,5 @@ 'use strict'

runner.test('.getJsdocDataSync({ files })', function () {
const result = jsdoc2md.getJsdocDataSync({ files: inputFile, cache: false })
const result = jsdoc2md.getJsdocDataSync({ files: inputFile, cache: false })
a.ok(result[0].longname)
})
}
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