← All posts

Basic Markdown Syntax

This article shows the basic Markdown syntax and format


This article offers a sample of basic Markdown syntax that can be used to power this site.

ℹ️ Note

This article is a shameful copy of the great Grav original page.

Why Markdown?

Let’s face it: Writing content for the Web is tiresome. WYSIWYG editors help alleviate this task, but they generally result in horrible code, or worse yet, ugly web pages.

Markdown is a better way to write HTML, without all the complexities and ugliness that usually accompanies it.

Some of the key benefits are:

  1. Markdown is simple to learn, with minimal extra characters, so it’s also quicker to write content.
  2. Less chance of errors when writing in Markdown.
  3. Produces valid XHTML output.
  4. Keeps the content and the visual display separate, so you cannot mess up the look of your site.
  5. Write in any text editor or Markdown application you like.
  6. Markdown is a joy to use!

John Gruber, the author of Markdown, puts it like this:

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. While Markdown’s syntax has been influenced by several existing text-to-HTML filters, the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.

John Gruber

Without further delay, let us go over the main elements of Markdown and what the resulting HTML looks like!

ℹ️ Note

🔖 Bookmark this page for easy future reference!

Headings

Headings from h2 through h6 are constructed with a # for each level:

## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading

The HTML looks like this:

<h2>h2 Heading</h2>
<h3>h3 Heading</h3>
<h4>h4 Heading</h4>
<h5>h5 Heading</h5>
<h6>h6 Heading</h6>

ℹ️ Note

To add a custom heading ID, enclose the custom ID in curly braces on the same line as the heading:

### A Great Heading {#custom-id}

The HTML looks like this:

<h3 id="custom-id">A Great Heading</h3>