From 0fb37b08e778c348199a8a4909fad5ed9d920cdd Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 10 May 2011 11:16:00 -0700 Subject: add resource merging --- docs/src/gen-docs.js | 26 +++++++++++++++++--------- docs/src/templates/index.html | 13 ++++--------- docs/src/writer.js | 13 +++++++++++++ 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 9edfaceb..1e5a09c4 100644 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -27,19 +27,27 @@ var writes = callback.chain(function(){ writer.copyDir('img', writes.waitFor()); writer.copyDir('examples', writes.waitFor()); writer.copyTpl('index.html', writes.waitFor()); - writer.copyTpl('docs.js', writes.waitFor()); - writer.copyTpl('docs.css', writes.waitFor()); - writer.copyTpl('doc_widgets.js', writes.waitFor()); - writer.copyTpl('doc_widgets.css', writes.waitFor()); + writer.merge(['docs.js', + 'doc_widgets.js'], + 'docs-combined.js', + writes.waitFor()); + writer.merge(['docs.css', + 'doc_widgets.css'], + 'docs-combined.css', + writes.waitFor()); writer.copyTpl('docs-scenario.html', writes.waitFor()); writer.output('docs-scenario.js', ngdoc.scenarios(docs), writes.waitFor()); writer.output('sitemap.xml', new SiteMap(docs).render(), writes.waitFor()); writer.output('robots.txt', 'Sitemap: http://docs.angularjs.org/sitemap.xml\n', writes.waitFor()); - writer.copyTpl('syntaxhighlighter/shBrushJScript.js', writes.waitFor()); - writer.copyTpl('syntaxhighlighter/shBrushXml.js', writes.waitFor()); - writer.copyTpl('syntaxhighlighter/shCore.css', writes.waitFor()); - writer.copyTpl('syntaxhighlighter/shCore.js', writes.waitFor()); - writer.copyTpl('syntaxhighlighter/shThemeDefault.css', writes.waitFor()); + writer.merge(['syntaxhighlighter/shCore.js', + 'syntaxhighlighter/shBrushJScript.js', + 'syntaxhighlighter/shBrushXml.js'], + 'syntaxhighlighter/syntaxhighlighter-combined.js', + writes.waitFor()); + writer.merge(['syntaxhighlighter/shCore.css', + 'syntaxhighlighter/shThemeDefault.css'], + 'syntaxhighlighter/syntaxhighlighter-combined.css', + writes.waitFor()); writer.copyTpl('jquery.min.js', writes.waitFor()); }); writes.onDone(function(){ diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 3e792af0..49449517 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -5,10 +5,8 @@ <angular/> - - - - + +