mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Main changes: * Use gulpfile now (build was getting way too disorganized with custom tasks; gulpfiles are much easier to build clean custom tasks with than Grunt. * View README#Development for updated commands * Docs written for ionContent, ionHeaderBar, ionInfiniteScroll. * Docs are pushed to ajoslin's fork of ionic-site until they reach a * point where they can be published. **TODO, In Order of Priority** 1. Finish writing source-documentation for all existing components 2. Add multiple versions of docs (one per release & nightly, latest stable release docs being shown by default) 3. Add examples generation 4. Add searchbar to docs
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
var _ = require('lodash');
|
|
|
|
module.exports = {
|
|
name: 'versions-data',
|
|
description: 'This plugin will create a new doc that will be rendered as an angularjs module ' +
|
|
'which will contain meta information about the versions of angular',
|
|
runAfter: ['adding-extra-docs', 'pages-data'],
|
|
runBefore: ['extra-docs-added'],
|
|
process: function(docs, gitData) {
|
|
|
|
var version = gitData.version;
|
|
var versions = gitData.versions;
|
|
|
|
if ( !version ) {
|
|
throw new Error('Invalid configuration. Please provide a valid `source.currentVersion` property');
|
|
}
|
|
if ( !versions ) {
|
|
throw new Error('Invalid configuration. Please provide a valid `source.previousVersions` property');
|
|
}
|
|
|
|
var versionDoc = {
|
|
docType: 'versions-data',
|
|
id: 'versions-data',
|
|
template: 'versions-data.template.js',
|
|
outputPath: 'js/versions-data.js',
|
|
};
|
|
|
|
versionDoc.currentVersion = version;
|
|
|
|
versionDoc.versions = _(versions)
|
|
.push(version)
|
|
.reverse()
|
|
.value();
|
|
|
|
docs.push(versionDoc);
|
|
}
|
|
};
|