ember-cli-addon-docs icon indicating copy to clipboard operation
ember-cli-addon-docs copied to clipboard

Better API doc linking

Open scottwernervt opened this issue 7 years ago • 2 comments

{@link} tag renders as plain text in API Reference documentation.

For example:

/**
 * My Addon Function
 *
 * {@link https://ember-learn.github.io/ember-cli-addon-docs/}
 * 
 * [ember-cli-addon-docs]{@link https://ember-learn.github.io/ember-cli-addon-docs/}
 *
 * {@link https://ember-learn.github.io/ember-cli-addon-docs/|ember-cli-addon-docs}
 *
 * {@link https://ember-learn.github.io/ember-cli-addon-docs/ ember-cli-addon-docs}
 *
 * @function myFunction
 * @returns {Boolean} True.
 */
export default function myFunction() {
  return true;
}

renders as:

myFunction(): boolean

My Addon Function

{@link https://ember-learn.github.io/ember-cli-addon-docs/}

[ember-cli-addon-docs]{@link https://ember-learn.github.io/ember-cli-addon-docs/}

{@link https://ember-learn.github.io/ember-cli-addon-docs/|ember-cli-addon-docs}

{@link https://ember-learn.github.io/ember-cli-addon-docs/ ember-cli-addon-docs}

I reference another project I borrowed code from and want to link back to it.

scottwernervt avatar Jun 22 '18 14:06 scottwernervt

You should be able to link using markdown links, which I believe is a more flexible solution here

[text](url)

pzuraq avatar Jun 22 '18 15:06 pzuraq

Talking to @dfreeman about this, we realized there are two edge cases to consider:

  • Relative links to elsewhere in the docs. Currently they do work, but they cause a full page refresh which is not ideal.
  • Linking types (particularly in type signatures), which would make traversing docs much easier

Will update this issue to match

pzuraq avatar Jun 22 '18 16:06 pzuraq