Live docs on top of dgeni documentation generator
Dgeni-alive
documentation generator has been built after a long search for working one with AngularJS doc flavour.
- ngdocs (grunt-ngdoc, grunt-ngdocs, etc) - has no updates for a long time
- docular - has no activity as well
- generator-ngdoc - has no activity as well and forces to use Yeoman tools, is not suitable for CI
- sia - really good one, but it likes Gulp and does not provide standalone extensible generator
With dgeni-alive you can
- Use docgen as grunt task and directly
- Extend docgen like native Dgeni package
- Configure web views
- TBD: view live examples
Parts of code were taken from generator-ngdoc.
- Migrated to Angular 1.5
- Added controller and factory templates
- Added links to internal/external components and types to method params
- Added api-index component to show title API page
- Added @deprecated, @since and @access tags
- Built-in docs server
- Added Errors Reference
- Added Search
- Added @sortOrder tag
- TBD
- Configure Dgeni package
- Append custom processors/templates/filters/etc
- Run dgeni generator
- Serve built app with your favorite server
- ...
- Profit
npm install dgeni-alive --save-dev
var docgen = require('../scr/docgen')();
docgen.package().config(function(log) {
log.level = 'info';
})
.src(this.filesSrc);
.dest(this.data.dest);
.generate().then(function(){
console.log("I'm done!");
});
Load task
grunt.loadNpmTasks('dgeni-alive');
Add section to your Gruntfile.js
"dgeni-alive": {
options: {
// optional basePath for correct path calculation
basePath: '',
// optional dgeni packages
packages: [
'dgeni-packages/jsdoc', // either names
require('dgeni-packages/examples') // or packages
]
// optional serve section for running local http server with live docs
serve: {
// the server port
// can also be written as a function, e.g.
port: 10000,
// open the browser
openBrowser: true // or command to run favorite browser
}
},
api: {
// product title
title: 'My Docs',
// product version
version: '<%= pkg.version %>',
// do not expand paths
expand: false,
// where to put docs
dest: '/docs/',
// where to look for sources
// grunt globbing is supported
src: [
'/src/**/*.js',
'!**/test/**/*.js'
],
// Any paths that contain your overriden templates relative to the grunt file
templatePaths: [
'dgeniAliveTemplates'
]
}
MIT