Informatics Engineering    
   
Table of contents
(Prev) Lightweight Linux distributionLightworks (Next)

Lightweight markup language

A lightweight markup language is a markup language with a simple syntax, designed to be easy for a human to enter with a simple text editor, and easy to read in its raw form.

Lightweight markup languages are used in applications where people might be expected to read the document source as well as the 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 is for entry in web-based publishing, such as weblogs and wikis, where the input interface is a simple text box. The server software converts the input to a common document markup language like HTML or XHTML.

Contents

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.

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.

Types

Presentation oriented languages include AsciiDoc, BBCode, Creole, Crossmark, deplate, Epytext, EtText, Haml, JsonML, MakeDoc, Markdown, Org-mode, POD, reStructuredText, Ruby Document format, Setext, SiSU, SPIP, Xupl, Texy!, Textile, txt2tags, UDO and Wikitext.

Data serialization oriented languages include Curl (programming language) (homoiconic, but also reads JSON; every object serializes), JSON, OGDL, Simple Declarative Language and YAML.

Comparison of language features

Comparing language features
LanguageImplementation language or platf.HTML export toolHTML import toolTablesLink titlesclass attributeid attributeExportable formatsLicense
AsciiDocPythonYesYesYesYesYesYesXHTML, LaTeX, PDF, DocBook, OpenDocument, EPUB, Man page, etc.GNU GPL
BBCodePerl, PHP, C#, Python, RubyNoNoNoNoNoNoHTML, XHTMLPublic Domain
CreolePHP, Python, Ruby, JavaScript [1]NoNoYesNoNoNoDepends on implementationCC-by-SA 1.0
deplateRubyYesNoYesNoYesYesHTML, LaTeX, DocBook, plain textGPL
MarkdownPerl (originally), C,[2][3] Python,[4] JavaScript, Haskell,[5] Ruby,[6] C#, Java, PHP.
Features are implementation dependent.
YesYesYesYesYesYesHTML originally; depending on the implementation, also LaTeX, ConTeXt, RTF, PDF, OpenDocument, DocBook, EPUB, MediaWiki, ReStructuredText, Man page, S5 (file format), etc.BSD-style & GPL (both)
Markdown ExtraPHP (originally), Python, RubyYesYesYes[7]YesNoNoXHTMLBSD-style & GPL (both)
MediaWikiPerl, PHPYesYesYesYesYesYesXHTMLGNU GPL
Org-modeEmacs Lisp, Ruby (parser only), PerlYesYes[8]YesYesYesYesPlain text, XHTML, LaTeX, PDF, DocBook, OpenDocument, TaskJuggler, Freemind, XOXO, iCalendarGPL
PmWikiPHPNoYesYesYesYesYesXHTML 1.0 TransitionalGNU GPL
PODPerlYes ?NoYes ? ?HTML, XHTML, XML, Man page, LaTeX, plain text, RTF, DocBookArtistic License, Perl's license
reStructuredTextPython,[9][10] Haskell, Java,YesNoYesYesYesautoLaTeX, XML, Man page, HTML (w3c valid), PDF, EPUB, S5, ODF, Devhelp, QT Help, CHM, JSONPublic Domain
TextilePHP, Java, Perl, Python, Ruby, ASP, C#YesNoYesYesYesYesXHTMLTextile License
Texy!PHP, C#; Java in progressYesYesYesYesYesYesXHTML or HTMLGNU GPL v2 License
txt2tagsPython,[11] PHP[12]Yes ?Yes[13]Yes ? ?HTML, XHTML, SGML, Creole, AsciiDoc, MediaWiki/Wikipedia, MoinMoin, PmWiki, DokuWiki, Google Code Wiki, LaTeX, roff, Man page, MagicPoint, Lout, PageMaker, ASCII Art and Plain-textGPL

Comparison of lightweight markup language syntax

Text/font-face formatting

