I'm creating docs using ng-router in non-html5 mode. All links should be converted to href="#!/path". By default tag {@link} creates href="path".
Is ths behaviour configurable?
I'm creating docs using ng-router in non-html5 mode. All links should be converted to href="#!/path". By default tag {@link} creates href="path".
Is ths behaviour configurable?
What i've found is, that ngdoc
is using link
filter.
You can override that filter with 2 simple steps.
Create a file (./filters/link.js
) with the following content:
var _ = require('lodash');
module.exports = function() {
return {
name: 'link',
process: function(url, title, doc) {
return _.template('{@link ${url} ${title} }')({ url: '#!/'+url, title: title });
}
};
};
After you have to register (override) it. In your dgeni configuration file put this:
...
.config(function(templateEngine, getInjectables) {
templateEngine.filters = templateEngine.filters.concat(getInjectables([
require('./filters/link')
]));
})
...
This will register a new filter under the name link
. Since it's running after ngdoc configuration, it will override existing link
filter.
Hope it helps.