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

Commit 0b4a41a

Browse files
chore(doc-gen): add inline @type tag
1 parent 0e06669 commit 0b4a41a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/config/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ module.exports = function(config) {
2525
require('./tag-defs/tutorial-step')
2626
]);
2727

28+
config.append('processing.inlineTagDefinitions', [
29+
require('./inline-tag-defs/type')
30+
]);
31+
2832
config.set('processing.search.ignoreWordsFile', path.resolve(packagePath, 'ignore.words'));
2933

3034
config.prepend('rendering.templateFolders', [

docs/config/inline-tag-defs/type.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var typeClassFilter = require('dgeni-packages/ngdoc/rendering/filters/type-class');
2+
var encoder = new require('node-html-encoder').Encoder();
3+
4+
module.exports = {
5+
name: 'type',
6+
description: 'Replace with markup that displays a nice type',
7+
handlerFactory: function() {
8+
return function(doc, tagName, tagDescription) {
9+
return '<a href="" class="' + typeClassFilter.process(tagDescription) + '">'+encoder.htmlEncode(tagDescription) + '</a>';
10+
};
11+
}
12+
};

0 commit comments

Comments
 (0)