mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
have doc paths use version
This commit is contained in:
@ -12,13 +12,9 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty
|
||||
// for debugging docs
|
||||
// .processor(function test(){
|
||||
// return {
|
||||
// $runAfter: ['files-written'],
|
||||
// $runAfter: ['readTypeScriptModules'],
|
||||
// $runAfter: ['parsing-tags'],
|
||||
// $process: function(docs){
|
||||
// docs.forEach(function(doc){
|
||||
// if (doc.constructorDoc){
|
||||
// debugger;
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
@ -59,8 +55,9 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty
|
||||
})
|
||||
|
||||
// Configure file writing
|
||||
.config(function(writeFilesProcessor) {
|
||||
writeFilesProcessor.outputFolder = 'dist/docs';
|
||||
.config(function(writeFilesProcessor, versionInfo) {
|
||||
// TODO(tlancina): Use nightly if version isn't specified by gulp task
|
||||
writeFilesProcessor.outputFolder = 'dist/ionic-site/docs/' + versionInfo.currentVersion.raw + '/api/';
|
||||
})
|
||||
|
||||
// Configure rendering
|
||||
@ -91,7 +88,7 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty
|
||||
})
|
||||
|
||||
// Configure ids and paths
|
||||
// .config(function(computeIdsProcessor, computePathsProcessor) {
|
||||
.config(function(computeIdsProcessor, computePathsProcessor, versionInfo) {
|
||||
// computeIdsProcessor.idTemplates.push({
|
||||
// docTypes: ['guide'],
|
||||
// getId: function(doc) {
|
||||
@ -105,10 +102,17 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty
|
||||
// },
|
||||
// getAliases: function(doc) { return [doc.id]; }
|
||||
// });
|
||||
//
|
||||
// computePathsProcessor.pathTemplates.push({
|
||||
// docTypes: ['guide'],
|
||||
// pathTemplate: '/${id}',
|
||||
// outputPathTemplate: 'partials/guides/${id}.html'
|
||||
// });
|
||||
// });
|
||||
|
||||
// docTypes: 'module', 'member', 'class', 'var', 'function', 'let'
|
||||
|
||||
computePathsProcessor.pathTemplates = [{
|
||||
docTypes: ['class', 'var', 'function', 'let'],
|
||||
getOutputPath: function(doc) {
|
||||
return doc.fileInfo.relativePath
|
||||
// strip ionic from path root
|
||||
.replace(/^ionic\//, '')
|
||||
// replace extension with .html
|
||||
.replace(/\.\w*$/, '.html');
|
||||
}
|
||||
}];
|
||||
});
|
||||
|
2
scripts/docs/templates/module.template.html
vendored
2
scripts/docs/templates/module.template.html
vendored
@ -1,5 +1,5 @@
|
||||
<h1>{$ doc.id $}</h1>
|
||||
|
||||
{%- for export in doc.exports %}
|
||||
<a href="/docs/{$ export.outputPath $}">{$ export.name $}</a></br>
|
||||
<a href="/ionic-site/docs/{$ export.outputPath $}">{$ export.name $}</a></br>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user