Creates a string that represents an external link.

@param docBookVersion The DocBook Version the link should be created for.
@param title
@param url            The links url.  @return
762517
protected String createExternalLinkElement(final DocBookVersion docBookVersion, final String title, final String url) {
        final StringBuilder linkEle = new StringBuilder();
        if (docBookVersion == DocBookVersion.DOCBOOK_50) {
            linkEle.append("<link xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"").append(url).append("\">");
            linkEle.append(title);
            linkEle.append("</link>");
        } else {
            linkEle.append("<ulink url=\"").append(url).append("\">");
            linkEle.append(title);
            linkEle.append("</ulink>");
        }
        return linkEle.toString();
    }
900672
public OmdbBuilder setTitle(final String title) throws OMDBException {
        if (StringUtils.isBlank(title)) {
            throw new OMDBException(ApiExceptionType.UNKNOWN_CAUSE, "Must provide a title!");
        }
        params.add(Param.TITLE, title);
        return this;
    }
611443
public Link createLink(String name, String url, boolean onMenu) {
        return getInstance().create().link(name, this, url, onMenu);
    }
94365
def link(self, link, title, text):
        
        if self.anonymous_references:
            underscore = '__'
        else:
            underscore = '_'
        if title:
            return self._raw_html(
                '<a href="{link}" title="{title}">{text}</a>'.format(
                    link=link, title=title, text=text
                )
            )
        if not self.parse_relative_links:
            return '\ `{text} <{target}>`{underscore}\ '.format(
                target=link,
                text=text,
                underscore=underscore
            )
        else:
            url_info = urlparse(link)
            if url_info.scheme:
                return '\ `{text} <{target}>`{underscore}\ '.format(
                    target=link,
                    text=text,
                    underscore=underscore
                )
            else:
                link_type = 'doc'
                anchor = url_info.fragment
                if url_info.fragment:
                    if url_info.path:
                        # Can't link to anchors via doc directive.
                        anchor = ''
                    else:
                        # Example: [text](#anchor)
                        link_type = 'ref'
                doc_link = '{doc_name}{anchor}'.format(
                    # splittext approach works whether or not path is set. It
                    # will return an empty string if unset, which leads to
                    # anchor only ref.
                    doc_name=os.path.splitext(url_info.path)[0],
                    anchor=anchor
                )
                return '\ :{link_type}:`{text} <{doc_link}>`\ '.format(
                    link_type=link_type,
                    doc_link=doc_link,
                    text=text
                )
867992
public static String createLinkToServiceDocumentation(Metadata metadata, String name) {
        if (isCrossLinkingEnabledForService(metadata)) {
            return String.format("@see <a href=\"http://%s/goto/WebAPI/%s/%s\" target=\"_top\">AWS API Documentation</a>",
                    AWS_DOCS_HOST,
                    metadata.getUid(),
                    name);
        }
        return "";
    }
461893
protected Node inlineExternal(Document doc, ParsedURL urldata, Node eold) {
    File in = new File(urldata.getPath());
    if(!in.exists()) {
      LoggingUtil.warning("Referencing non-existant file: " + urldata.toString());
      return null;
    }
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    try {
      os.write(SVGSyntax.DATA_PROTOCOL_PNG_PREFIX.getBytes());
      Base64EncoderStream encoder = new Base64EncoderStream(os);
      FileInputStream instream = new FileInputStream(in);
      byte[] buf = new byte[4096];
      while(true) {
        int read = instream.read(buf, 0, buf.length);
        if(read <= 0) {
          break;
        }
        encoder.write(buf, 0, read);
      }
      instream.close();
      encoder.close();
    }
    catch(IOException e) {
      LoggingUtil.exception("Exception serializing image to png", e);
      return null;
    }

    Element i = (Element) super.cloneNode(doc, eold);
    i.setAttributeNS(SVGConstants.XLINK_NAMESPACE_URI, SVGConstants.XLINK_HREF_ATTRIBUTE, os.toString().replaceAll("\\s*[\\r\\n]+\\s*", ""));
    return i;
  }
590136
public static Link create(final String text, final TextStyle ts, final URL url) {
		return new Link(text, ts, url.toString());
	}
627182
private void buildOperationTitle(MarkupDocBuilder markupDocBuilder, String title, String anchor) {
        if (config.getPathsGroupedBy() == GroupBy.AS_IS) {
            markupDocBuilder.sectionTitleWithAnchorLevel2(title, anchor);
        } else {
            markupDocBuilder.sectionTitleWithAnchorLevel3(title, anchor);
        }
    }
