Mastering Markdown: A Comprehensive Guide

Published on 4/11/2025 â€ĸ Categories: markdown, tutorial, writing

Mastering Markdown: A Comprehensive Guide

Introduction

This is some placeholder text to show examples of Markdown formatting.
We have a full article template you can use when writing a DigitalOcean article.
Please refer to our style and formatting guidelines for more detailed explanations: https://do.co/style

Prerequisites

Before you begin this guide you'll need the following:

Step 1 — Basic Markdown

This is italics, this is bold, this is underline, and this is strikethrough.

  • This is a list item.
  • This list is unordered.
  1. This is a list item.
  2. This list is ordered.

This is a quote.

This is a quote inside a quote.

  • This is a list in a quote.
  • Another item in the quote list.

Alt text for screen readersAlt text for screen readers

{ width=200 height=131 align=left }


Tablesarealsosupportedandwilloverflowcleanlyifneeded
col 1col 2col 3col 4col 5col 6col 7col 8col 9col 10
col 1col 2col 3col 4col 5col 6col 7col 8col 9col 10

Step 2 — Code

This is inline code. This is a <^>variable<^>. This is an in-line code <^>variable<^>. You can also have code in links.

nginx
[label /etc/nginx/sites-available/default]
server {
listen 80 <^>default_server<^>;
. . .
}
line_numbers
const test = 'hello';
const other = 'world';
console.log(test, other);
command
sudo apt-get update
sudo apt-get install python3
super_user
adduser sammy
shutdown
custom_prefix
FLUSH PRIVILEGES;
SELECT * FROM articles;
command
[environment local]
ssh root@server_ip
line_numbers
[environment second]
[label index.html]
<html>
<body>
<head>
<title><^>My Title<^></title>
</head>
<body>
. . .
</body>
</html>

Step 3 — Callouts

<$>[note] Note: Use this for notes on a publication. <$>

<$>[warning] Warning: Use this to warn users. <$>

<$>[info] Info: Use this for product information. <$>

<$>[draft] Draft: Use this for notes in a draft publication. <$>

<$>[note] [label Labels support inline markdown] Note: Use this for notes on a publication. <$>

Step 4 — Layout

[column Content inside a column is regular Markdown block content.

Any block or inline syntax can be used, including quotes. ]

[column Two or more columns adjacent to each other are needed to create a column layout.

On desktop the columns will be evenly distributed in a single row, on tablets they will wrap naturally, and on mobile they will be in a single stack. ]

[details Content can be hidden using details. Inside the details block you can use any block or inline syntax.

js
// Write a message to console
console.log('Hello, world!');

]

Step 5 — Embeds

YouTube

[youtube iom_nhYQIYk 225 400]

Vimeo

[vimeo https://player.vimeo.com/video/329272793 225 400]

DNS

[dns digitalocean.com A AAAA]

CodePen

[codepen MattCowley vwPzeX dark css 384]

Glitch

[glitch hello-digitalocean 512]

Can I Use

[caniuse css-grid]

Asciinema

[asciinema 239367 50 20]

Twitter

[twitter https://twitter.com/MattIPv4/status/1576415168426573825 dark 400]

Instagram

[instagram https://www.instagram.com/p/CkQuv3_LRgS 400 caption]

Slideshow

[slideshow https://assets.digitalocean.com/banners/python.png https://assets.digitalocean.com/banners/javascript.png https://assets.digitalocean.com/banners/nodejs.png]

Image Compare

[compare https://assets.digitalocean.com/banners/python.png https://assets.digitalocean.com/banners/javascript.png]

Conclusion

Please refer to our writing guidelines for more detailed explanations on our style and formatting.