Djot

Lightweight markup language
Djot
Developed byJohn MacFarlane
Latest release
0.1.0
30 July 2022; 60 days ago (2022-07-30)[1]
Type of formatLightweight markup language
Extended fromCommonMark
Open format?Yes
Free format?Yes
Websitedjot.net Edit this at Wikidata

Djot (/dʒɑt/) is a lightweight markup language that fixes a few things that make CommonMark's syntax complex and difficult to parse efficiently.[2] It was created in 2022 by John MacFarlane, the author of Pandoc and a member of the CommonMark standardization group.[3][4]

It derives most of its features from CommonMark, but it is much fuller-featured than CommonMark such as description lists, footnotes, tables, several new kinds of inline formatting, math and smart punctuation.[2]

The reference implementation is written in a scripting language (Lua), but the language is designed to parse efficiently, so it is very fast.[5]

The code and documentation are released under the MIT License.[6]

Difference from CommonMark

Djot's syntax is a lot like CommonMark's its, but there are some differences.[7]

Blank lines

CommonMark does not need blank lines around block-level elements, but Djot need it.

Example:

Input Corresponding HTML produced by a CommonMark processor Corresponding HTML produced by a Djot processor
# Heading
Paragraphs.
<h1>Heading</h1>

<p>Paragraphs.</p>
<h1>Heading Paragraphs.</h1>
# Heading

Paragraphs.
<h1>Heading</h1>

<p>Paragraphs.</p>
<h1>Heading</h1>

<p>Paragraphs.</p>
Input Corresponding HTML produced by a CommonMark processor Corresponding HTML produced by a Djot processor
* fruits
  * apple
  * banana
<ul>
  <li>fruits
    <ul>
      <li>apple</li>
      <li>banana</li>
    </ul>
  </li>
</ul>
<ul>
  <li>fruits
  * apple
  * banana
  </li>
</ul>
* fruits

  * apple
  * banana
<ul>
  <li><p>fruits</p>
    <ul>
      <li>apple</li>
      <li>banana</li>
    </ul>
  </li>
</ul>
<ul>
  <li>fruits
    <ul>
      <li>apple</li>
      <li>banana</li>
    </ul>
  </li>
</ul>

Headings

Djot has no setext (= or -) headings, only ATX (#) headings.

Example:

Text using CommonMark syntax Text using Djot syntax Corresponding HTML produced
Heading
=======

Sub-heading
-----------
# Heading

## Sub-heading
<h1>Heading</h1>

<h2>Sub-heading</h2>

Emphasis

In CommonMark, use single * or _ for emphasis, and double * or _ for strong emphasis. In Djot, use single _ for emphasis, and single * for strong emphasis.

Example:

Text using CommonMark syntax Text using Djot syntax Corresponding HTML produced
Text attributes _italic_, **bold**.
Text attributes _italic_, *bold*.
<p>Text attributes <em>italic</em>, <strong>bold</strong>.</p>

Links

Unlike CommonMark, Djot has no special syntax for adding a title to a link. If you want it, use the general attribute syntax.

Example:

Text using CommonMark syntax Text using Djot syntax Corresponding HTML produced
A [link](http://example.com "title").
A [link](http://example.com){title="title"}.
<p>A <a href="http://example.com" title="title">link</a>.</p>

Examples

Text using Djot syntax Corresponding HTML produced by a Djot processor Text viewed in a browser
# Heading

## Sub-heading

Paragraphs are separated
by a blank line.

The backslash at the end of a line\
produce a line break.
<h1>Heading</h1>

<h2>Sub-heading</h2>

<p>Paragraphs are separated
by a blank line.</p>

<p>The backslash at the end of a line<br>
produce a line break.</p>
Heading
Sub-heading

Paragraphs are separated by a blank line.

The backslash at the end of a line
produce a line break.

Text attributes _italic_, *bold*, `monospace`.

Horizontal rule:

* * *
<p>Text attributes <em>italic</em>, <strong>bold</strong>, <code>monospace</code>.</p>

<p>Horizontal rule:</p>

<hr>
Text attributes italic, bold, monospace.

Horizontal rule:


Bullet lists nested within numbered list:

  1. fruits

     * apple
     * banana

  2. vegetables

     - carrot
     - broccoli
<p>Bullet lists nested within numbered list:</p>

<ol>
  <li>fruits
    <ul>
      <li>apple</li>
      <li>banana</li>
    </ul>
  </li>
  <li>vegetables
    <ul>
      <li>carrot</li>
      <li>broccoli</li>
    </ul>
  </li>
</ol>
Bullet lists nested within numbered list:
  1. fruits
    • apple
    • banana
  2. vegetables
    • carrot
    • broccoli
A [link](http://example.com).

![Image](Icon-pictures.png){title="icon"}

> Djot uses email-style
characters for blockquoting.
>
> Multiple paragraphs need to be prepended individually.

Raw content such as inline `<abbr title="Hypertext Markup Language">HTML</abbr>`{=html} tags must be explicitly marked.
<p>A <a href="http://example.com">link</a>.</p>

<p><img alt="Image" title="icon" src="Icon-pictures.png"></p>

<blockquote>
<p>Djot uses email-style characters for blockquoting.</p>
<p>Multiple paragraphs need to be prepended individually.</p>
</blockquote>

<p>Raw content such as inline <abbr title="Hypertext Markup Language">HTML</abbr> tags must be explicitly marked.</p>
A link.

Image

Djot uses email-style characters for blockquoting.

Multiple paragraphs need to be prepended individually.

Raw content such as inline HTML tags must be explicitly marked.

References

  1. ^ "Releases". github.com. Retrieved 2022-08-13.
  2. ^ a b "Djot (/dʒɑt/)". djot.net. Retrieved 2022-08-13.
  3. ^ MacFarlane, John (2022-07-11). "Initial commit". github.com. Retrieved 2022-08-13.
  4. ^ MacFarlane, John. "Tools". johnmacfarlane.net. Retrieved 2022-08-13.
  5. ^ "README.md". github.com. Retrieved 2022-08-13.
  6. ^ "License". github.com. Retrieved 2022-08-13.
  7. ^ "Quick Start for Markdown users". github.com. Retrieved 2022-08-14.

External links

  • Official website Edit this at Wikidata
  • v
  • t
  • e
Document markup languages
Office suite
  • Compound Document Format
  • OOXML
    • SpreadsheetML
    • PresentationML
    • WordprocessingML
  • ODF
  • UOF
Well-known
  • HTML
  • XHTML
  • MathML
  • RTF
  • TeX
  • LaTeX
  • Markdown
Lesser-known
  • AmigaGuide
  • AsciiDoc
  • BBCode
  • CML
  • C-HTML
  • ConTeXt
  • CrossMark
  • DITA
  • Djot
  • DocBook
  • eLML
  • EAD
  • Enriched text
  • FHTML
  • GML
  • GuideML
  • HDML
  • HyTime
  • IPF
  • LilyPond
  • LinuxDoc
  • Lout
  • MIF
  • MAML
  • MEI
  • MusicXML
  • OMDoc
  • OpenMath
  • Org-mode
  • POD
  • ReStructuredText
  • RTML
  • RFT
  • S1000D
  • Setext
  • TEI
  • Texinfo
  • troff
  • Wikitext
  • WML
  • WapTV
  • XAML
  • YAML
Stub icon

This computing article is a stub. You can help Wikipedia by expanding it.

  • v
  • t
  • e