Zettelmarkup: Links

There are two kinds of links, regardless of links to (internal) other zettel or to (external) material. Both kinds begin with two consecutive left square bracket characters (“[”, U+005B) and ends with two consecutive right square bracket characters (“]”, U+005D). If the content starts with more than two left square bracket characters, all but the last two will be treated as text.

The first form provides some text plus the link specification, delimited by a vertical bar character (“|”, U+007C): [[text|linkspecification]]. The text is a sequence of inline elements. However, it should not contain links itself.

The second form just provides a link specification between the square brackets. Its text is derived from the link specification, e.g. by interpreting the link specification as text: [[linkspecification]].

The link specification for another zettel within the same Zettelstore is just the zettel identifier. To reference some content within a zettel, you can append a number sign character (“#”, U+0023) and the name of the mark to the zettel identifier. The resulting reference is called “zettel reference”.

If the link specification begins with the string query:, the text following this string will be interpreted as a query expression. The resulting reference is called “query reference”. When this type of references is rendered, it will typically reference a list of all zettel that fulfills the query expression.

A link specification starting with one slash character (“/”, U+002F), or one or two full stop characters (“.”, U+002E) followed by a slash character, will be interpreted as a local reference, called hosted reference. Such references will be interpreted relative to the web server hosting the Zettelstore.

If a link specification begins with two slash characters (called based reference), it will be interpreted relative to the value of url-prefix.

To specify some material outside the Zettelstore, just use an normal Uniform Resource Identifier (URI) as defined by RFC 3986.

Other topics

If the link references another zettel, and this zettel is not readable for the current user, because of a missing access rights, then only the associated text is presented.