Jan 28, 2026

What is Markdown?

Lightweight markup language for formatting plain text

  • Easy to read in raw form
  • Converts to HTML (hyper-text markup language), (also PDF, Word, etc.)
  • Used everywhere: GitHub, Stack Overflow, Slack, Notion…

File extension: .md

Conceptual Leap: Writing as coding

Markdown Basics: Text

Input:

Plain text

*italic* or _italic_

**bold** or __bold__

***bold italic***

~~strikethrough~~

Output:

Plain text

italic or italic

bold or bold

bold italic

strikethrough

Markdown Basics: Headers

Input:

# Header 1
## Header 2
### Header 3
#### Header 4

Output:

Header 1

Header 2

Header 3

Header 4

Markdown Basics: Lists

Input:

- item one
- item two
  - nested item

1. first
2. second
3. third

Output:

  • item one
  • item two
    • nested item
  1. first
  2. second
  3. third

Markdown Basics: Links & Images

Markdown Basics: Code

Input:

Inline: `mean(x)`

Block:
```
x <- c(1, 2, 3)
mean(x)
```

Output:

Inline: mean(x)

Block:

x <- c(1, 2, 3)
mean(x)

Markdown → HTML → Rendered

Raw Markdown:

## My Section

- first item
- second item
- **bold** text

HTML:

<h2>My Section</h2>

<ul>
  <li>first item</li>
  <li>second item</li>
  <li><strong>bold</strong> 
      text</li>
</ul>

Rendered:

My Section

  • first item
  • second item
  • bold text

What is R Markdown?

Markdown: static formatting

R Markdown: dynamic documents

  • Text + code + output in one file
  • Reproducible research
  • File extension: .Rmd

Pieces are:

  1. YAML header
  2. Markdown text
  3. R chunks (& output)
title: my report
author: me
date: today
output: html_document

Some text

```{r}
mean(1:1000)
```