@see <namepath> not supported
/**
* Both of these will link to the bar function.
* @see {@link bar}
* @see bar
*/
function foo() {}
Input:
/** @see Class#method */
Output with jsdoc to markdown:
**See:** Class#method
Should be:
**See:** [Class#method](Class+method)
I've been looking through the ddata source trying to work out how to make this change. Not entirely sure if this is a jsdoc-parse issue or a dmd issue. Either way I'm happy to submit a PR.
Hi, thanks for the report! will look at it this evening.
Not sure how formal the spec for @see is, but this is my quick fix in my plugin:
helpers.js
var ddata = require('ddata');
exports.linkifyOrInlineLinks = linkifyOrInlineLinks;
/**
replaces {@link} tags with markdown links in the suppied input text.
if no links are found, then assume this is a valid link target.
*/
function linkifyOrInlineLinks (text, options) {
if (text) {
var links = ddata.parseLink(text);
if (links.length > 0) {
links.forEach(function (link) {
var linked = ddata._link(link.url, options)
if (link.caption === link.url) link.caption = linked.name
if (linked.url) link.url = linked.url
text = text.replace(link.original, '[' + link.caption + '](' + link.url + ')')
})
} else {
var linked = ddata._link(text, options)
text = '[' + linked.name + '](' + linked.url + ')';
}
}
return text
}
see.hbs
{{#if see~}}
{{#if (equal see.length 1)~}}
**See**: {{{linkifyOrInlineLinks see.[0]}}}
{{else~}}
**See**
{{#each see}}- {{{linkifyOrInlineLinks this}}}
{{/each}}
{{/if~}}
{{/if~}}
Apologies for the delay! Yes, you're right - @see does not seem to parse namepaths which is a glaring oversight on my behalf.. I'd gratefully accept a PR but the handlebars templates/helpers are a not particularly inviting to work on, which is my main long-term goal to solve..