Comparing text formatting syntax
LanguageBoldItalicMonospace (teletype)Notes
AsciiDoc*bold text*_italic text_+monospace text+Can double operators to ignore special characters (for example **bold _text** yields bold _text).
BBCode[b]bold text[/b][i]italic text[/i][code]monospace text[/code]Formatting works across line breaks.
Creole**bold text**//italic text//{{{monospace text}}}Triple curly braces are for nowiki which is optionally monospace in Creole (the choice of the implementor). Future Creole additions may introduce double hash marks (##) for monospace.
deplate{text style=bold: bold text}__emphasized text__''monospace text''deplate discourages visual formatting. Users who want to format text in a particular style have to define style classes in the given output format (CSS, LaTeX). By default, emphasized text is formatted in italics.
Markdown[14]**bold text**

or
__bold text__

*italic text*

or
_italic text_

Non-monospace text

    monospace&nbs p;text
    more mon ospace text
Inline `monospaced` text.

Markdown doesn't use bold and italic tags, but rather em (typically italic) and strong (typically bold) tags.

Monospace text is created by indenting that line 4 spaces or one tab character, or enclosing text in backticks: `monospaces`.

MediaWiki'''bold text'''''italic text''<code>monospace text</code> 
Org-mode*bold text*/italic text/=code= or ~verbatim~_underlined_ +strike-through+
PmWiki'''bold text'''''italic text''@@monospace text@@ 
PODB<bold text>I<italic text>C<monospace text>Indented text is also shown as monospaced code.
reStructuredText**bold text***italic text*``monospace text`` 
Setext**bold text**~italic text~  
Textile[15]*bold text*

or
**bold text**

_italic text_

or
__italic text__

@monospace text@Textile uses em (typically italic) and strong (typically bold) tags

on single symbols (and code tag), and i and b tags on double symbols.

Texy!**bold text***italic text*
or

//italic text//

`monospace text`Texy uses by default em (typically italic) and strong (typically bold) tags. It is possible to configure library to use another tags.
txt2tags**bold text**//italic text//``monospace text``__underlined__ --strike-through--

Section headers

Comparing section header formatting
LanguageFormatNotes
AsciiDoc= Level 1 Header

== Level 2 Header ==
=== Level 3 Header

or

Level 1 Header==============Level 2 Header--------------Level 3 Header~~~~~~~~~~~~~~
Close equals signs are optional (ignored if present). Level 1 is document/page title.
BBCode Does not support section headers
Creole= Level 1 Header

== Level 2 Header ==
=== Level 3 Header

Close equals signs are optional (ignored if present).
deplate* Level 1 Header

** Level 2 Header
*** Level 3 Header

deplate's default markup is historically based on EmacsWiki, which in turn is the base for Org-mode.
Markdown[14]# Level 1 Header

## Level 2 Header
or

Level 1 Header==============Level 2 Header--------------
Optionally you can "close" the #-style headers with any number of #'s. The closing hashes don’t need to match the number of hashes used to open the header. The #-style headers support up to 6 levels. The = and - style headers support only the two shown.
MediaWiki== Level 2 Header ==

=== Level 3 Header ===

= is available for level 1 header, but its use is discouraged in Wikipedia (reserved for page title). More = are possible, up to 6.
Org-modeDefault:
* Level 1 Header** Level 2 Header*** Level 3 Header
Cleaner view using org-indent-view
* Level 1 Header * Level 2 Header  * Level 3 Header
PmWiki!! Level 2 Header

!!! Level 3 Header

 ! is available for level 1 header, but its use is discouraged in PmWiki (used for the page title). More ! are possible, up to 6.
POD=head1 Level 1 heading

