Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 03f858e

Browse files
chore(docs): improve error doc layout and linking
You can now link to an error by its name, namespace:name or error:namespace:name. For example these would all link to https://docs.angularjs.org/error/$compile/ctreq ``` {@link ctreq} {@link $compile:ctreq} {@link error:$compile:ctreq} ```
1 parent 4a26249 commit 03f858e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

docs/config/index.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,16 @@ module.exports = new Package('angularjs', [
125125
});
126126

127127
computeIdsProcessor.idTemplates.push({
128-
docTypes: ['error', 'errorNamespace'],
128+
docTypes: ['error'],
129+
getId: function(doc) { return 'error:' + doc.namespace + ':' + doc.name; },
130+
getAliases: function(doc) { return [doc.name, doc.namespace + ':' + doc.name, doc.id]; }
131+
},
132+
{
133+
docTypes: ['errorNamespace'],
129134
getId: function(doc) { return 'error:' + doc.name; },
130135
getAliases: function(doc) { return [doc.id]; }
131-
});
136+
}
137+
);
132138
})
133139

134140
.config(function(checkAnchorLinksProcessor) {

docs/config/templates/error.template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "base.template.html" %}
22

33
{% block content %}
4-
<h1>Error: {$ doc.id $}
4+
<h1>Error: {$ doc.namespace $}:{$ doc.name $}
55
<div><span class='hint'>{$ doc.fullName $}</span></div>
66
</h1>
77

0 commit comments

Comments
 (0)