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
|
// for debugging docs
|
||||||
// .processor(function test(){
|
// .processor(function test(){
|
||||||
// return {
|
// return {
|
||||||
// $runAfter: ['files-written'],
|
// $runAfter: ['readTypeScriptModules'],
|
||||||
|
// $runAfter: ['parsing-tags'],
|
||||||
// $process: function(docs){
|
// $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
|
// Configure file writing
|
||||||
.config(function(writeFilesProcessor) {
|
.config(function(writeFilesProcessor, versionInfo) {
|
||||||
writeFilesProcessor.outputFolder = 'dist/docs';
|
// TODO(tlancina): Use nightly if version isn't specified by gulp task
|
||||||
|
writeFilesProcessor.outputFolder = 'dist/ionic-site/docs/' + versionInfo.currentVersion.raw + '/api/';
|
||||||
})
|
})
|
||||||
|
|
||||||
// Configure rendering
|
// Configure rendering
|
||||||
@ -91,24 +88,31 @@ module.exports = new Package('ionic-v2-docs', [jsdocPackage, nunjucksPackage, ty
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Configure ids and paths
|
// Configure ids and paths
|
||||||
// .config(function(computeIdsProcessor, computePathsProcessor) {
|
.config(function(computeIdsProcessor, computePathsProcessor, versionInfo) {
|
||||||
// computeIdsProcessor.idTemplates.push({
|
// computeIdsProcessor.idTemplates.push({
|
||||||
// docTypes: ['guide'],
|
// docTypes: ['guide'],
|
||||||
// getId: function(doc) {
|
// getId: function(doc) {
|
||||||
// return doc.fileInfo.relativePath
|
// return doc.fileInfo.relativePath
|
||||||
// // path should be relative to `modules` folder
|
// // path should be relative to `modules` folder
|
||||||
// .replace(/.*\/?modules\//, '')
|
// .replace(/.*\/?modules\//, '')
|
||||||
// // path should not include `/docs/`
|
// // path should not include `/docs/`
|
||||||
// .replace(/\/docs\//, '/')
|
// .replace(/\/docs\//, '/')
|
||||||
// // path should not have a suffix
|
// // path should not have a suffix
|
||||||
// .replace(/\.\w*$/, '');
|
// .replace(/\.\w*$/, '');
|
||||||
// },
|
// },
|
||||||
// getAliases: function(doc) { return [doc.id]; }
|
// getAliases: function(doc) { return [doc.id]; }
|
||||||
// });
|
// });
|
||||||
//
|
|
||||||
// computePathsProcessor.pathTemplates.push({
|
// docTypes: 'module', 'member', 'class', 'var', 'function', 'let'
|
||||||
// docTypes: ['guide'],
|
|
||||||
// pathTemplate: '/${id}',
|
computePathsProcessor.pathTemplates = [{
|
||||||
// outputPathTemplate: 'partials/guides/${id}.html'
|
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>
|
<h1>{$ doc.id $}</h1>
|
||||||
|
|
||||||
{%- for export in doc.exports %}
|
{%- 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 %}
|
{% endfor %}
|
||||||
|
Reference in New Issue
Block a user