Lightweight_markup_language

Lightweight markup language

Lightweight markup language

Markup language with simple, unobtrusive syntax


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.

History

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.

Types

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 <ref>'''source'''</ref>).

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.[clarification needed]

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.

Comparison of language features

More information Language, HTML export tool ...

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]

Comparison of implementation features

More information Language, Implementations ...

Comparison of lightweight markup language syntax

Inline span syntax

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.

More information HTML output, <strong>strongly emphasized</strong> ...

Gemtext does not have any inline formatting, monospaced text (called preformatted text in the context of Gemtext) must have the opening and closing ``` on their own lines.

Emphasis syntax

In HTML, text is emphasized with the <em> and <strong> element types, whereas <i> and <b> traditionally mark up text to be italicized or bold-faced, respectively.

Microsoft Word and Outlook, and accordingly other word processors and mail clients that strive for a similar user experience, support the basic convention of using asterisks for boldface and underscores for italic style. While Word removes the characters, Outlook retains them.

More information AsciiDoc, ATX ...
More information AsciiDoc, ATX ...

Editorial syntax

In HTML, removed or deleted and inserted text is marked up with the <del> and <ins> element types, respectively. However, legacy element types <s> or <strike> and <u> are still also available for stricken and underlined spans of text.

More information Jira, Markdown ...

AsciiDoc, ATX, Creole, MediaWiki, PmWiki, reST, Slack, Textile, Texy! and WhatsApp do not support dedicated markup for underlining text. Textile does, however, support insertion via the +inserted+ syntax.

More information Jira, Markdown ...

AsciiDoc, ATX, Creole, MediaWiki, PmWiki, reST, Setext and Texy! do not support dedicated markup for striking through text.

Programming syntax

Quoted computer code is traditionally presented in typewriter-like fonts where each character occupies the same fixed width. HTML offers the semantic <code> and the deprecated, presentational <tt> element types for this task.

More information AsciiDoc, ATX ...

Mediawiki and Gemtext do not provide lightweight markup for inline code spans.

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.

Most LMLs follow one of two styles for headings, either Setext-like underlines or atx-like[47] 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.

More information Chars:, = ...

RST determines heading levels dynamically, which makes authoring more individual on the one hand, but complicates merges from external sources on the other hand.

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.

More information Character:, = ...

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.

More information Language, Format ...

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.

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.

More information Languages, Basic syntax ...

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

More information Languages, Text syntax ...

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

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.

More information Characters:, * ...

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.

More information Chars:, + ...

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.

More information Languages, Term being defined ...

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:[52] circa 2000
  • Grutatext:[53] circa 2002

See also


References

  1. "AsciiDoc ChangeLog". Retrieved 2017-02-24.
  2. "WikiCreole Versions". Retrieved 2017-02-24.
  3. "djot". Retrieved 2023-08-26.
  4. "djot 0.1.0". GitHub. Retrieved 2023-08-26.
  5. Jira. "Text Formatting Notation Help". Atlassian. Retrieved 2020-12-22.
  6. "Markdown". Aaron Swartz: The Weblog. 2004-03-19.
  7. "Daring Fireball: Markdown". Archived from the original on 2004-04-02. Retrieved 2014-04-25.
  8. "PHP Markdown Extra". Michel Fortin. Retrieved 2013-10-08.
  9. "PHP Markdown: History". Michel Fortin. Retrieved 2020-12-23.
  10. "MediaWiki history". Retrieved 2017-02-24.
  11. Pandoc, which is written in Haskell, parses Markdown (in two forms) and ReStructuredText, as well as HTML and LaTeX; it writes from any of these formats to HTML, RTF, LaTeX, ConTeXt, OpenDocument, EPUB and several other formats, including (via LaTeX) PDF.
  12. "Org mode for Emacs – Your Life in Plain Text". orgmode.org. OrgMode team. Retrieved 2016-12-09.
  13. "PmWiki Cookbook - Export addons". Retrieved 7 January 2018.
  14. "TidBITS in new format". TidBITS. 1992-01-06. Retrieved 2022-07-01.
  15. "Textism › Tools › Textile". textism.com. Archived from the original on 26 December 2002.
  16. "What is Texy". Retrieved 2017-02-24.
  17. "Html2wiki txt2tags module". cpan.org. Retrieved 2014-01-30.
  18. "Txt2tags User Guide". Txt2tags.org. Retrieved 2017-02-24.
  19. "txt2tags changelog". Retrieved 2017-02-24.
  20. "Txt2tags User Guide". Txt2tags.org. Retrieved 2017-02-24.
  21. "Converters". WikiCreole. Retrieved 2013-10-08.
  22. pegdown: A Java library for Markdown processing
  23. gfms: Github Flavored Markdown Server
  24. marked: A full-featured markdown parser and compiler, written in JavaScript. Built for speed.
  25. node-gfm: GitHub flavored markdown to HTML converter
  26. Parsedown: Markdown parser written in PHP
  27. Ciconia: Markdown parser written in PHP
  28. Grip: GitHub Readme Instant Preview
  29. github-markdown: Self-contained Markdown parser for GitHub
  30. peg-markdown is an implementation of markdown in C.
  31. Discount is also an implementation of markdown in C.
  32. "Python-Markdown". Github.com. Retrieved 2013-10-08.
  33. Bruce Williams <http://codefluency.com>, for Ruby Central <http://rubycentral.org>. "kramdown: Project Info". RubyForge. Archived from the original on 2013-08-07. Retrieved 2013-10-08.
  34. Docutils is an implementation of ReStructuredText in Python
  35. Sphinx is an implementation of ReStructuredText in Python and Docutils with a number of output format Builders
  36. Aurelio Jargas www.aurelio.net (2012-01-11). "txt2tags". txt2tags. Retrieved 2013-10-08.
  37. "txt2tags.class.php - online convertor [sic]". Txt2tags.org. Retrieved 2013-10-08.
  38. "Markdown Syntax". Daringfireball.net. Retrieved 2013-10-08.
  39. Footnote in official manual "When using ‘*’ as a bullet, lines must be indented so that they are not interpreted as headlines. Also, when you are hiding leading stars to get a clean outline view, plain list items starting with a star may be hard to distinguish from true headlines. In short: even though ‘*’ is supported, it may be better to not use it for plain list items."
  40. "EtText: Documentation: Using EtText". ettext.taint.org. Retrieved 2022-06-30. originally from the WebMake project.
  41. "Un naufragio personal: The Grutatxt markup". triptico.com. Retrieved 2022-06-30. Public domain format (since version 2.20); originally used in the Gruta CMS system.

Share this article:

This article uses material from the Wikipedia article Lightweight_markup_language, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.