Djot | |
Extension: | .dj[1] |
Developer: | John MacFarlane |
Type: | Lightweight markup language |
Extended From: | CommonMark |
Free: | Yes |
Open: | Yes |
Djot (pronounced as //dʒɑt//) is a lightweight markup language that aims to improve on CommonMark's syntax where it is 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 includes a wider set of features, including description lists, footnotes, tables, several new kinds of inline formatting, math and smart punctuation.
The original 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]
Djot's syntax is similar to CommonMark's, but there are some differences.[7]
CommonMark does not need blank lines around block-level elements, but Djot does.
Example:
Input | Corresponding HTML produced by a CommonMark processor | Corresponding HTML produced by a Djot processor | |
---|---|---|---|
Paragraphs. | HeadingParagraphs. | Heading Paragraphs. | |
Paragraphs. | HeadingParagraphs. | HeadingParagraphs. |
Input | Corresponding HTML produced by a CommonMark processor | Corresponding HTML produced by a Djot processor | |
---|---|---|---|
* apple * banana |
|
| |
* apple * banana |
|
|
Djot has no setext (=
or -
) headings, only ATX (#
) headings.
Example:
CommonMark uses single *
or _
for emphasis, and double *
or _
for strong emphasis. Djot uses single _
for emphasis, and single *
for strong emphasis.
Example:
Unlike CommonMark, Djot has no special syntax for adding a title to a link. A title can be added by using the general attribute syntax instead.
Example:
Text using Djot syntax | Corresponding HTML produced by a Djot processor | Text viewed in a browser | ||
---|---|---|---|---|
Paragraphs are separatedby a blank line. The backslash at the end of a line\produces a line break. | HeadingSub-headingParagraphs are separatedby a blank line. The backslash at the end of a line | Heading Sub-heading Paragraphs are separatedby a blank line. The backslash at the end of a line | ||
Horizontal rule:
| Text attributes italic, bold, Horizontal rule: | Text attributes italic, bold, monospace .Horizontal rule: ---- | ||
1. fruits * apple * banana 2. vegetables - carrot - broccoli | Bullet lists nested within a numbered list:
| Bullet lists nested within a numbered list:
| ||
[Image](Icon-pictures.png) > Djot uses email-stylecharacters for blockquoting.>> Multiple paragraphs need to be prepended individually. Raw content such as inline `HTML` tags must be explicitly marked. | A link.
Raw content such as inline HTML tags must be explicitly marked. | A link.Djot uses email-style characters for blockquoting. Raw content such as inline HTML tags must be explicitly marked. |
Name | License | Language | Repository | Description | |
---|---|---|---|---|---|
djot.js | TypeScript | https://github.com/jgm/djot.js | This is a TypeScript rewrite of the original reference implementation. | ||
djot.lua | Lua | https://github.com/jgm/djot.lua | The original reference implementation. | ||
Jotdown | Rust | https://github.com/hellux/jotdown | Pull parser implemented as a Rust library | ||
Djota | Prolog | https://github.com/aarroyoc/djota | Implementation in Prolog | ||
djoths | Haskell | https://github.com/jgm/djoths | Haskell library and command-line tool | ||
godjot | Go | https://github.com/sivukhin/godjot | Implementation in Go |