aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/gen-docs.js
diff options
context:
space:
mode:
authorVojta Jina2011-08-30 11:47:24 +0200
committerIgor Minar2011-09-26 23:51:53 +0200
commit13f92de6246a0af8450fde84b209211a56397fda (patch)
tree2e277d50a67f32dddcb1e7674ed8b1476881e014 /docs/src/gen-docs.js
parent2bc39bb0b4f81b77597bb52f8572d231cf4f83e2 (diff)
downloadangular.js-13f92de6246a0af8450fde84b209211a56397fda.tar.bz2
feat(docs): use html5 history api for all routing in the docs app
- Configure our docs app to use new $location with html5 history api! - Update simple node web server to serve index.html for all links (rewritting). - Update .htaccess file to serve index.html for all links (rewritting). - At runtime determine the base href path and attach it to the DOM. We needed the absolute URL to get all browsers to work well. - Because of the above, we also need to dynamically determine all needed js/css resources and add them to the DOM. This was needed because FF6 would eagerly fetch resources with wrong URL since the base element is added to the dom at runtime. - All content html files were moved to the partials directory, because with the new html5 urls it was impossible to tell if request for http://domain/api/angular.filter.html was an html5 url for the html filter doc page, or an xhr/appcache request for the content html file for the html filter. f
Diffstat (limited to 'docs/src/gen-docs.js')
-rwxr-xr-xdocs/src/gen-docs.js21
1 files changed, 6 insertions, 15 deletions
diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js
index e1778bb7..c7b37025 100755
--- a/docs/src/gen-docs.js
+++ b/docs/src/gen-docs.js
@@ -22,7 +22,7 @@ writer.makeDir('build/docs/syntaxhighlighter').then(function() {
ngdoc.merge(docs);
var fileFutures = [];
docs.forEach(function(doc){
- fileFutures.push(writer.output(doc.section + '/' + doc.id + '.html', doc.html()));
+ fileFutures.push(writer.output('partials/' + doc.section + '/' + doc.id + '.html', doc.html()));
});
writeTheRest(fileFutures);
@@ -43,28 +43,19 @@ function writeTheRest(writesFuture) {
writesFuture.push(writer.copyDir('img'));
writesFuture.push(writer.copyDir('examples'));
- var manifest = 'manifest="appcache.manifest"',
- jq = '<script src="jquery.min.js"></script>',
- ngMin = '<script src="../angular.min.js" ng:autobind></script>',
- ng = '<script src="../angular.js" ng:autobind></script>';
+ var manifest = 'manifest="/build/docs/appcache.manifest"';
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index.html',
- writer.replace, {'doc:manifest': manifest,
- '<!-- angular script place holder -->': ngMin}));
+ writer.replace, {'doc:manifest': manifest}));
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq.html',
- writer.replace, {'doc:manifest': manifest,
- '<!-- angular script place holder -->': ngMin,
- '<!-- jquery place holder -->': jq}));
+ writer.replace, {'doc:manifest': manifest}));
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-debug.html',
- writer.replace, {'doc:manifest': '',
- '<!-- angular script place holder -->': ng}));
+ writer.replace, {'doc:manifest': ''}));
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq-debug.html',
- writer.replace, {'doc:manifest': '',
- '<!-- angular script place holder -->': ng,
- '<!-- jquery place holder -->': jq}));
+ writer.replace, {'doc:manifest': ''}));
writesFuture.push(writer.copyTpl('offline.html'));
writesFuture.push(writer.copyTpl('docs-scenario.html'));