jsdoc-to-markdown
Advanced tools
Comparing version 0.0.1 to 0.1.0
#!/usr/bin/env node | ||
"use strict"; | ||
var Model = require("nature").Model, | ||
var cliArgs = require("command-line-args"), | ||
cp = require("child_process"), | ||
@@ -9,13 +9,18 @@ path = require("path"), | ||
boil = require("boil-js"), | ||
mfs = require("more-fs"); | ||
mfs = require("more-fs"), | ||
dope = require("console-dope"); | ||
require("../")(boil); | ||
require("handlebars-array")(boil); | ||
var argv = new Model() | ||
.define({ name: "template", alias: "t", type: "string" }) | ||
.define({ name: "json", alias: "j", type: "boolean" }) | ||
.define({ name: "src", type: Array, defaultOption: true }) | ||
.set(process.argv); | ||
var argv = cliArgs([ | ||
{ name: "template", alias: "t", type: String }, | ||
{ name: "json", alias: "j", type: Boolean }, | ||
{ name: "src", type: Array, defaultOption: true }, | ||
]).parse(); | ||
if (!argv.src){ | ||
dope.red.error("specify at least one source file"); | ||
process.exit(1); | ||
} | ||
var templatePath = path.resolve(__dirname, "..", "jsdoc-template"), | ||
@@ -22,0 +27,0 @@ cmd = util.format("jsdoc -t %s %s", templatePath, argv.src.join(" ")); |
var w = require("wodge"); | ||
module.exports = function(handlebars){ | ||
handlebars.registerHelper("paramList", function(params){ | ||
return w.arrayify(params).map(function(param){ | ||
return param.optional ? "[" + param.name + "]" : param.name; | ||
}).join(", "); | ||
handlebars.registerHelper("instantiate", function(input){ | ||
return input.charAt(0).toLowerCase() + input.slice(1); | ||
}); | ||
}; |
@@ -1,2 +0,3 @@ | ||
var util = require("util"); | ||
var util = require("util"), | ||
w = require("wodge"); | ||
@@ -12,16 +13,5 @@ /** | ||
var json = data({ undocumented: { "!is": true }}).map(function(record){ | ||
var output = {}; | ||
if (record.description) output.description = record.description; | ||
if (record.name) output.name = record.name; | ||
if (record.kind) output.kind = record.kind; | ||
if (record.classdesc) output.classdesc = record.classdesc; | ||
if (record.augments) output.augments = record.augments; | ||
if (record.memberof) output.memberof = record.memberof; | ||
if (record.scope) output.scope = record.scope; | ||
if (record.params) output.params = record.params; | ||
if (record.returns) output.returns = record.returns; | ||
if (record.examples) output.examples = record.examples; | ||
return output; | ||
return w.without(record, [ "comment", "meta", "undocumented", "___id", "___s" ]); | ||
}); | ||
console.log(JSON.stringify(json, null, " ")); | ||
}; |
{ | ||
"name": "jsdoc-to-markdown", | ||
"author": "Lloyd Brookes", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Render JSdoc documentation as markdown", | ||
@@ -21,9 +21,8 @@ "repository": "https://github.com/75lb/jsdoc-to-markdown", | ||
"dependencies": { | ||
"boil-js": "~0.0.0", | ||
"boil-js": "^0.1.0", | ||
"command-line-args": "^0.2.0", | ||
"console-dope": "^0.3.3", | ||
"more-fs": "^0.3.0", | ||
"nature": "~0.4.3", | ||
"wodge": "~0.6.6", | ||
"handlebars-array": "~0.0" | ||
"wodge": "^0.8.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6165
5
20
82
+ Addedcommand-line-args@^0.2.0
+ Addedansi-escape-sequences@0.0.12.2.2(transitive)
+ Addedarray-back@1.0.4(transitive)
+ Addedarray-tools@1.8.62.0.9(transitive)
+ Addedboil-js@0.1.11(transitive)
+ Addedcollect-all@0.2.11.0.4(transitive)
+ Addedcollect-json@1.0.9(transitive)
+ Addedcommand-line-args@0.2.40.4.0(transitive)
+ Addedconfig-master@0.2.1(transitive)
+ Addedfile-set@0.2.8(transitive)
+ Addedfilter-where@1.0.1(transitive)
+ Addedhandlebars-ansi@0.0.2(transitive)
+ Addedhandlebars-array@0.1.5(transitive)
+ Addedhandlebars-comparison@1.1.1(transitive)
+ Addedhandlebars-fileset@0.1.3(transitive)
+ Addedhandlebars-string@1.0.6(transitive)
+ Addedhome-path@0.1.2(transitive)
+ Addedmore-fs@0.4.1(transitive)
+ Addednature@0.5.7(transitive)
+ Addedobject-get@2.1.1(transitive)
+ Addedobject-tools@1.6.7(transitive)
+ Addedreduce-extract@1.0.0(transitive)
+ Addedreduce-flatten@1.0.1(transitive)
+ Addedreduce-unique@1.0.0(transitive)
+ Addedreduce-without@1.0.1(transitive)
+ Addedsort-array@1.1.2(transitive)
+ Addedstream-connect@1.0.2(transitive)
+ Addedstream-via@0.1.11.0.4(transitive)
+ Addedstring-tools@0.1.8(transitive)
+ Addedtest-value@1.1.02.1.0(transitive)
+ Addedtypical@1.0.02.6.1(transitive)
+ Addedwodge@0.8.1(transitive)
- Removedhandlebars-array@~0.0
- Removednature@~0.4.3
- Removedboil-js@0.0.1(transitive)
- Removedconfig-master@0.1.3(transitive)
- Removedhandlebars-array@0.0.4(transitive)
- Removedhandlebars-fileset@0.0.5(transitive)
- Removedhandlebars-string@0.0.4(transitive)
Updatedboil-js@^0.1.0
Updatedwodge@^0.8.0