kb/data/en.wikipedia.org/wiki/Lightweight_markup_language-1.md

5.3 KiB

title chunk source category tags date_saved instance
Lightweight markup language 2/2 https://en.wikipedia.org/wiki/Lightweight_markup_language reference science, encyclopedia 2026-05-05T08:03:31.907383+00:00 kb-cron

=== Heading syntax === Headings are usually available in up to six levels, but the top one is often reserved to contain the same as the document title, which may be set externally. Some documentation may associate levels with divisional types, e.g., part, chapter, section, article or paragraph. This article uses 1 as the top level, but index of heading levels may begin at 1 or 0 in official documentation. Most LMLs follow one of two styles for headings, either Setext-like underlines or atx-like line markers, or they support both.

==== Underlined headings ==== Level 1 Heading

Level 2 Heading

Level 3 Heading

The first style uses underlines, i.e., repeated characters (e.g., equals =, hyphen - or tilde ~, usually at least two or four times) in the line below the heading text.

Headings may optionally be overline in reStructuredText, in addition to being underlined.

==== Prefixed headings ====
# Level 1 Heading
## Level 2 Heading ##
### Level 3 Heading ###
The second style is based on repeated markers (e.g., hash #, equals = or asterisk *) at the start of the heading itself, where the number of repetitions indicates the (sometimes inverse) heading level. Most languages also support the reduplication of the markers at the end of the line, but whereas some make them mandatory, others do not even expect their numbers to match.

Org-mode supports indentation as a means of indicating the level.
BBCode does not support section headings at all.
POD and Textile choose the HTML convention of numbered heading levels instead.

Microsoft Word supports auto-formatting paragraphs as headings if they do not contain more than a handful of words, no period at the end and the user hits the enter key twice. For lower levels, the user may press the tabulator key the according number of times before entering the text, i.e., one through eight tabs for heading levels two through nine.

=== Link syntax ===
Hyperlinks can either be added inline, which may clutter the code because of long URLs, or with named alias or numbered id references to lines containing nothing but the address and related attributes and often may be located anywhere in the document.
Most languages allow the author to specify text Text to be displayed instead of the plain address http://example.com and some also provide methods to set a different link title Title which may contain more information about the destination.
LMLs that are tailored for special setups, e.g., wikis or code documentation, may automatically generate named anchors (for headings, functions etc.) inside the document, link to related pages (possibly in a different namespace) or provide a textual search for linked keywords.
Most languages employ (double) square or angular brackets to surround links, but hardly any two languages are completely compatible. Many can automatically recognize and parse absolute URLs inside the text without further markup.

Gemtext and setext links must be on a line by themselves, they cannot be used inline.

Org-mode's normal link syntax does a text search of the file. You can also put in dedicated targets with <<id>>.

=== Media and external resource syntax ===

=== List syntax ===
HTML requires an explicit element for the list, specifying its type, and one for each list item, but most lightweight markup languages need only different line prefixes for the bullet points or enumerated items. Some languages rely on indentation for nested lists, others use repeated parent list markers.

Microsoft Word automatically converts paragraphs that start with an asterisk *, hyphen-minus - or greater-than bracket > followed by a space or horizontal tabulator as bullet list items. It will also start an enumerated list for the digit 1 and the case-insensitive letters a (for alphabetic lists) or i (for roman numerals), if they are followed by a period ., a closing round parenthesis ), a greater-than sign > or a hyphen-minus - and a space or tab; in case of the round parenthesis an optional opening one ( before the list marker is also supported.
Languages differ on whether they support optional or mandatory digits in numbered list items, which kinds of enumerators they understand (e.g., decimal digit 1, roman numerals i or I, alphabetic letters a or A) and whether they support to keep explicit values in the output format. Some Markdown dialects, for instance, will respect a start value other than 1, but ignore any other explicit value.

Slack assists the user in entering enumerated and bullet lists, but does not actually format them as such, i.e., it just includes a leading digit followed by a period and a space or a bullet character • in front of a line.

=== Quotation syntax ===

=== Table syntax ===

== Historical formats ==
The following lightweight markup languages, while similar to some of those already mentioned, have not yet been added to the comparison tables in this article:

EtText: circa 2000.
Grutatext: circa 2002.

== See also ==
Comparison of document-markup languages
Comparison of documentation generators
Lightweight programming language

== Notes ==

== References ==

== External links ==
 Curl at Wikibooks