How to use the dmd/helpers/ddata.isExternal function in dmd

To help you get started, we’ve selected a few dmd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twitch-js / twitch-js / scripts / generateDocs / helpers.js View on Github external
namepath = matches[1]
  } else {
    namepath = input
  }

  options.hash = { id: namepath }
  linked = dmd._identifier(options)
  if (!linked) {
    options.hash = { longname: namepath }
    linked = dmd._identifier(options)
  }
  if (!linked) {
    output = { name: input, url: null }
  } else {
    output.name = input.replace(namepath, linked.name)
    if (dmd.isExternal.call(linked)) {
      if (linked.description) {
        output.url = 'external#' + dmd.anchorName.call(linked, options)
      } else {
        if (linked.see && linked.see.length) {
          var firstLink = dmd.arseLink(linked.see[0])[0]
          output.url = firstLink ? firstLink.url : linked.see[0]
        } else {
          output.url = null
        }
      }
    } else {
      const pre = linked.scope === 'global' ? linked.kind : ''
      output.url = pre + '#' + dmd.anchorName.call(linked, options)
    }
  }
  return output