dgeni-packages
Advanced tools
Comparing version 0.7.0 to 0.7.1
## v0.7.0 03/11/2014 | ||
**Minor Features** | ||
feat(api-docs): add configuration for paths 8ddcf647 | ||
feat(runnableExample template): provide the path to the example 353eef6e | ||
## v0.7.0 03/11/2014 | ||
**New Features** | ||
@@ -4,0 +11,0 @@ |
@@ -5,2 +5,3 @@ var _ = require('lodash'); | ||
var partialsPath; | ||
var options; | ||
@@ -18,3 +19,10 @@ module.exports = { | ||
} | ||
options = _.assign({ | ||
outputPath: '${area}/${module}/${docType}/${name}.html', | ||
path: '${area}/${module}/${docType}/${name}', | ||
moduleOutputPath: '${area}/${name}/index.html', | ||
modulePath: '${area}/${name}' | ||
}, config.get('processing.api-docs', {})); | ||
}, | ||
process: function(docs, partialNames, moduleMap) { | ||
@@ -30,4 +38,4 @@ var parts; | ||
doc.outputPath = path.join(partialsPath, _.template('${area}/${name}/index.html', doc)); | ||
doc.path = _.template('${area}/${name}', doc); | ||
doc.outputPath = path.join(partialsPath, _.template(options.moduleOutputPath, doc)); | ||
doc.path = _.template(options.modulePath, doc); | ||
@@ -58,4 +66,4 @@ moduleMap[doc.name] = doc; | ||
doc.outputPath = path.join(partialsPath, _.template('${area}/${module}/${docType}/${name}.html', doc)); | ||
doc.path = _.template('${area}/${module}/${docType}/${name}', doc); | ||
doc.outputPath = path.join(partialsPath, _.template(options.outputPath, doc)); | ||
doc.path = _.template(options.path, doc); | ||
} | ||
@@ -139,2 +147,2 @@ } | ||
} | ||
}; | ||
}; |
@@ -1,2 +0,3 @@ | ||
var processor = require('../../processors/api-docs'); | ||
var rewire = require('rewire'); | ||
var processor = rewire('../../processors/api-docs'); | ||
var PartialNames = require('../../utils/partial-names').PartialNames; | ||
@@ -7,2 +8,29 @@ var Config = require('dgeni/lib/utils/config').Config; | ||
describe("api-docs config", function() { | ||
it("should provide defaults for its options", function() { | ||
var config = _.extend(Config); | ||
config.set('rendering.contentsFolder', 'partials'); | ||
processor.init(config, new di.Module()); | ||
expect(processor.__get__('options')).toEqual({ | ||
outputPath: '${area}/${module}/${docType}/${name}.html', | ||
path: '${area}/${module}/${docType}/${name}', | ||
moduleOutputPath: '${area}/${name}/index.html', | ||
modulePath: '${area}/${name}' | ||
}); | ||
}); | ||
it("should let us override the options", function() { | ||
var config = _.extend(Config); | ||
config.set('rendering.contentsFolder', 'partials'); | ||
config.set('processing.api-docs.path', 'XXX'); | ||
processor.init(config, new di.Module()); | ||
expect(processor.__get__('options.path')).toEqual('XXX'); | ||
expect(processor.__get__('options.moduleOutputPath')).toEqual('${area}/${name}/index.html'); | ||
}); | ||
}); | ||
describe("api-docs processor", function() { | ||
@@ -9,0 +37,0 @@ var config; |
{ | ||
"name": "dgeni-packages", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "A collection of dgeni packages for generating documentation from source code", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
171384
3853