Comparing version 0.1.0 to 0.2.0
@@ -0,2 +1,5 @@ | ||
0.2.0 - July 10, 2014 | ||
- Synchronised code changes with raml2html | ||
0.1.0 - June 12, 2014 | ||
- Initial release |
@@ -9,5 +9,11 @@ #!/usr/bin/env node | ||
var fs = require('fs'); | ||
var pjson = require('../package.json'); | ||
function _render(ramlObj, config, onSuccess) { | ||
ramlObj.config = config; | ||
// Register handlebar helpers | ||
for (var helperName in config.helpers) { | ||
if (config.helpers.hasOwnProperty(helperName)) { | ||
handlebars.registerHelper(helperName, config.helpers[helperName]); | ||
} | ||
} | ||
@@ -27,8 +33,10 @@ // Register handlebar partials | ||
raml2obj.parse(source, function(ramlObj) { | ||
ramlObj.config = config; | ||
ramlObj.config.raml2HtmlVersion = pjson.version; | ||
_render(ramlObj, config, onSuccess); | ||
}); | ||
}, onError); | ||
} | ||
function parse(source, onSuccess, onError) { | ||
var config = { | ||
function getDefaultConfig() { | ||
return { | ||
'template': require('./template.handlebars'), | ||
@@ -39,4 +47,6 @@ 'partials': { | ||
}; | ||
} | ||
parseWithConfig(source, config, onSuccess, onError); | ||
function parse(source, onSuccess, onError) { | ||
parseWithConfig(source, getDefaultConfig(), onSuccess, onError); | ||
} | ||
@@ -82,1 +92,2 @@ | ||
module.exports.parseWithConfig = parseWithConfig; | ||
module.exports.getDefaultConfig = getDefaultConfig; |
{ | ||
"name": "raml2md", | ||
"description": "RAML to Markdown documentation generator", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Kevin Renskers", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13996
73