Compare AsciiDoc to Markdown

The most compelling reason to choose a lightweight markup language for writing is to minimize the number of technical concepts an author must grasp in order to be immediately productive. In other words, the goal is to be able to write without friction. While that’s certainly the goal of both AsciiDoc and Markdown, and both are very approachable for newcomers, this page explores why AsciiDoc is a more suitable alternative to Markdown as your content grows and evolves.

Starting with Markdown

The most prevalent lightweight markup language is Markdown. (At least, Markdown is what you call it at first). The main advantage of Markdown lies in its primitive syntax: its manual and cheatsheet are one and the same. But this advantage is also its greatest weakness.

As soon as authors need something slightly more complex than basic prose (e.g., tables, cross references, footnotes, embedded YouTube videos, etc.), they find themselves resorting to embedded HTML or seeking out more feature-rich implementations. Markdown has become a maze of different implementations, termed “flavors”, which make a universal definition evasive.

The IETF has declared “there is no such thing as "invalid" Markdown.” See This Is Markdown! Or: Markup and Its Discontents.

Here’s how the story inevitably goes. You start out with Markdown. Then it’s Markdown + X. Then Markdown + X + Y. And down the rabbit hole you go. What’s worse, X and Y often require you to sprinkle in HTML, unnecessarily coupling content with presentation and wrecking portability. Your instinct to choose Markdown is good. There are just better options.

Graduating to AsciiDoc

AsciiDoc presents a more sound alternative. The AsciiDoc syntax is more concise than (or at least as concise as) Markdown. At the same time, AsciiDoc offers power and flexibility without requiring the use of HTML or “flavors” for essential syntax such as tables, description lists, admonitions (tips, notes, warnings, etc.) and table of contents.

It’s important to understand that AsciiDoc was initially designed as a plain-text alternative to the DocBook XML schema. AsciiDoc isn’t stuck in a game of whack-a-mole trying to satisfy publishing needs like Markdown. Rather, the AsciiDoc syntax was explicitly designed with the needs of publishing in mind, both print and web. If the need arises, you can make full use of the huge choice of tools available for a DocBook workflow using Asciidoctor’s DocBook converter. That’s why mapping to an enterprise documentation format like DocBook remains a key use case for AsciiDoc.

And yet, AsciiDoc is simple enough to stand in as a better flavor of Markdown. But what truly makes AsciiDoc the right investment is that its syntax was designed to be extended as a core feature. This extensibility not only means that AsciiDoc has a lot more to offer, with room to grow, it also fulfills the objective of ensuring your content is maximally reusable.

Comparison by example

The following table shows the AsciiDoc syntax as it compares to Markdown. Since AsciiDoc supports a broader range of syntax than Markdown, this side-by-side comparison focuses mainly on areas where the syntax overlaps.

A selection of AsciiDoc language features compared to Markdown
Language Feature Markdown AsciiDoc

Bold (constrained)

**bold**
*bold*

Bold (unconstrained)

**b**old
**b**old

Italic (constrained)

*italic*
_italic_

Italic (unconstrained)

n/a

__i__talic

Monospace (constrained)

`monospace`
`monospace`

Monospace (unconstrained)

`m`onospace
``m``onospace

Literal monospace

`http://localhost:8080`
`/issue/{id}`
`+http://localhost:8080+`
`+/issue/{id}+`

Link with label

[Asciidoctor](https://asciidoctor.org)
https://asciidoctor.org[Asciidoctor]

Relative link

[user guide](user-guide.html)
link:user-guide.html[user guide]
xref:user-guide.adoc[user guide]

File link

[get the PDF]({% raw %}{{ site.url }}{% endraw %}/assets/mydoc.pdf)
link:{site-url}/assets/mydoc.pdf[get the PDF]

Cross reference

See [Usage](#_usage).

<h2 id="_usage">Usage</h2>
See <<_usage>>.

== Usage

Block ID (aka anchor)

<h2 id="usage">Usage</h2>
[#usage]
== Usage

Inline anchor

n/a

. [[step-1]]Download the software

Inline image w/ alt text

![Logo](/images/logo.png)
image:logo.png[Logo]

Block image w/ alt text

n/a

image::logo.png[Logo]

Section heading*

## Heading 2
== Heading 2

Blockquote*

> Quoted text.
>
> Another paragraph in quote.
____
Quoted text.

Another paragraph in quote.
____

Literal block

    $ gem install asciidoctor
Example 1. Indented (by 1 or more spaces)
 $ gem install asciidoctor
Example 2. Delimited
....
$ gem install asciidoctor
....

Code block*

```java
public class Person {
  private String name;
  public Person(String name) {
    this.name = name;
  }
}
```
[source,java]
----
public class Person {
  private String name;
  public Person(String name) {
    this.name = name;
  }
}
----

Unordered list

* apples
* orange
  * temple
  * navel
* bananas
* apples
* oranges
** temple
** navel
* bananas

Ordered list

1. first
2. second
3. third
. first
. second
. third

Thematic break (aka horizontal rule)*

***

* * *

---

- - -

___

_ _ _
'''

Typographic quotes (aka “smart quotes”)

Enabled through an extension switch, but offer little control in how they are applied.

The `'90s popularized a new form of music known as "`grunge`" rock.
It'll turn out to have an impact that extended well beyond music.

Document header

Example 3. Slapped on as “front matter”
---
layout: docs
title: Writing posts
prev_section: defining-frontmatter
next_section: creating-pages
permalink: /docs/writing-posts/
---
Example 4. Native support!
= Writing posts
:page-layout: base
:showtitle:
:prev_section: defining-frontmatter
:next_section: creating-pages

Admonitions

n/a

TIP: You can add line numbers to source listings by adding the word `numbered` in the attribute list after the language name.

Sidebars

n/a

.Lightweight Markup
****
Writing languages that let you type less and express more.
****

Block titles

n/a

.Grocery list
* Milk
* Eggs
* Bread

Includes

n/a

include::intro.adoc[]

URI reference

Go to the [home page][home].

[home]: https://example.org
:home: https://example.org

Go to the {home}[home page].

Custom CSS classes

n/a

[.path]_Gemfile_

* Asciidoctor also supports the Markdown syntax for this language feature.

You can see that AsciiDoc has the following advantages over Markdown:

  • AsciiDoc uses the same number of markup characters or less when compared to Markdown in nearly all cases.

  • AsciiDoc uses a consistent formatting scheme (i.e., it has consistent patterns).

  • AsciiDoc can handle all permutations of nested inline (and block) formatting, whereas Markdown often falls down.

  • AsciiDoc handles cases that Markdown doesn’t, such as a proper approach to inner-word markup, source code blocks and block-level images.

Certain Markdown flavors, such as Markdown Extra, support additional features such as tables and description lists. However, since these features don’t appear in “plain” Markdown, they’re not included in the comparison table. But they’re supported natively by AsciiDoc.

Asciidoctor, which is used for converting AsciiDoc on GitHub and GitLab, emulates some of the common parts of the Markdown syntax, like headings, blockquotes and fenced code blocks, simplifying the migration from Markdown to AsciiDoc. For details, see Markdown compatibility.