How to use the jsdoc/util/templateHelper.createLink function in jsdoc

To help you get started, we’ve selected a few jsdoc 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 HumanBrainProject / jsdoc-sphinx / template / publish.js View on Github external
function registerLink(doclet) {
  var url = helper.createLink(doclet);
  helper.registerLink(doclet.longname, url);
  doclet.rstLink = url.substr(0, url.length - helper.fileExtension.length);

  // Parent link
  if (!doclet.memberof) {
    return;
  }
  var parent;
  parent = helper.find(context.data, {longname: doclet.memberof});
  if (parent && parent.length > 0) {
    doclet.parentRstLink = parent[0].rstLink;
  }
  // Reference code
  doclet.rstReference = doclet.parentRstLink + '.' + doclet.name;
}
github hegemonic / jsdoc-baseline / lib / helpers / expression / index.js View on Github external
id(doclet) {
            let fileUrl;
            let hash;

            doclet = doclet || {};

            if (!{}.hasOwnProperty.call(ids, doclet.longname)) {
                fileUrl = templateHelper.createLink(doclet);
                hash = url.parse(fileUrl).hash;

                if (hash) {
                    // strip the hash character
                    hash = hash.replace(/^#/, '');
                } else {
                    // as a fallback, use the name and variation
                    hash = doclet.name + (doclet.variation || '');
                }

                ids[doclet.longname] = hash;
            }

            return ids[doclet.longname];
        },
github caolan / async / support / jsdoc / theme / publish.js View on Github external
function hashToLink(doclet, hash) {
    if ( !/^(#.+)/.test(hash) ) { return hash; }

    var url = helper.createLink(doclet);

    url = url.replace(/(#.+|$)/, hash);
    return '<a href="' + url + '">' + hash + '</a>';
}
github mangalam-research / wed / misc / jsdoc_template / publish.js View on Github external
function hashToLink(doclet, hash) {
    if ( !/^(#.+)/.test(hash) ) { return hash; }

    var url = helper.createLink(doclet);

    url = url.replace(/(#.+|$)/, hash);
    return '<a href="' + url + '">' + hash + '</a>';
}
github vigetlabs / microcosm / jsdoc / templates / microcosm / publish.js View on Github external
function hashToLink(doclet, hash) {
  if (!/^(#.+)/.test(hash)) {
    return hash
  }

  var url = helper.createLink(doclet)

  url = url.replace(/(#.+|$)/, hash)
  return '<a href="' + url + '">' + hash + '</a>'
}
github jsdoc / jsdoc / templates / default / publish.js View on Github external
function hashToLink(doclet, hash) {
    if ( !/^(#.+)/.test(hash) ) { return hash; }

    var url = helper.createLink(doclet);

    url = url.replace(/(#.+|$)/, hash);
    return '<a href="' + url + '">' + hash + '</a>';
}
github tgideas / motion / component / tool / jsdoc3 / templates / default / publish.js View on Github external
function hashToLink(doclet, hash) {
    if ( !/^(#.+)/.test(hash) ) { return hash; }
    
    var url = helper.createLink(doclet);
    
    url = url.replace(/(#.+|$)/, hash);
    return '<a href="' + url + '">' + hash + '</a>';
}
github Haeresis / node-atlas / template / publish.js View on Github external
function hashToLink( doclet, hash ) {
	if ( !/^(#.+)/.test( hash ) ) { return hash; }

	var url = helper.createLink( doclet );

	url = url.replace( /(#.+|$)/, hash );
	return '<a href="' + url + '">' + hash + '</a>';
}
github adobe / coral-spectrum / res / docTemplate / publish-old.js View on Github external
function hashToLink(doclet, hash) {
    if ( !/^(#.+)/.test(hash) ) { return hash; }
    
    var url = helper.createLink(doclet);
    
    url = url.replace(/(#.+|$)/, hash);
    return '<a href="' + url + '">' + hash + '</a>';
}