Lightweight markup language explained

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 (&lt;b>'''bold'''&lt;/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.

Comparison of language features

Comparing language features
LanguageHTML export toolHTML import toolTablesLink titlesclass attributeid attributeRelease date
AsciiDoc2002-11-25[1]
BBCode1998
Creole2007-07-04[2]
Djot[3] 2022-07-30[4]
Gemtext2020
GitHub Flavored Markdown2011-04-28+
Jira Formatting Notation2002+[5]
Markdown2004-03-19[6] [7]
Markdown Extra[8] 2013-04-11[9]
MediaWiki2002[10]
MultiMarkdown2009-07-13
Org-mode[11] 2003[12]
PmWiki[13] 2002-01
POD1994
reStructuredText2002-04-02[14]
setext1992[15]
Slack2013+[16] [17]
TiddlyWiki2004-09[18]
Textile2002-12-26[19]
Texy2004[20]
txt2tags[21] [22] 2001-07-26[23]
WhatsApp2016-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]

Comparison of implementation features

DOC(X)LMLs OtherLicense
AsciiDocPython, Ruby, JavaScript, JavaMan page etc.GNU GPL, MIT
BBCodePerl, PHP, C#, Python, RubyPublic Domain
CreolePHP, Python, Ruby, JavaScript[26] Depends on implementationCC_BY-SA 1.0
DjotLua (originally), JavaScript, Prolog, RustMIT
rowspan=2GitHub Flavored MarkdownHaskell (Pandoc)OPMLGPL
Java,[27] JavaScript,[28] [29] [30] PHP,[31] [32] Python,[33] Ruby[34] Proprietary
MarkdownPerl (originally), C,[35] [36] Python,[37] JavaScript, Haskell, Ruby,[38] C#, Java, PHPBSD-style & GPL (both)
Markdown ExtraPHP (originally), Python, RubyBSD-style & GPL (both)
MediaWikiPerl, PHP, Haskell, PythonGNU GPL
MultiMarkdownC, PerlOPMLGPL, MIT
Org-modeEmacs Lisp, Ruby (parser only), Perl, OCaml[39] Markdown TXT, XOXO, iCalendar, Texinfo, man, contrib: groff, s5, deck.js, Confluence Wiki Markup,[40] TaskJuggler, RSS, FreeMindGPL
PmWikiPHPGNU GPL
PODPerlMan page, plain textArtistic License, Perl's license
reStructuredTextPython,[41] [42] Haskell (Pandoc), Java,man, S5, Devhelp, QT Help, CHM, JSONPublic Domain
TextilePHP, JavaScript, Java, Perl, Python, Ruby, ASP, C#, HaskellTextile License
Texy!PHP, C#GNU GPL v2 License
txt2tagsPython,[43] PHP[44] roff, man, MagicPoint, Lout, PageMaker, ASCII Art, TXTGPL

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.

Notes and References

  1. Web site: AsciiDoc ChangeLog . 2017-02-24.
  2. Web site: WikiCreole Versions . 2017-02-24.
  3. Web site: djot . 2023-08-26.
  4. Web site: djot 0.1.0 . . 2023-08-26.
  5. Web site: Text Formatting Notation Help. Atlassian. Jira. 2020-12-22.
  6. Web site: Markdown . 2004-03-19 . Aaron Swartz: The Weblog.
  7. Web site: Daring Fireball: Markdown . https://web.archive.org/web/20040402182332/http://daringfireball.net/projects/markdown/ . 2004-04-02 . 2014-04-25.
  8. Web site: PHP Markdown Extra . Michel Fortin . 2013-10-08.
  9. Web site: PHP Markdown: History. Michel Fortin . 2020-12-23.
  10. Web site: MediaWiki history . 2017-02-24.
  11. http://johnmacfarlane.net/pandoc/ Pandoc
  12. Web site: Org mode for Emacs – Your Life in Plain Text . orgmode.org . OrgMode team . 2016-12-09.
  13. Web site: PmWiki Cookbook - Export addons. 7 January 2018.
  14. Web site: An Introduction to reStructuredText . 2017-02-24.
  15. Web site: 1992-01-06 . TidBITS in new format . 2022-07-01 . TidBITS . en.
  16. Web site: Slack Help Center > Using Slack > Send messages > Format your messages . 2018-08-07.
  17. Web site: Slack API documentation: Basic message formatting . 2018-08-07.
  18. Web site: History of TiddlyWiki. tiddlywiki.com.
  19. Web site: Textism › Tools › Textile. https://web.archive.org/web/20021226035527/http://textism.com/tools/textile/. 26 December 2002. textism.com.
  20. Web site: What is Texy . 2017-02-24.
  21. Web site: Html2wiki txt2tags module. cpan.org . 2014-01-30.
  22. Web site: Txt2tags User Guide . Txt2tags.org . 2017-02-24.
  23. Web site: txt2tags changelog . 2017-02-24.
  24. Web site: WhatsApp FAQ: Formatting your messages. 2017-11-21.
  25. Web site: Txt2tags User Guide . Txt2tags.org . 2017-02-24.
  26. Web site: Converters . WikiCreole . 2013-10-08.
  27. https://github.com/sirthias/pegdown pegdown
  28. https://github.com/ypocat/gfms gfms
  29. https://github.com/chjj/marked marked
  30. https://github.com/gagle/Node-GFM node-gfm
  31. http://parsedown.org/ Parsedown
  32. https://github.com/kzykhys/Ciconia Ciconia
  33. https://github.com/joeyespo/grip Grip
  34. https://rubygems.org/gems/github-markdown github-markdown
  35. https://github.com/jgm/peg-markdown peg-markdown
  36. http://www.pell.portland.or.us/~orc/Code/discount/ Discount
  37. Web site: Python-Markdown . Github.com . 2013-10-08.
  38. Web site: Bruce Williams , for Ruby Central . kramdown: Project Info . RubyForge . 2013-10-08 . dead . https://web.archive.org/web/20130807011316/http://rubyforge.org/projects/kramdown . 2013-08-07 .
  39. Web site: Via ox-pandoc and pandoc itself. .
  40. Web site: Atlassian . Confluence 4.0 Editor - What's Changed for Wiki Markup Users (Confluence Wiki Markup is dead) . 2018-03-28.
  41. http://docutils.sourceforge.net/docs/index.html Docutils
  42. [Sphinx (documentation generator)|Sphinx]
  43. Web site: Aurelio Jargas www.aurelio.net . txt2tags . txt2tags . 2012-01-11 . 2013-10-08.
  44. Web site: txt2tags.class.php - online convertor [sic] . Txt2tags.org . 2013-10-08.
  45. Web site: Markdown Syntax . Daringfireball.net . 2013-10-08.
  46. http://textile.thresholdstate.com/ Textile Syntax
  47. http://www.aaronsw.com/2002/atx/intro "atx, the true structured text format" by Aaron Swartz (2002)
  48. Web site: The Org Manual: section "A Cleaner Outline View" . 14 June 2020 . orgmanual-cleaner-outline-view.
  49. Web site: using org-adapt-indentation.
  50. Web site: using org-indent-mode or org-indent.