Creates a Link
@param href an href value
@param rel a rel value
@param name an optional name value
@param prompt an optional prompt value
@param render an optional render value
@return a link instance
432285
public static Link link(String href, String rel, String name, String prompt, String render) {
        return link(new URIImpl(href), rel, name, prompt, render);
    }
1226070
private void beginInternalLink(ResourceReference reference, boolean freestanding,
        Map<String, String> parameters)
    {
        Map<String, String> spanAttributes = new LinkedHashMap<String, String>();
        Map<String, String> anchorAttributes = new LinkedHashMap<String, String>();

        // Add all parameters to the A attributes
        anchorAttributes.putAll(parameters);

        if (StringUtils.isEmpty(reference.getReference())) {
            spanAttributes.put(CLASS, WIKILINK);
            renderAutoLink(reference, spanAttributes, anchorAttributes);
        } else if (this.wikiModel.isDocumentAvailable(reference)) {
            spanAttributes.put(CLASS, WIKILINK);
            anchorAttributes.put(XHTMLLinkRenderer.HREF, this.wikiModel.getDocumentViewURL(reference));
        } else {
            // The wiki document doesn't exist
            spanAttributes.put(CLASS, "wikicreatelink");
            anchorAttributes.put(XHTMLLinkRenderer.HREF, this.wikiModel.getDocumentEditURL(reference));
        }

        getXHTMLWikiPrinter().printXMLStartElement(SPAN, spanAttributes);
        getXHTMLWikiPrinter().printXMLStartElement(XHTMLLinkRenderer.ANCHOR, anchorAttributes);
    }
352924
private Directive createDirective(
            final String name,
            final String value,
            final List<Parameter> params) {
        if (isQuoted(value)) {
            return new QuotedDirective(name, value, params);
        }
        if (HeaderConstants.LINK_HEADER.equals(name)) {
            return new LinkDirective(value, params);
        }
        return new Directive(name, value, params);
    }
993108
public static Link create(final String text, final String ref) {
		return new Link(text, null, '#'+ref);
	}
142701
private void renderAsLI(Writer writer, ProjectModel project, Iterator<Link> links, boolean wrap) throws IOException
    {
        if (!links.hasNext())
            return;

        if (wrap)
            writer.append("<ul>");
        while (links.hasNext())
        {
            Link link = links.next();
            writer.append("<li>");
            renderLink(writer, project, link);
            writer.append("</li>");
        }
        if (wrap)
            writer.append("</ul>");
    }
895364
function createLink(link) {
        var $link = $('<a>').addClass(CSS_CLASS_PAGE_LINK),
            left = link.bbox[0],
            top = link.bbox[1],
            attr = {};

        if (browser.ie) {
            // @NOTE: IE doesn't allow override of ctrl+click on anchor tags,
            // but there is a workaround to add a child element (which triggers
            // the onclick event first)
            $('<span>')
                .appendTo($link)
                .on('click', handleClick);
        }

        $link.css({
            left: left + 'pt',
            top: top + 'pt',
            width: link.bbox[2] - left + 'pt',
            height: link.bbox[3] - top + 'pt'
        });

        if (link.uri) {
            if (/^http|^mailto/.test(link.uri)) {
                attr.href = encodeURI(link.uri);
                attr.target = '_blank';
                attr.rel = 'noreferrer'; // strip referrer for privacy
            } else {
                // don't embed this link... we don't trust the protocol
                return;
            }
        } else if (link.destination) {
            attr.href = '#page-' + link.destination.pagenum;
        }

        $link.attr(attr);
        $link.data('link', link);
        $link.appendTo($el);
    }
655678
public static Response createLinksHandler(ParaObject pobj, String id2) {
		try (final Metrics.Context context = Metrics.time(null, RestUtils.class, "links", "create")) {
			if (id2 != null && pobj != null) {
				String linkid = pobj.link(id2);
				if (linkid == null) {
					return getStatusResponse(Response.Status.BAD_REQUEST, "Failed to create link.");
				} else {
					return Response.ok(linkid, MediaType.TEXT_PLAIN_TYPE).build();
				}
			} else {
				return getStatusResponse(Response.Status.BAD_REQUEST, "Parameters 'type' and 'id' are missing.");
			}
		}
	}
