Intro to Markdown

Jonathan Peake

What is Markdown?

  • Lightweight markup language for formatting elements to plain-text text documents

  • Used by GitHub in a variety of places

    • README files

    • Issues and comments

    • Discussions

    • Commit messages

Why use Markdown?

  • Lightweight - doesn’t balloon file sizes

  • Portable - makes it easy to share formatted documents across platforms

  • Adaptable - Quarto, Jupyter Notebooks, RMarkdown

  • Ubiquitous - Used across a number of websites and applications

Markdown basics

Headings

  • Created using the # symbol

  • Number of # corresponds to the level of header

Text styling

  • Bold - **bold text**

  • Italics - *italicized text*

  • Bold italics - ***bold and italicized text***

  • Superscript - superscript^2^

  • Subscript - superscript~2~

  • Strikethrough - ~~strikethrough~~

  • Code (monospace) - `code`

Code blocks

Code blocks are denoted by a series of three back-ticks:

```
x = 1 + 1
print('Hello, world!')
```
x = 1 + 1
print('Hello, world!')

You can style code chunks based on the language

``` r
x = 1 + 1
print('Hello, world!')
```
x = 1 + 1
print('Hello, world!')

Lists

Ordered lists

Number or letter followed by period and two spaces

  1. first
  2. second

Unordered lists

Dash or asterisk followed by a space

  • Unordered list item
  • Unordered list item

Checklists

Special markdown for GitHub

Dash followed by a space, closed brackets ([]), and another space

- [] Checklist 1

- [] Checklist 2