Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
How To
Syntax
FAQ
License

a element



The "a" element allow to define a link to an external file on the web. The attributes of this element are:
  • "href": the URL of the link
  • "checkLink": false to not check the validity of the link even if the configuration property specifies that links should be checked[1]

Configuration properties

Several configuration properties allow to configure if the existence of links is checked or not:
  • "checkLinks" specify that the presence of external links must be checked[2]
    for html pages, the presence of anchors if the "#" tag is found in the link construction is also checked
  • "checkHTTPLinks" specify if the URL links with the "http" protocol are checked. This property will only be used if the "checkLinks" property is set to true.
Main Article: Checking local links

Relative links will be considered relative to the output directory.

For example, if you have the following structure:
      -- > myRef.html
      wiki
      -- > index.html
      ---- > articles
      -------- > article1.html
and you have the following article:
   <article desc="article1">
   The <a href="myRef.html">reference</a>.
   </article>
The link will point to the myRef.html file.

Note that by default no local links outside of the wiki are allowed, so you will encounter an error if you have these kinds of links.
By default, relative links outside of the wiki will be written as relative.

For example, if you have the following structure:
      -- > myRef.html
      wiki
      -- > index.html
      ---- > articles
      -------- > article1.html
and you have the following article:
   <article desc="article1">
   The <a href="myRef.html">reference</a>.
   </article>
The html link will be:
   The <a href="../../myRef.html">reference</a>.
However it is possible for the write to specify that these relative links will be written instead as absolute. This is the case for:

setBaseURL

Main Article: syntax

The "setBaseURL" element allows to define the base directory to use for all relative external links following this declaration in the same article.

For example, the following:
  <setBaseURL path="href" />
  <a href="theFile.xml">The ref</a>
Is equivalent to:
   <a href="href/theFile.xml">The ref</a>

Example

  This is an <a href="http://docs.oracle.com/javase/8/docs/api/index.html">external link</a>
Result: This is an external link

Notes

  1. ^ See checking external links
  2. ^ for html pages, the presence of anchors if the "#" tag is found in the link construction is also checked

See also


Categories: syntax

docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.