diff --git a/docs/angular.io-package/index.js b/docs/angular.io-package/index.js index d6521df300..240900e3f6 100644 --- a/docs/angular.io-package/index.js +++ b/docs/angular.io-package/index.js @@ -58,7 +58,10 @@ module.exports = new Package('angular.io', [basePackage]) .config(function(templateEngine, getInjectables) { - templateEngine.filters = templateEngine.filters.concat(getInjectables([require('./rendering/trimBlankLines')])); + templateEngine.filters = templateEngine.filters.concat(getInjectables([ + require('./rendering/trimBlankLines'), + require('./rendering/toId') + ])); }); diff --git a/docs/angular.io-package/rendering/toId.js b/docs/angular.io-package/rendering/toId.js new file mode 100644 index 0000000000..4b6f33f7c5 --- /dev/null +++ b/docs/angular.io-package/rendering/toId.js @@ -0,0 +1,8 @@ +module.exports = function() { + return { + name: 'toId', + process: function(str) { + return str.replace(/[^(a-z)(A-Z)(0-9)._-]/, '-'); + } + }; +}; \ No newline at end of file diff --git a/docs/angular.io-package/templates/class.template.html b/docs/angular.io-package/templates/class.template.html index b8bdd56691..bbb78f24be 100644 --- a/docs/angular.io-package/templates/class.template.html +++ b/docs/angular.io-package/templates/class.template.html @@ -29,7 +29,7 @@ p.location-badge. {%- if doc.constructorDoc %} .l-sub-section - h3 {$ doc.constructorDoc.name $} + h3#{$ doc.constructorDoc.name | toId $} {$ doc.constructorDoc.name $} {% if doc.constructorDoc.parameters %} pre.prettyprint @@ -44,7 +44,7 @@ p.location-badge. {%- for member in doc.members %}{% if not member.private %} .l-sub-section - h3 {$ member.name $}{% if member.optional %}?{% endif %} + h3#{$ member.name | toId $} {$ member.name $}{% if member.optional %}?{% endif %} {% if member.parameters %} pre.prettyprint