Skip to content

Fix namespace paths in type autolinking #197

@tmcw

Description

@tmcw
Member
/** Represents an HTTP response.
 *    @typedef {Object} HttpResponse
 *    @memberof request
 *    @static
 */

/** Example that doesn't work
 *    @function
 *    @param {request.HttpRequest} req - The request object
 */

Here's our current autolink code:

function autolink(paths, text) {
if (paths.indexOf(slug(text)) !== -1) {
return '<a href="#' + slug(text) + '">' + text + '</a>';
} else if (getGlobalExternalLink(text)) {
return '<a href="' + getGlobalExternalLink(text) + '">' + text + '</a>';
}
return text;
}
- this isn't getting the right paths generated.

Activity

developit

developit commented on Oct 19, 2015

@developit

Thanks :)

added this to the 3.0.0 milestone on Oct 27, 2015
tmcw

tmcw commented on Oct 27, 2015

@tmcw
MemberAuthor

Depends on #189

removed this from the 3.0.0 milestone on Oct 27, 2015
tmcw

tmcw commented on May 5, 2016

@tmcw
MemberAuthor

New autolinking approach in v4 fixes this.

dmp42

dmp42 commented on Sep 20, 2016

@dmp42

Using documentation 4.0.0-beta10 this is not (yet) working. Should this be reopened?

dmp42

dmp42 commented on Sep 20, 2016

@dmp42

Clarifying: the original example works as expected.

If you omit @static though:

  • Request is still listed as a static member of http
  • though the actual namespace for it is httpRequest (lacking dot)

To reproduce:

/**
 * @type class
 * @name http
 */

/**
 *
 * @typedef {Object} Request
 * @memberof http
 */

/**
 *
 * @typedef {Object} Request2
 * @memberof http
 * @static
 */

/**
 * @name foo
 * @type function
 * @param {http#Request} a
 * @param {http.Request} b
 * @param {httpRequest} c
 * @param {http#Request2} d
 * @param {http.Request2} e
 * @param {httpRequest2} f
 * @returns {httpRequest}
 */

added 2 commits that reference this issue on Oct 12, 2018
97a22a0
59325ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @tmcw@developit@dmp42

      Issue actions

        Fix namespace paths in type autolinking · Issue #197 · documentationjs/documentation