Skip to content

Commit

Permalink
Update apidoc-core interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
rottmann committed Dec 19, 2014
1 parent 71f88c3 commit 7441143
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ process.on('uncaughtException', function(err) {
* @returns {Mixed} true = ok, but nothing todo | false = error | Object with parsed data and project-informations.
*/
function createDoc(options) {
var api;
var apidocPath = path.join(__dirname, '../');
var packageInfo;

_.defaults(options, defaults);

// paths
Expand Down Expand Up @@ -79,20 +83,22 @@ function createDoc(options) {
}

try {
var packageInfo = new PackageInfo(app);
var packageInfos = packageInfo.get();
packageInfo = new PackageInfo(app);

// generator information
var apidocPath = path.join(__dirname, '../');
var json = JSON.parse( fs.readFileSync(apidocPath + 'package.json', 'utf8') );
var generator = {
version: json.version,
time : new Date(),
apidoc.setGeneratorInfos({
name : json.name,
url : json.homepage
};
time : new Date(),
url : json.homepage,
version: json.version
});
apidoc.setLogger(app.log);
apidoc.setMarkdownParser(app.markdown);
apidoc.setPackageInfos(packageInfo.get());

api = apidoc.parse(app.options);

var api = apidoc.parse(app.options, app.log, generator, packageInfos, app.markdown);
if (api === true) {
app.log.info('Nothing to do.');
return true;
Expand Down

0 comments on commit 7441143

Please sign in to comment.