Markdown Showcase

This post uses every element the theme supports, so you can check how each one looks in one place. It doubles as a reference for the syntax.

Text

Regular paragraph text with bold, italic, bold italic, inline code, and a link to the Hugo docs.

Extended syntax, enabled in hugo.toml: highlighted, inserted, deleted, H2O, and E = mc2.

Shortcodes for other inline elements: press Ctrl + C to copy. The program prints Build finished. Solve for x. As described in The Pragmatic Programmer.

A long unbroken string, to check wrapping: https://example.com/a/very/long/url/that/keeps/going/and/going/without/any/spaces/at/all


Headings

Hover a heading to see its anchor link.

The post title is the only level 1 heading, so posts use three levels: ## for sections (like “Headings” above), ### for subsections and #### for minor headings. Levels 5 and 6 look the same as level 4.

Heading level 3

Heading level 4

Heading level 5 (styled like level 4)

Heading with a custom anchor

This heading’s link is #custom-anchor instead of one generated from its text. Jump to it.

Blockquotes

Somewhere, something incredible is waiting to be known.

Carl Sagan

A longer quote can span several paragraphs and keep inline formatting:

Programs must be written for people to read, and only incidentally for machines to execute.

The paragraph break above is part of the quote. Links like this one work too.

Quotes can contain lists, for example when quoting a checklist:

Before opening a pull request:

Lists

Unordered, with nesting:

Ordered:

  1. Install Hugo
  2. Run hugo server
  3. Open http://localhost:1313/

Task list:

Definition list:

Hugo
A static site generator written in Go.
Goldmark
The Markdown parser Hugo uses.

Code

A fenced block with syntax highlighting:

package main

import "fmt"

func main() {
	fmt.Println("Hello, world")
}

A shell session:

hugo new content posts/my-post.md
hugo server -D

A very long line, to check horizontal scrolling:

const message = "This line is intentionally long so the code block has to scroll sideways instead of stretching the page";

A block without a language:

Plain preformatted text.
    Whitespace is preserved.

Tables

A Markdown table with column alignment:

FeatureSyntaxDefault
Bold**text**Yes
Highlight==text==No
Subscript~text~No
Superscript^text^No

A wide table, to check horizontal scrolling:

Column 1Column 2Column 3Column 4Column 5Column 6Column 7Column 8Column 9
ValueValueValueValueValueValueValueValueValue
ValueValueValueValueValueValueValueValueValue

A table built from a data file with the table shortcode. It supports a caption and a footer, which Markdown tables can’t do:

Table Caption
Table Heading 1Table Heading 2Table Heading 3Table Heading 4Table Heading 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Footer 1Table Footer 2Table Footer 3Table Footer 4Table Footer 5

Images

A plain Markdown image with a title (hover it):

A landscape

The same image through the figure shortcode, with a caption:

A landscape

A caption under the image

Footnotes

Footnotes are collected at the end of the post.1 Each one links back to where it was referenced.2


  1. This is the first footnote. ↩︎

  2. Footnote labels can be words as well as numbers. ↩︎

Tags: