for \nA
for B
for \nA
for B
angular.foo
');
+ toContain('foo angular.foo
');
expect(doc.description).
- toContain('da bar foo bar
');
+ toContain('da bar foo bar
');
expect(doc.description).
- toContain('dadangular.foo
');
+ toContain('dadangular.foo
');
expect(doc.description).
- toContain('ng:foo
');
+ toContain('ng:foo
');
expect(doc.description).
toContain('http://angularjs.org');
expect(doc.description).
@@ -447,7 +447,7 @@ describe('ngdoc', function(){
'{@link\napi/angular.foo\na\nb}');
doc.parse();
expect(doc.description).
- toContain('a b
');
+ toContain('a b
');
});
});
diff --git a/docs/src/appCache.js b/docs/src/appCache.js
index ed35eb792ab2..7b21624e5fb5 100644
--- a/docs/src/appCache.js
+++ b/docs/src/appCache.js
@@ -29,7 +29,7 @@ function appCache(path) {
var resultPostfix = ["",
"FALLBACK:",
- "/offline.html",
+ "/ /build/docs/index.html",
"",
"# allow access to google analytics and twitter when we are online",
"NETWORK:",
@@ -68,7 +68,7 @@ function appCacheTemplate() {
"img/yellow_bkgnd.jpg",
"",
"FALLBACK:",
- "/ offline.html",
+ "/ /build/docs/offline.html",
"",
"# allow access to google analytics and twitter when we are online",
"NETWORK:",
diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js
index e1778bb7c18a..c7b370259a20 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 = '',
- ngMin = '',
- ng = '';
+ 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,
- '': 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,
- '': ngMin,
- '': jq}));
+ writer.replace, {'doc:manifest': manifest}));
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-debug.html',
- writer.replace, {'doc:manifest': '',
- '': ng}));
+ writer.replace, {'doc:manifest': ''}));
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq-debug.html',
- writer.replace, {'doc:manifest': '',
- '': ng,
- '': jq}));
+ writer.replace, {'doc:manifest': ''}));
writesFuture.push(writer.copyTpl('offline.html'));
writesFuture.push(writer.copyTpl('docs-scenario.html'));
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js
index 1045d39df2bd..abe5e1d73fc2 100644
--- a/docs/src/ngdoc.js
+++ b/docs/src/ngdoc.js
@@ -133,7 +133,7 @@ Doc.prototype = {
if (!isFullUrl) self.links.push(absUrl);
- return ''
+ return ''
+ (isAngular ? '' : '')
+ (title || url).replace(/\n/g, ' ')
+ (isAngular ? '
' : '')
@@ -243,7 +243,7 @@ Doc.prototype = {
}
dom.h('Dependencies', self.requires, function(require){
dom.tag('code', function(){
- dom.tag('a', {href:"#!/api/angular.service." + require.name}, require.name);
+ dom.tag('a', {href: 'api/angular.service.' + require.name}, require.name);
});
dom.html(require.text);
});
@@ -570,23 +570,23 @@ function scenarios(docs){
var specs = [];
specs.push('describe("angular+jqlite", function() {');
- appendSpecs('index.html');
+ appendSpecs('');
specs.push('});');
specs.push('');
specs.push('');
specs.push('describe("angular+jquery", function() {');
- appendSpecs('index-jq.html');
+ appendSpecs('index-jq.html#!/');
specs.push('});');
return specs.join('\n');
- function appendSpecs(htmlFile) {
+ function appendSpecs(urlPrefix) {
docs.forEach(function(doc){
specs.push(' describe("' + doc.section + '/' + doc.id + '", function(){');
specs.push(' beforeEach(function(){');
- specs.push(' browser().navigateTo("' + htmlFile + '#!/' + doc.section + '/' + doc.id + '");');
+ specs.push(' browser().navigateTo("' + urlPrefix + doc.section + '/' + doc.id + '");');
specs.push(' });');
specs.push(' ');
doc.scenarios.forEach(function(scenario){
diff --git a/docs/src/templates/.htaccess b/docs/src/templates/.htaccess
index 87487e9e122c..9f9a152cf651 100644
--- a/docs/src/templates/.htaccess
+++ b/docs/src/templates/.htaccess
@@ -8,4 +8,8 @@
RewriteEngine on
RewriteCond %{HTTP_COOKIE} ng-offline="NG_VERSION_FULL"
-RewriteRule appcache.manifest appcache-offline.manifest
\ No newline at end of file
+RewriteRule appcache.manifest appcache-offline.manifest
+
+
+## HTML5 URL Support ##
+RewriteRule ^(guide|api|cookbook|misc|tutorial)(/.*)?$ index.html
diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js
index d1069a770dac..505aed60c2ef 100644
--- a/docs/src/templates/docs.js
+++ b/docs/src/templates/docs.js
@@ -4,7 +4,8 @@ function DocsController($location, $browser, $window, $cookies) {
var self = this,
OFFLINE_COOKIE_NAME = 'ng-offline',
- DOCS_PATH = /^\/(api)|(guide)|(cookbook)|(misc)|(tutorial)/;
+ DOCS_PATH = /^\/(api)|(guide)|(cookbook)|(misc)|(tutorial)/,
+ INDEX_PATH = /^(\/|\/index[^\.]*.html)$/;
this.$location = $location;
@@ -13,7 +14,7 @@ function DocsController($location, $browser, $window, $cookies) {
self.subpage = false;
self.offlineEnabled = ($cookies[OFFLINE_COOKIE_NAME] == angular.version.full);
- if (!$location.path()) {
+ if (!$location.path() || INDEX_PATH.test($location.path())) {
$location.path('/api').replace();
}
@@ -40,11 +41,11 @@ function DocsController($location, $browser, $window, $cookies) {
});
this.getUrl = function(page){
- return '#!/' + page.section + '/' + page.id;
+ return page.section + '/' + page.id;
};
this.getCurrentPartial = function(){
- return this.partialId ? ('./' + this.sectionId + '/' + this.partialId + '.html') : '';
+ return this.partialId ? ('./partials/' + this.sectionId + '/' + this.partialId + '.html') : '';
};
this.getClass = function(page) {
@@ -127,7 +128,7 @@ function TutorialInstructionsCtrl($cookieStore) {
angular.service('$locationConfig', function() {
return {
- html5Mode: false,
+ html5Mode: true,
hashPrefix: '!'
};
});
diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html
index d5cfaed2d290..a2def7a68f07 100644
--- a/docs/src/templates/index.html
+++ b/docs/src/templates/index.html
@@ -5,23 +5,57 @@
doc:manifest>
-