Markdown

Markdown Notes

2024/02/03

Markdown is an easy way to format text. I use it often to write documentation and blog posts. These are just a few notes to myself about Markdown.

Sections

ATX Style Header

Lines starting with one to six hash symbols are translated to headers. One hash (#) will become <h1>, two will become <h2>, and so on:

So the following lines

# Heading 1 

## Heading 2

### Heading 3

Will look like:

Heading 1

Heading 2

Heading 3

Setext-Style headers

Lines followed by a line of equal (=) signs become <h1> headers.
Lines followed by a line of minus (-) signs become <h2> headers.

These lines

H1 Header use =
================
H2 header use -
----------------

Will look like:

H1 Header use =

H2 header use -

Paragraphs

Paragraphs are consecutive lines of text separated by one or more blank lines.

So a block like this

Lorem ipsum dolor sit amet, consectetur adipiscing 
elit, sed do eiusmod tempor incididunt ut labore et 
dolore magna aliqua. Ut enim ad minim veniam, 
quis nostrud exercitation ullamco
 laboris nisi ut aliquip ex ea commodo consequat.
 Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla 
pariatur. Excepteur sint occaecat cupidatat
 non proident, sunt in culpa qui officia deserunt mollit 
anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing 
elit,  sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim
 veniam, quis nostrud exercitation ullamco
 laboris nisi ut aliquip ex ea commodo consequat. 
Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla 
pariatur. Excepteur sint occaecat cupidatat
 non proident, sunt in culpa qui officia deserunt 
mollit anim id est laborum.

Will look like:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Emphasis

You can easily add italics and boldface text with markdown.

Italics

Text can be italicized by surrounding it with a single asterisks (*) or underscores (_).

This text has *italics* for _emphasis_

Will look like:

This text has italics for emphasis

Bold Text

Bold text is similar to italics, but you surround the text with two asterisks (**) or two underscores (__).

This text has **bold** for __emphasis__

Will look like:

This text has bold for emphasis

Combined Text Styles

You can combine italics and bold text

*italics* and __bold__ can be *__combined__*
_italics_ and **bold** can be _**combined**_

Will look like:

italics and bold can be combined italics and bold can be combined

Strikethrough

Surround text with double tildes (~~) to create strikethrough text.

This text has ~~strikethrough~~

Will look like.

This text has strikethrough

Lists

Unordered Lists <ul>

Unordered lists are easy. You start consecutive lines with *, +, or - chars. The chars get translated into <li>

So these three lines

* One
* Two
* Three

look like:

  • One
  • Two
  • Three

You can nest lists within lists by preceding the line with spaces

* English
  * One
  * Two
  * Three
* Tagalog
  * Isa
  * Dalawa
  * Tatlo

looks like:

  • English
    • One
    • Two
    • Three
  • Tagalog
    • Isa
    • Dalawa
    • Tatlo

Numeric Lists

Ordered lists are made up of consecutive lines started with a number. Note: the actual number used at the start of the lines is irrelevant. The list will be properly ordered.

1. One
1. Two ( The 1. will become a 2. )
3. Three

looks like:

  1. One
  2. Two
  3. Three

Numeric lists can also be nested by indenting the sub-list lines.

1. Step 1
2. Step 2
    1. Substep 1
    2. Substep 2
3. Step 3

looks like:

  1. Step 1
  2. Step 2
    1. Substep 1
    2. Substep 2
  3. Step 3

Combining Ordered and Unordered Lists

You can combine ordered and unordered lists like this

1.  Line Number One
* Bullet A
* Bullet B
2. Line Number Two
* Bullet C
3. Line Number Three
* Bullet D

The combined lists look like:

  1. Line Number One
  • Bullet A
  • Bullet B
  1. Line Number Two
  • Bullet C
  1. Line Number Three
  • Bullet D

Source Code

Much of my documentation has code examples in it. Markdown is able to handle inline code and separate code in its own block. ## Inline Source

Create inline code by surrounding your text with a single back-tick(`)

The following inline example

You can have `inline code` in your text by surrounding it with back-ticks.

If you need to show a back-tick (\`) use the \\ to escape it

Looks like:

You can have inline code in your text by surrounding it with back-ticks

If you need to show a back-tick (`) use the \ to escape it

Block Quotes

Block quotes use the email indent format. Start lines that you want to quote with a greater than (>) symbol.

These quoted lines

> This set of lines are
> in Block Quotes
>
> as are these

Will look like:

This set of lines are in Block Quotes

as are these

You can have multiple levels of indentation in block quotes by increasing the number of greater than symbols.

>  First level of block quotes with *emphasis*
>> Nested quote with
>> * Unordered
>> * List
>> * Items
> and back again.

looks like:

First level of block quotes with emphasis > Nested quote with > * Unordered > * List > * Items and back again.

Hyperlinks in Markdown are brackets containing the link description followed by parentheses containing the link. So a link to Markdown would be coded as

[Markdown](https://daringfireball.net/projects/markdown/) 

and looks like

Markdown

Images

Images can be embedded in text with by preceding a link to an image with an exclamation point (!)

![Alternative Text](https://d2f0zrmol3qj3h.cloudfront.net/467d8879-ab21-48c6-9578-c8e5d181eac2-thumb-8camera_mount.png)

Looks like:

Alternative Text  

Giving an image with alt text set to “Alternative Text”

About Me

Greg Gallardo

I'm a software developer and sys-admin living in the US. I code with C++, C#, Java, Swift, Python, JavaScript and TypeScript. I also maintain Windows and Linux systems on-site and Linode, AWS and Azure

Github

Mastodon

YouTube

About you

IP Address: 34.239.154.201

User Agent: CCBot/2.0 (https://commoncrawl.org/faq/)

Language: en-US,en;q=0.5

Latest Posts