chore(docs-generator): make demos take less time to load

This commit is contained in:
Andrew Joslin
2014-05-20 11:07:32 -06:00
parent 3e7461cb1c
commit 4a57bd0229
4 changed files with 14 additions and 2 deletions

View File

@@ -135,6 +135,17 @@ module.exports = {
)
});
//Write the demo list to current version (eg at /nightly);
docs.push({
docType: 'demo',
template: 'demo_list.template.js',
outputPath: path.join(
config.get('demos.outputFolder'),
config.get('versionData.current.folder'),
'demo-list.js'
)
});
extraData.demos = allDemos;
}
};

View File

@@ -8,6 +8,7 @@
<link rel="stylesheet" href="/<$ doc.demoData.css.path $>">
<@ endif @>
<script src="http://code.ionicframework.com/<$ version.current.name $>/js/ionic.bundle.min.js"></script>
<script src="<@if version.current.folder @><$ '/'+version.current.folder @><@ endif @>/demo-list.js"></script>
<@ if doc.demoData and doc.demoData.javascript @>
<script src="/<$ doc.demoData.javascript.path $>"></script>
<@ endif @>

1
docs/templates/demo_list.template.js vendored Normal file
View File

@@ -0,0 +1 @@
var DEMOS = <$ demos | json $>;

View File

@@ -1,4 +1,3 @@
var DEMOS = <$ demos | json $>;
var DEMO;
<@ if doc.demoData @>
DEMO = <$ doc.demoData | json $>;
@@ -65,7 +64,7 @@ angular.module(<@ if doc.demoData @>'<$ doc.demoData.module $>'
})
.filter('humanize', function() {
return function(input) {
return input.charAt(0).toUpperCase() +
return input.charAt(0).toUpperCase() +
input.substring(1).replace(/[A-Z]/g, function(match, i) {
return ' ' + match.toUpperCase();
});