Skip to content

Commit

Permalink
chore(doc-gen): add inline @type tag
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Mar 7, 2014
1 parent 0e06669 commit 0b4a41a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 25,10 @@ module.exports = function(config) {
require('./tag-defs/tutorial-step')
]);

config.append('processing.inlineTagDefinitions', [
require('./inline-tag-defs/type')
]);

config.set('processing.search.ignoreWordsFile', path.resolve(packagePath, 'ignore.words'));

config.prepend('rendering.templateFolders', [
Expand Down
12 changes: 12 additions & 0 deletions docs/config/inline-tag-defs/type.js
Original file line number Diff line number Diff line change
@@ -0,0 1,12 @@
var typeClassFilter = require('dgeni-packages/ngdoc/rendering/filters/type-class');
var encoder = new require('node-html-encoder').Encoder();

module.exports = {
name: 'type',
description: 'Replace with markup that displays a nice type',
handlerFactory: function() {
return function(doc, tagName, tagDescription) {
return '<a href="" class="' typeClassFilter.process(tagDescription) '">' encoder.htmlEncode(tagDescription) '</a>';
};
}
};

0 comments on commit 0b4a41a

Please sign in to comment.