Closed a-stangl closed 8 years ago
It looks as though these have been hard coded on the examples branch:
https://github.com/wingedfox/dgeni-alive/blob/examples/src/docgen.js
I'm not sure it that helps you though...
I think you have more control over things if you run it from the command line:
var fs = require('fs');
var root = __dirname;
var packages = [
require('dgeni-alive/src/packages/jsdoc-ext'),
require('dgeni-alive/src/packages/ngdoc-ext'),
require('dgeni-alive/src/packages/links-ext'),
require('dgeni-alive/src/packages/examples-ext')
];
var path = require('path');
var docgen = require('dgeni-alive/src/docgen')();
docgen.Package(packages)
.config(function(log) {
log.level = 'info';
})
.config(function(templateFinder, renderDocsProcessor, gitData) {
templateFinder.templateFolders.unshift(path.resolve(root, 'ngdocs/templates'));
})
.config(function(computePathsProcessor, computeIdsProcessor, createDocMessage, getAliases) {
computeIdsProcessor.idTemplates.push({
docTypes: ['component'],
idTemplate: 'module:${module}.${docType}:${name}',
getAliases: getAliases
});
computePathsProcessor.pathTemplates.push({
docTypes: ['component'],
pathTemplate: '${area}/${module}/${docType}/${name}',
outputPathTemplate:
'partials/${area}/${module}/${docType}/${name}.html'
});
})
.config(function (generateExamplesProcessor, generateProtractorTestsProcessor) {
var deployments = [
{
name: 'default',
examples: {
commonFiles: {
scripts: 'dist/js',
stylesheets: 'dist/css'
}
}
}
];
generateExamplesProcessor.deployments = deployments;
generateProtractorTestsProcessor.deployments = deployments;
})
.config(function (renderDocsProcessor) {
renderDocsProcessor.extraData.deploymentTarget = 'default';
})
.config(function(generateWebsite) {
generateWebsite.locals('productTitle', 'Sequoia Product Console');
});
docgen.src(['client/src/**/*.js', 'ngdocs/**/*.ngdoc'])
.dest('jsdocs')
.generate().then(function() {
console.log('I\'m done!');
});
something like this, run as:
node dgeni.js
from the command line.
This snippet might not work first time as is - I've pulled out environment specific parts from my own script so as not to confuse you...
Thanks for the example, @andy-dorman ! So I guess I have to write my own Grunt task for this.
@StAn187, thank you for your question.
This feature is not stable yet and probably should be rewritten. Take a look at the following Grunt config: https://github.com/wingedfox/angular-gettext/blob/master/Gruntfile.js
Deployments property is required by dgeni-packages/examples in order to generate runnable examples.
As by now, you have to tweak your Gruntfile or extend docgen package with the necessary properties.
I hope, next weekend I'll add project config file and all these options will be moved there.
@andy-dorman, thank you for pointing there, forgot to remove this code.
Has there been any progress on this? I still get this error no matter what I do...
Nevermind, it does work now with v0.2.2 - but I had to clone that with git, it's not on npm yet. Mind pushing it there? :)
@chris-33, 0.3.1 is there
I'm trying to get the Grunt Task running but I pathetically fail
My Grunt config is rather simple
https://github.com/angular/dgeni-packages#deployment-configuration shows how to set this property but I have no idea how to set this via my Grunt config.
How can I adjust my Grunt config to get rid of this error without disabling the 'examples' package (if possible).
Thanks.