998953
public String transform(String html, URL url, boolean setBaseTag) throws PageException {
	StringBuffer target = new StringBuffer();
	SourceCode cfml = new SourceCode(html, false, CFMLEngine.DIALECT_CFML);
	while (!cfml.isAfterLast()) {
	    if (cfml.forwardIfCurrent('<')) {
		target.append('<');
		try {
		    for (int i = 0; i < tags.length; i++) {
			if (cfml.forwardIfCurrent(tags[i].tag + " ")) {
			    target.append(tags[i].tag + " ");
			    transformTag(target, cfml, tags[i], url);
			}
		    }
		}
		catch (MalformedURLException me) {
		    throw Caster.toPageException(me);
		}
	    }
	    else {
		target.append(cfml.getCurrent());
		cfml.next();
	    }

	}
	if (!setBaseTag) return target.toString();

	html = target.toString();
	String prefix = "", postfix = "";
	int index = StringUtil.indexOfIgnoreCase(html, "</head>");
	if (index == -1) {
	    prefix = "<head>";
	    postfix = "</head>";
	    index = StringUtil.indexOfIgnoreCase(html, "</html>");
	}

	if (index != -1) {
	    StringBuffer sb = new StringBuffer();
	    sb.append(html.substring(0, index));
	    String port = url.getPort() == -1 ? "" : ":" + url.getPort();
	    sb.append(prefix + "<base href=\"" + (url.getProtocol() + "://" + url.getHost() + port) + "\">" + postfix);
	    sb.append(html.substring(index));
	    html = sb.toString();

	}
	return html;
    }
35941
public static String[] mappingGroovyName(String url,String version) {
		Iterator it = urlMap.entrySet().iterator();
		while (it.hasNext()) {
			Entry entry = (Entry) it.next();

			String key = (String) entry.getKey();
			if(key.equals(url)){
				MicroUrlBean urlBean=(MicroUrlBean) entry.getValue();
				if(version==null || "".equals(version)){
					return urlBean.getDefaultInfo();
				}else{
					version=versionFormat(version);
				}
				Entry fEntry=urlBean.getTreeMap().floorEntry(version);
				String[] ret=null;
				if(fEntry!=null){
					ret=(String[]) fEntry.getValue();
				}
				return ret;
			}
		}
		return null;
	}
514340
public ParagraphBuilder link(final String text, final URL url) {
		final ParagraphElement paragraphElement = Link.create(text, url);
		this.paragraphElements.add(paragraphElement);
		return this;
	}
272106
public void setUrl(String v) {
    if (FullTextLink_Type.featOkTst && ((FullTextLink_Type)jcasType).casFeat_url == null)
      jcasType.jcas.throwFeatMissing("url", "de.julielab.jules.types.FullTextLink");
    jcasType.ll_cas.ll_setStringValue(addr, ((FullTextLink_Type)jcasType).casFeatCode_url, v);}
87919
public static PrintWriter initHTML(ServletResponse response, String title
      ) throws IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<html>\n"
        + "<link rel='stylesheet' type='text/css' href='/static/hadoop.css'>\n"
        + "<title>" + title + "</title>\n"
        + "<body>\n"
        + "<h1>" + title + "</h1>\n");
    return out;
  }
270002
def make_document(self, titlestring):
        
        #root = etree.XML('''<?xml version="1.0"?>\
#<!DOCTYPE html  PUBLIC '-//W3C//DTD XHTML 1.1//EN'  'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>\
#<html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops">\
#</html>''')

        root = etree.XML('''<?xml version="1.0"?>\
<!DOCTYPE html>\
<html xmlns="http://www.w3.org/1999/xhtml">\
</html>''')

        document = etree.ElementTree(root)
        html = document.getroot()
        head = etree.SubElement(html, 'head')
        etree.SubElement(html, 'body')
        title = etree.SubElement(head, 'title')
        title.text = titlestring
        #The href for the css stylesheet is a standin, can be overwritten
        etree.SubElement(head,
                         'link',
                         {'href': 'css/default.css',
                          'rel': 'stylesheet',
                          'type': 'text/css'})

        return document
251649
static Map<String, String> getVersionAttributes(URL url) throws IOException {
        Map<String, String> ret = new LinkedHashMap<>();
        try (InputStream inputStream = url.openStream()) {
            Manifest manifest = new Manifest(inputStream);
            Attributes attributes = manifest.getMainAttributes();
            for (String key : VERSION_ATTRIBUTES) {
                final String value = attributes.getValue(key);
                ret.put(key, value == null ? UNKNOWN_VALUE : value);
            }
        }
        return ret;
    }
497492
static BsonDocument getDocumentVersionDoc(final BsonDocument document) {
    if (document == null || !document.containsKey(DOCUMENT_VERSION_FIELD)) {
      return null;
    }
    return document.getDocument(DOCUMENT_VERSION_FIELD, null);
  }
312142
boolean documentVersion(String version) {
    if (!lazyInitDocumentation()) {
      return true;
    }

    if (documentation.version != null) {
      return false;
    }

    documentation.version = version;
    return true;
  }