Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents. Created by John Gruber in 2004, Markdown allows you to format text easily without using complex HTML tags.
To create a heading, add a hash (#
) symbol in front of a word or phrase.
Markdown supports six levels of headings, corresponding to <h1>
to <h6>
in
HTML.
# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6
Simply write your text on separate lines to create paragraphs.
I really like using Markdown.
I think I'll use it to format all of my documents from now on.
To create a line break, end a line with two or more spaces and press Enter
.
This is the first line.
And this is the second line.
To make text bold, wrap it with two asterisks (**
) or underscores (__
).
I just love **bold text**. I just love **bold text**.
To italicize text, wrap it with one asterisk (*
) or underscore (_
).
I just love _italic text_. I just love _italic text_.
To make text bold and italic, wrap it with three asterisks (***
) or
underscores (___
).
I just love **_bold and italic text_**. I just love **_bold and italic text_**.
To create a blockquote, add a >
in front of a paragraph.
> Dorothy followed her through many of the beautiful rooms in her castle.
To create an ordered list, preface each item with a number followed by a period.
1. First item
2. Second item
3. Third item
4. Fourth item
To create an unordered list, preface each item with a dash (-
), asterisk
(*
), or plus sign (+
).
- First item
- Second item
- Third item
- Fourth item
To create a code block, indent each line of the block by at least four spaces or one tab. Alternatively, you can use triple backticks (```) before and after the code block.
<html>
<head>
<title>Test</title>
</head>
<body>
<h1>This is a heading</h1>
</body>
</html>
To denote a word or phrase as code, wrap it with backticks (`
).
Use the `printf()` function.
To add an image, use the following syntax: ![alt text](image URL)
.
![Markdown Logo](../assets/markdown.png)
To create a horizontal rule, use three or more dashes (---
), asterisks
(***
), or underscores (___
) on a line by themselves.
---
To create a link, enclose the link text in brackets ([]
) and then enclose the
URL in parentheses (()
).
[GitHub](https://github.com/)
To create a table, use pipes (|
) to separate columns and hyphens (-
) to
create the header row.
| Syntax | Description | Test Text |
| --------- | ----------- | ------------- |
| Header | Title | Here's this |
| Paragraph | Text | And more text |
Here’s an example that combines many of these elements:
# My Project
Welcome to my project. Below is a list of features:
## Features
1. **Easy to Use**
- Simple and intuitive
2. _Fast_
- Optimized for performance
## Code Example
```html
<html>
<head>
<title>Sample Code</title>
</head>
<body>
<p>This is a sample code block.</p>
</body>
</html>
```
For more details, visit the documentation.