A lightweight markup language (LML), also termed a simple or humane markup language, is a markup language with simple, unobtrusive syntax. It is designed to be easy to write using any generic text editor and easy to read in its raw form. Lightweight markup languages are used in applications where it may be necessary to read the raw document as well as the final rendered output.
For instance, a person downloading a software library might prefer to read the documentation in a text editor rather than a web browser. Another application for such languages is to provide for data entry in web-based publishing, such as blogs and wikis, where the input interface is a simple text box. The server software then converts the input into a common document markup language like HTML.
Lightweight markup languages were originally used on text-only displays which could not display characters in italics or bold, so informal methods to convey this information had to be developed. This formatting choice was naturally carried forth to plain-text email communications. Console browsers may also resort to similar display conventions.
In 1986 international standard SGML provided facilities to define and parse lightweight markup languages using grammars and tag implication. The 1998 W3C XML is a profile of SGML that omits these facilities. However, no SGML document type definition (DTD) for any of the languages listed below is known.
Lightweight markup languages can be categorized by their tag types. Like HTML (<b>'''bold'''</b>
), some languages use named elements that share a common format for start and end tags (e.g. BBCode [b]'''bold'''[/b]
), whereas proper lightweight markup languages are restricted to ASCII-only punctuation marks and other non-letter symbols for tags, but some also mix both styles (e.g. Textile bq.
) or allow embedded HTML (e.g. Markdown), possibly extended with custom elements (e.g. MediaWiki <nowiki><ref>'''source'''</ref></nowiki>
).
Most languages distinguish between markup for lines or blocks and for shorter spans of texts, but some only support inline markup.
Some markup languages are tailored for a specific purpose, such as documenting computer code (e.g. POD, reST, RD) or being converted to a certain output format (usually HTML or LaTeX) and nothing else, others are more general in application. This includes whether they are oriented on textual presentation or on data serialization.
Presentation oriented languages include AsciiDoc, atx, BBCode, Creole, Crossmark, Djot, Epytext, Haml, JsonML, MakeDoc, Markdown, Org-mode, POD (Perl), reST (Python), RD (Ruby), Setext, SiSU, SPIP, Xupl, Texy!, Textile, txt2tags, UDO and Wikitext.
Data serialization oriented languages include Curl (homoiconic, but also reads JSON; every object serializes), JSON, and YAML.
Language | HTML export tool | HTML import tool | Tables | Link titles | class attribute | id attribute | Release date | ||
---|---|---|---|---|---|---|---|---|---|
AsciiDoc | 2002-11-25[1] | ||||||||
BBCode | 1998 | ||||||||
Creole | 2007-07-04[2] | ||||||||
Djot | [3] | 2022-07-30[4] | |||||||
Gemtext | 2020 | ||||||||
GitHub Flavored Markdown | 2011-04-28+ | ||||||||
Jira Formatting Notation | 2002+[5] | ||||||||
Markdown | 2004-03-19[6] [7] | ||||||||
Markdown Extra | [8] | 2013-04-11[9] | |||||||
MediaWiki | 2002[10] | ||||||||
MultiMarkdown | 2009-07-13 | ||||||||
Org-mode | [11] | 2003[12] | |||||||
PmWiki | [13] | 2002-01 | |||||||
POD | 1994 | ||||||||
reStructuredText | 2002-04-02[14] | ||||||||
setext | 1992[15] | ||||||||
Slack | 2013+[16] [17] | ||||||||
TiddlyWiki | 2004-09[18] | ||||||||
Textile | 2002-12-26[19] | ||||||||
Texy | 2004[20] | ||||||||
txt2tags | [21] | [22] | 2001-07-26[23] | ||||||
2016-03-16[24] |
Markdown's own syntax does not support class attributes or id attributes; however, since Markdown supports the inclusion of native HTML code, these features can be implemented using direct HTML. (Some extensions may support these features.)
txt2tags' own syntax does not support class attributes or id attributes; however, since txt2tags supports inclusion of native HTML code in tagged areas, these features can be implemented using direct HTML when saving to an HTML target.[25]
Although usually documented as yielding italic and bold text, most lightweight markup processors output semantic HTML elements em
and strong
instead. Monospaced text may either result in semantic code
or presentational tt
elements. Few languages make a distinction, e.g. Textile, or allow the user to configure the output easily, e.g. Texy.
LMLs sometimes differ for multi-word markup where some require the markup characters to replace the inter-word spaces (infix).Some languages require a single character as prefix and suffix, other need doubled or even tripled ones or support both with slightly different meaning, e.g. different levels of emphasis.