diff --git a/docs/spec/writerSpec.js b/docs/spec/writerSpec.js index 8354ad5df608..a44e283cd68f 100644 --- a/docs/spec/writerSpec.js +++ b/docs/spec/writerSpec.js @@ -15,4 +15,20 @@ describe('writer', function(){ expect(toString(['abc',{}])).toEqual('abc{}'); }); }); + + describe('replace method', function() { + var content, + replacements; + + beforeEach(function() { + content = 'angular super jQuery manifest'; + }); + + it('should replace placeholders', function() { + replacements = {'angular': 'ng', 'jQuery': 'jqlite','notHere': 'here'}; + + content = writer.replace(content, replacements); + expect(content).toBe('ng super jqlite manifest'); + }); + }); }); diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 4649bec3e9f4..93d0038eb3e6 100755 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -42,11 +42,30 @@ function writeTheRest(writesFuture) { writesFuture.push(writer.copyDir('img')); writesFuture.push(writer.copyDir('examples')); - writesFuture.push(writer.copyTpl('index.html')); - writesFuture.push(writer.copy('docs/src/templates/index.html', - 'build/docs/index-jq.html', - '', - '', + ngMin = '', + ng = '' + + writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index.html', + writer.replace, {'doc:manifest': manifest, + '': ngMin})); + + writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq.html', + writer.replace, {'doc:manifest': manifest, + '': ngMin, + '': jq})); + + writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-debug.html', + writer.replace, {'doc:manifest': '', + '': ng})); + + writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq-debug.html', + writer.replace, {'doc:manifest': '', + '': ng, + '': jq})); + writesFuture.push(writer.copyTpl('offline.html')); writesFuture.push(writer.copyTpl('docs-scenario.html')); writesFuture.push(writer.copyTpl('jquery.min.js')); diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 26c1eaeca705..d5cfaed2d290 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -2,7 +2,7 @@ + doc:manifest>