angular-jsdoc
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -149,2 +149,43 @@ /*global env: true */ | ||
var generateTutorialFile = function(title, tutorial, filename) { | ||
var layoutPath = path.join(templatePath, 'html', 'tutorial.html'); | ||
var tutorialData = { | ||
title: title, | ||
header: tutorial.title, | ||
content: tutorial.parse(), | ||
children: tutorial.children | ||
}; | ||
console.log('tutorialData', tutorialData); | ||
var tutorialPath = path.join(outdir, filename); | ||
var tutoriallink = function (tutorial) { | ||
return helper.toTutorial(tutorial, null, | ||
{ tag: 'em', classname: 'disabled', prefix: 'Tutorial: ' }); | ||
}; | ||
var html = angularTemplate(layoutPath, { | ||
basePath: __dirname, | ||
tutorialData: tutorialData, | ||
tutoriallink: tutoriallink | ||
}); | ||
// yes, you can use {@link} in tutorials too! | ||
// turn {@link foo} into <a href="foodoc.html">foo</a> | ||
html = helper.resolveLinks(html); | ||
fs.writeFileSync(tutorialPath, html, 'utf8'); | ||
}; | ||
var generateTutorialFiles = function(node) { | ||
fs.mkPath(path.join(outdir, "tutorials")); | ||
node.children.forEach(function(child) { | ||
generateTutorialFile( | ||
'Tutorial: ' + child.title, | ||
child, | ||
helper.tutorialToUrl(child.name) | ||
); | ||
generateTutorialFiles(child); | ||
}); | ||
}; | ||
/** | ||
@@ -154,4 +195,5 @@ @param {TAFFY} taffyData See <http://taffydb.com/>. | ||
*/ | ||
exports.publish = function(data, opts) { | ||
//console.log('options', opts); | ||
exports.publish = function(data, opts, tutorials) { | ||
helper.setTutorials(tutorials); | ||
data.sort('longname, version, since'); | ||
@@ -198,2 +240,3 @@ | ||
data().each(function(doclet) { | ||
@@ -203,2 +246,6 @@ doclet.children = getChildren(data, doclet); | ||
doclet.jsDocUrl = helper.createLink(doclet); | ||
doclet.tutoriallink = function (tutorial) { | ||
return helper.toTutorial(tutorial, null, | ||
{ tag: 'em', classname: 'disabled', prefix: 'Tutorial: ' }); | ||
}; | ||
@@ -240,5 +287,11 @@ if (doclet.meta) { | ||
copyStaticFiles(); // copy static files e.g., css, js | ||
generateSourceFiles(sourceCodes, nav); // generate source file as html | ||
// generate source file as html | ||
generateSourceFiles(sourceCodes, nav); | ||
// generate static documents from env.opts.query.docs | ||
generateStaticDocuments(docFiles, nav); | ||
// generate tutorial files | ||
//generateTutorialFiles(tutorials.children); | ||
generateTutorialFiles(tutorials); | ||
// angular directive has its template, we make those as file | ||
generateTemplateFiles(templateCodes, nav); // generate template file for directives | ||
generateStaticDocuments(docFiles, nav); // generate static documents | ||
@@ -245,0 +298,0 @@ // generate jsdoc html files |
{ | ||
"name": "angular-jsdoc", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "JsDoc Plugin and Template for AngularJs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -44,2 +44,3 @@ Angular-JSDoc | ||
--recurse directives services | ||
--tutorials tutorials | ||
@@ -55,3 +56,4 @@ ### Or, With Gulp | ||
'./README.md ' + // to include README.md as index contents | ||
'-r directives services' // source code directory | ||
'-r directives services' + // source code directory | ||
'-u tutorials' // tutorials directory | ||
])); | ||
@@ -69,2 +71,3 @@ | ||
template: 'node_modules/angular-jsdoc/angular-template', | ||
tutorial: 'tutorials', | ||
readme: './README.md' | ||
@@ -76,39 +79,3 @@ } | ||
### Or, With NodeJS | ||
var angularJsdoc = require('angular-jsdoc'); | ||
angularJsdoc(['my-source1', 'my-source2']); | ||
// or with options | ||
angularJsdoc('sample-codes', { | ||
template: 'angular-template', | ||
destination: 'default/docs', | ||
readme: "sample-codes/README.md" | ||
}, function(output) { | ||
console.log('output', output); | ||
}); | ||
Specification | ||
-------------- | ||
angularJsdoc(sourceDirectory, options, callback) | ||
- sourceDirectory: list of source code directories. e.g. ['dir1', 'dir2'] | ||
- options: | ||
- command: jsdoc.js command | ||
Default: node_modules/jsdoc/jsdoc.js | ||
- configure: The path to the configuration file. | ||
Default: angular-jsdoc/common/conf.json | ||
- destination: The path to the output folder. | ||
Default: ./docs | ||
- template: The path to the template to use | ||
Default: angular-jsdoc/default | ||
- readme: The path to the project's README file. | ||
Default: 'README.md' | ||
- callback: callback function with output parameter. e.g., `function(output) {console.log(output)}` | ||
Tags Available | ||
@@ -115,0 +82,0 @@ -------- |
@@ -11,2 +11,3 @@ /** | ||
* returns custom currency from the given input | ||
* @tutorial tutorial1 | ||
*/ | ||
@@ -13,0 +14,0 @@ (function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
4740539
161
10261
137