655215
public LinkModel getOrCreate(String description, String href)
    {
        Iterable<Vertex> results = (List<Vertex>)getQuery().traverse(g -> g.has(LinkModel.PROPERTY_DESCRIPTION, description).has(LinkModel.PROPERTY_LINK, href)).getRawTraversal().toList();
        if (!results.iterator().hasNext())
        {
            LinkModel model = create();
            model.setDescription(description);
            model.setLink(href);
            return model;
        }
        return frame(results.iterator().next());
    }
292
function link(node, href) {
  var self = this
  var value = 'children' in node ? self.all(node).join('') : node.alt
  var url = escape(typeof href === 'string' ? href : node.url || '')
  var head

  if (url && url.slice(0, mailto.length) === mailto) {
    url = url.slice(mailto.length)
  }

  head = url.charAt(0) === '#' && self.headings[url.slice(1)]

  if (head) {
    url = '(' + escape(toString(head)) + ')'
  } else {
    if (value && escape(url) === value) {
      value = ''
    }

    if (url) {
      url = '\\(la' + escape(url) + '\\(ra'
    }
  }

  if (value) {
    value = bold.call(self, value)

    if (url) {
      value += ' '
    }
  }

  return value + (url ? italic.call(self, url) : '')
}
303954
private String renderListAsLinks( List<String> names ) {

		List<String> newNames = new ArrayList<> ();
		for( String s : names )
			newNames.add( applyLink( s, s ));

		return renderList( newNames );
	}
911647
public GenericResponseBuilder<T> link(URI uri, String rel) {
    rawBuilder.link(uri, rel);
    return this;
  }
1160377
public ParagraphBuilder link(final String text, final String ref) {
		final ParagraphElement paragraphElement = Link.create(text, ref);
		this.paragraphElements.add(paragraphElement);
		return this;
	}
736640
public BoxWebLink.Info createWebLink(URL linkURL, String description) {
        return this.createWebLink(null, linkURL, description);
    }
281273
function Link(props) {

  // Handle clicks of the link
  const onClick = e => {
    e.preventDefault();
    routeTo(path);
  };

  // If link is for a new tab
  if(props.openIn === 'new') {
    return (
      <a href={props.to} target="_blank" rel="noopener noreferrer">
        {props.children}
      </a>
    );
  }

  return (
    <a href={props.to} onClick={onClick}>
      {props.children}
    </a>
  );
}
236003
public void createLink(HalRelation rel, String... pathParams) {
    if(pathParams != null && pathParams.length > 0 && pathParams[0] != null) {
      Set<String> linkedResourceIds = linkedResources.get(rel);
      if(linkedResourceIds == null) {
        linkedResourceIds = new HashSet<String>();
        linkedResources.put(rel, linkedResourceIds);
      }

      // Hmm... use the last id in the pathParams as linked resource id
      linkedResourceIds.add(pathParams[pathParams.length - 1]);

      resource.addLink(rel.relName, rel.uriTemplate.build((Object[])pathParams));
    }
  }
315712
def create_link_to(block, url, remote, method = nil, confirm = nil)
      if remote
        return link_to(block, url, :method => method, :confirm => confirm, :remote => true)
      end
      link_to(block, url, :method => method, :confirm => confirm)
    end
76930
def _createLink(self, linkResult, replaceParamFile):
        
        link = None

        # Cases
        if linkResult['type'] == 'XSEC':
            # Cross section link handler
            link = self._createCrossSection(linkResult, replaceParamFile)

        elif linkResult['type'] == 'STRUCTURE':
            # Structure link handler
            link = self._createStructure(linkResult, replaceParamFile)

        elif linkResult['type'] in ('RESERVOIR', 'LAKE'):
            # Reservoir/lake handler
            link = self._createReservoir(linkResult, replaceParamFile)

        return link