Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a new plugin to jsdoc called outerdocs.
Users of this plugin can define external namespace links in their configuration object and quickly reference them with the
@outerdocs
tag. A@see {@link}
will be created for each@outerdocs
tag and associated namespace.It is used with the
@outerdocs
or the@od
tag.It must be configured by adding an "outerdocs" config to the jsdoc config object.
@outerdocs
is passed a value consisting of period-delimited a name path with an optional#id
suffix and an optional link text after a space. It constructs a@link
based on the configuration parameters and adds it to the@see
array.outerdocs uses the first word in the period-delimited name path to find a configuration for that particular namespace. Depending on how the docs which are to be linked are structured,
@outerdocs
can build the url with slashes or dots, drop the first part of the name path or not, and append '.html' or not.For example, the outerdocs config in conf.json might look like this:
Outerdoc usage might look like this:
And the result is a
@see
element for each @outerdoc tag.Equivalent to writing:
Which results in this
rationale
I would personally use this in documentation I'm maintaining.
It's basic but flexible enough to do all sorts of documentation. It works great with MDN docs and you can define the namespaces as you like. I've linked to React and Phaser and Lodash and Bitcoin in testing.
It's an optional plugin that doesn't affect anything else.
Down the line, outerdocs could be evolve into a more full-fledged namespace resolution system, adding outerdoc links to @extends, @param, and other tags.
For now, I believe it adds a lot of functionality while being totally optional to use.
The idea for this is cause of Intersphinx, which I found pretty useful in some Python projects I worked on.
I think that any documentation generator needs to have some way of linking external documentation. This plugin brings at least some of that functionality to jsdoc. If a better solution is come up with, it will be easy to remove because it doesn't affect any other portions of the code base.