=head2 Level 2 heading

 
reStructuredText
Chapter 1 Title===============Section 1.1 Title-----------------Subsection 1.1.1 Title~~~~~~~~~~~~~~~~~~~~~~Section 1.2 Title-----------------Chapter 2 Title===============
Any of the following characters can be used as the "underline": = - ` : ' " ~ ^ _ * + # < >. The same character must be used for the same indentation level and may not be used for a new indentation level.
Textile[15]h1. Level 1 Header

h2. Level 2 Header

Up to 6 levels
Texy!### Level 1 Header

## Level 2 Header
or

Level 1 Header==============Level 2 Header--------------
You can optionally "close" the #-style headers with an equal number of #'s. The #-style headers support up to 6 levels. The underlined style headers support four levels (### *** === ----). Resulting absolute levels numbers are calculated dynamically. Optionally, less chars can denote higher header level.
txt2tags= Level 1 Header =

== Level 2 Header ==
=== Level 3 Header ===

Up to 6 levels. Using + characters instead of = characters creates numbered headers (the default being unnumbered).

Link syntax

Comparing link syntax
LanguageSyntaxNotes
AsciiDochttp://www.example.com

http://www.example.com[Link text]

 
BBCode[url]http://www.example.com[/url]

[url=http://www.example.com]Link text[/url]

Some BBCode implementations can auto-parse URLs as well and convert them to a elements.
Creole[[Internal Page]]

[[Internal Page|Display Text]]
[[http://www.example.com|Link text]] [[WikiCreole:Creole1.0|InterWiki Link]]

Free standing URL's are also detected.
deplate[[Internal Page]]

[[Internal Page][Display Text]]
[[http://www.example.com][Link text]] [[WikiCreole::Creole1.0][InterWiki Link]]

Free standing URL's are also detected. The format is close to Org-mode—see below.
Markdown[14]<http://www.example.com> or

[Link text](http://www.example.com "optional title attribute") or
[Link text][id]
and elsewhere
[id]: http://www.example.com "optional title attribute"

Allows for an optional title attribute.
MediaWiki[[Internal page]]

[[Internal page|Displayed text]]
[http://www.example.com]
[http://www.example.com External link]

Wikitext can auto-parse URLs as well and convert them to a elements.
Org-modelink format: [[link][description]] or [[link]]

[[My Target][Find my target]] - text search in current file
[[#my-custom-id]] - link to custom id
[[http://orgmode.org]] - external link
[[http://orgmode.org][Org Mode]] - external link with description [[file:/path/to/some/file]] or [[/path/to/some/file]] or [[./some/file]] - file system links

Link abbreviations[16] can optionally be set so that, for example:
  • [[google:anything]] can be a web link to http://www.google.com/search?q=anythi ng
  • [[wiki:Topic][topic]] can be a file link to /long/path/to/personal/wiki/Topic.org
PmWiki[[Internal page]]

[[Internal page|Displayed text]]
[[http://www.pmwiki.org]]
[[http://www.Pmwiki.org|External link]]

Wikitext can auto-parse URLs without spaces in them as well and convert them to a elements.
PODL</Internal Link>

L<Perl::Module::Link>
L<http://example.com/external_link >

The core POD standard does not support external links with titles.
reStructuredText`Link text <http://www.example.com/>`_

or
Linkname_
and elsewhere
.. _Linkname: http://example.com

 
Textile[15]"Link text (optional title attribute)":http://www.example.com

or
"Link text":alias
and elsewhere
[alias (optional title attribute)]http://www.example.com

Allows for an optional title attribute.
Texy!"Link text .(optional title)[opt. class or ID]{opt. style}":http://www.example.com

or
"Link text":alias
and elsewhere
[alias]: http://www.example.com .(optional title)[opt. class or ID]{opt. style}

Texy! modifiers allows for an optional title attribute, class, ID, and other HTML element attributes. Example: "Link .(title)[class#id]{color: blue;rel:nofollow}"
txt2tags[Link text www.example.com]txt2tags can auto-parse URLs as well and convert them to a elements. Also has support for targeting references within the same text, not just URLs.

See also

  • Comparison of documentation generators

References

  1. ^ WikiCreole: Converters
  2. ^ peg-markdown is an implementation of markdown in C.
  3. ^ Discount is also an implementation of markdown in C.
  4. ^ Python-Markdown
  5. ^ 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.
  6. ^ https://rubyforge.org/projects/kramdo wn/
  7. ^ PHP Markdown Extra
  8. ^ Pandoc converts markup formats to Org-mode, etc.
  9. ^ Docutils is an implementation of ReStructuredText in Python
  10. ^ Sphinx is an implementation of ReStructuredText in Python and Docutils with a number of output format Builders
  11. ^ http://txt2tags.org/
  12. ^ http://txt2tags.org/txt2tags.form.php
  13. ^ Txt2tags User Guide
  14. ^ a b c Markdown Syntax
  15. ^ a b c Textile Syntax
  16. ^ The Org Manual: Link abbreviations

External links

(Prev) Lightweight Linux distributionLightworks (Next)