chore(docs): build to latest, mark latest in dropdown, remove /ionic

This commit is contained in:
Andy Joslin
2014-03-13 20:00:36 -06:00
parent b01e2734f0
commit 6325d37a86
8 changed files with 75 additions and 105 deletions

View File

@@ -1,26 +0,0 @@
var writer = require('dgeni/lib/utils/doc-writer');
var log = require('winston');
var util = require("util");
var filter, outputPath, depth;
module.exports = {
name: 'debug-dump',
runBefore: ['write-files'],
description: 'This processor dumps docs that match a filter to a file',
init: function(config, injectables) {
filter = config.get('processing.debug-dump.filter');
outputPath = config.get('processing.debug-dump.outputPath');
depth = config.get('processing.debug-dump.depth', 2);
},
process: function(docs) {
if ( filter && outputPath ) {
log.info('Dumping docs:', filter, outputPath);
var filteredDocs = filter(docs);
var dumpedDocs = util.inspect(filteredDocs, depth);
return writer.writeFile(outputPath, dumpedDocs).then(function() {
return docs;
});
}
}
};

View File

@@ -1,28 +0,0 @@
var pkg = require('../../package.json');
//TODO get versions from git
var version = {
major: '0',
minor: '9',
dot: '26',
codename: 'rabbit',
full: 'Nightly',
cdn: '0.9.26'
};
module.exports = {
name: 'git-data',
runBefore: ['loading-files'],
description: 'This processor adds information from the local git repository to the extraData injectable',
init: function(config, injectables) {
injectables.value('gitData', {
version: version,
versions: [],
info: 'git-data Information'
});
},
process: function(extraData, gitData) {
extraData.git = gitData;
}
};

View File

@@ -1,46 +1,13 @@
var _ = require('lodash');
var fs = require('fs');
var semver = require('semver');
var path = require('canonical-path');
var basePath;
var outputFolder;
var currentVersion;
module.exports = {
name: 'version-data',
description: 'Give a list of all available versions to the template',
runBefore: ['pages-data'],
init: function(config) {
basePath = config.get('basePath');
outputFolder = config.get('rendering.outputFolder');
currentVersion = config.get('currentVersion');
},
process: function(docs, extraData) {
var docsBaseFolder = path.resolve(basePath, outputFolder, 'docs');
//Array of versions sorted backwards
var versions = fs.readdirSync(docsBaseFolder)
.filter(semver.valid)
.sort(semver.rcompare);
//Add current version to the top of the list if not exists
!_.contains(versions, currentVersion) && versions.unshift(currentVersion);
//Add nightly to the top of the list if not exists
!_.contains(versions, 'nightly') && versions.unshift('nightly');
versions = versions.map(function(ver) {
return {
href: '/docs/' + ver,
name: ver
};
process: function(docs, config, extraData) {
extraData.version = config.get('versionData');
docs.push({
docType: 'version-data',
id: 'version-data',
template: 'version-data.template.json',
outputPath: 'docs/version-data.json'
});
extraData.version = {
list: versions,
current: _.find(versions, { name: currentVersion }),
//Stable = most recent (first) valid semver version
stable: _.find(versions, function(v) { return semver.valid(v.name); }) ||
_.first(versions)
};
}
};