Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make @link tag display more friendly #738

Closed
otakustay opened this issue Aug 18, 2014 · 1 comment
Closed

Make @link tag display more friendly #738

otakustay opened this issue Aug 18, 2014 · 1 comment

Comments

@otakustay
Copy link

When we have jsdoc as:

/**
 * See @{link SomeClass#.event:add} event
 */

The output could be:

See SomeClass#.event:add event

In practice, we'd like to see just:

See add event

or

See SomeClass.add event
@hegemonic hegemonic added this to the 3.4.0 milestone Dec 22, 2014
@hegemonic hegemonic modified the milestones: 3.5.0, 3.4.0 Oct 21, 2015
@hegemonic hegemonic modified the milestones: 3.6.0, 3.5.0 Jul 7, 2017
hegemonic added a commit that referenced this issue Jul 24, 2017
When this option is set to `true`, the `{@link}`, `{@linkcode}`, and `{@linkplain}` tags will use the short name, not the longname, as the link text. For example, `{@link foo.bar.baz}` will result in the link text `baz`.

This option has no effect when link text is provided as part of the tag (for example, `{@link foo.bar.baz My link text here}`).

As part of this change, I also simplified many of the tests for the `resolveLinks` method.
@hegemonic
Copy link
Contributor

Fixed on master. The fix will be included in JSDoc 3.6.0.

To enable this feature, set the value templates.useShortNamesInLinks to true in your JSDoc config file. This setting will cause JSDoc to use the short name of a symbol, rather than the full longname, as the link text. For example, the link text for {@link foo.bar.baz} will be baz instead of foo.bar.baz.

This setting has no effect when you include link text with the {@link} tag (for example, {@link foo.bar.baz My link text here}.

lheberlie added a commit to bsvensson/jsdoc that referenced this issue May 2, 2019
* master: (95 commits)
  update dependencies and supported Node.js versions
  3.5.5 changelog
  Prefer copyFileSync from here over native (jsdoc#1440)
  upgrade Babylon
  fix test breakage
  3.5.4 changelog
  prevent crash when an anonymous class is passed as a parameter (jsdoc#1416)
  hide the signature in the heading for classes with hidden constructors (jsdoc#1397)
  chore(package): update nyc to version 11.1.0 (jsdoc#1417)
  add `templates.useShortNamesInLinks` config option (jsdoc#738)
  allow users to specify a highlighter for Markdown code blocks (jsdoc#1412)
  document `longnamesToTree`, plus other doc improvements (jsdoc#43)
  move namespaces and interfaces up in the nav (jsdoc#1410)
  don't pretty-print code blocks that begin with "```plain" (jsdoc#1361)
  improve comment
  make the `exports` tag work correctly when combined with the `enum` tag (jsdoc#970)
  fix Node.js 4.x
  update tested Node.js versions
  use the markdown-it Markdown parser by default (jsdoc#1243)
  enable more Babylon options (jsdoc#1411)
  ...

# Conflicts:
#	.travis.yml
#	README.md
#	lib/jsdoc/src/astbuilder.js
#	lib/jsdoc/src/visitor.js
#	lib/jsdoc/util/markdown.js
#	lib/jsdoc/util/templateHelper.js
#	package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants