User Manual
This klartext user manual explains the concepts making up the klartext markup language. The examples are always show in the form of the klartext input, and in the XML content that is created by parsing the klartext file.
Tags
Tags are the basic building blocks of the klartext markup language. A tag is annotated by its name, followed by a colon:
Tags can be nested. Nested tags are intended by four spaces, or a tab:
In this example, the tag section contains two nested tags named section.
The scope of a tag is defined by the intendation level. A tag ends when another tag is defined on the same level:
Note
To be valid, a klartext file must have exactly one top-level tag with no indentation. In the examples here, this is the article tag.
Attributes
Tags can have attributes. Attributes are defined by their name and content:
IDs
A very common attribute for a tag is an ID. There are two ways to add an ID. The first uses a normal attribute:
The second way uses a slightly abbreviated syntax:
Languages
Another common attribute is used to identify the language of a tag's content:
will be converted to
Note that when using an ID and a language, the ID has to come first.
Links
The most common use for IDs is to provide an anchor for linking to a tag. Links can be defined in this way:
Link is a tag that is not followed by a colon, but by a > symbol. It is followed immediately by the ID of the tag to link to.
In addition to the ID, links can have any number of attributes:
Content
Tags can have content. The content is expressed in the form of Markdown:
Usually, content is in separate, indented paragraphs below the tag. In simple cases, you can define a single paragraph of content immediately behind the tag:
You can suppress the markdown conversion by using quotes:
Inline tags
Within the Markdown content, inline tags can be added with an abbreviated syntax:
Glossary entries
There is a special shortcut syntax for terms defined in a glossary:
Namespaces
It is possible to define namespaces for tags used in klartext:
Namespaces can also be used to make sure that IDs are unique within a scope:
Includes
klartext files allow to include other klartext files: