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:
- Familiarity with Markdown
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.
- This is a list item.
- 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 readers
{ width=200 height=131 align=left }
Tables | are | also | supported | and | will | overflow | cleanly | if | needed |
---|---|---|---|---|---|---|---|---|---|
col 1 | col 2 | col 3 | col 4 | col 5 | col 6 | col 7 | col 8 | col 9 | col 10 |
col 1 | col 2 | col 3 | col 4 | col 5 | col 6 | col 7 | col 8 | col 9 | col 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_numbersconst test = 'hello';const other = 'world';console.log(test, other);
commandsudo apt-get updatesudo apt-get install python3
super_useradduser sammyshutdown
custom_prefixFLUSH 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 consoleconsole.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 https://twitter.com/MattIPv4/status/1576415168426573825 dark 400]
[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.