Skip to content

Linking to external resources

Lloyd Brookes edited this page Oct 14, 2016 · 1 revision

1. Say you extended and documented the TestRunner class:

/**
 * @extends {TestRunner}
 */
class Runner extends TextRunner {
  /**
   * My opinion of how tests should be done.
   */
  test () {}
}

2. Your output will look like this:

Runner ⇐ TestRunner

Kind: global class
Extends: TestRunner

runner.test()

My opinion of how tests should be done.

Kind: instance method of Runner

3. It would be useful if the TestRunner base class reference was hyperlinked to its documentation. To achieve this, create an @external tag anywhere in your source with an associated @see tag containing the link:

/**
 * @external TestRunner
 * @see https://github.com/75lb/test-runner
 */

4. Now, point the @extends reference to the new external tag's namepath. The final source looks like this:

/**
 * @extends {external:TestRunner}
 */
class Runner extends TextRunner {
  /**
   * My opinion of how tests should be done.
   */
  test () {}
}

/**
 * @external TestRunner
 * @see https://github.com/75lb/test-runner
 */

5. And here's the output - now we have links to the TestRunner documentation.

Runner ⇐ TestRunner

Kind: global class
Extends: TestRunner

runner.test()

My opinion of how tests should be done.

Kind: instance method of Runner

Clone this wiki locally