Markdown Syntax Guide

This document explains how to write and format text using Markdown. The examples below show the syntax and how it renders, so you can use this guide as both a reference and a learning tool.


Table of Contents


Introduction

Markdown is a lightweight markup language that lets you format plain text. It’s used for everything from README files to documentation. In this guide, you’ll learn how to create headings, paragraphs, lists, and much more.


Headings

Create headings by prefixing text with one or more hash (#) characters. The number of hashes indicates the level of the heading.

Example:

# Heading 1

## Heading 2

### Heading 3

Rendered:

First Level Heading

Second Level Heading

Third Level Heading


Paragraphs and Line Breaks

Separate paragraphs with one or more blank lines.

Example:

This is the first paragraph.

This is the second paragraph.

To create a line break within a paragraph, end a line with two or more spaces and then press Enter.

Example:

This is the first line.  
This is the second line.

Emphasis

You can emphasize text using asterisks or underscores.

  • Italic: Wrap text in one asterisk or underscore.

    _This text is italic_ or _this text is italic_
    
  • Bold: Wrap text in two asterisks or underscores.

    **This text is bold** or **this text is bold**
    
  • Bold and Italic: Wrap text in three asterisks or underscores.

    **_This text is bold and italic_**
    
  • Strikethrough: Wrap text in two tildes.

    ~~This text is struck through~~
    

Blockquotes

Create blockquotes by starting a line with the greater-than sign (>).

Example:

> This is a blockquote.
>
> It can span multiple paragraphs.

Rendered:

This is a blockquote.

It can span multiple paragraphs.


Lists

Ordered Lists

Start each item with a number and a period.

Example:

1. First item
2. Second item
3. Third item

Note: Numbers don’t have to be sequential in the Markdown source—Markdown will render them in order.

Unordered Lists

Start each item with a dash (-), asterisk (*), or plus (+).

Example:

- Item one
- Item two
- Item three

Code

Inline Code

Wrap inline code with backticks (`).

Example:

Use the `printf()` function.

Rendered as:
Use the printf() function.

Code Blocks

For longer code snippets, use fenced code blocks by wrapping your code in three backticks.

Example:

def greet(name):
    print(f"Hello, {name}!")

Rendered as:

def greet(name):
    print(f"Hello, {name}!")

Horizontal Rules

Insert a horizontal rule by using three or more dashes, asterisks, or underscores on a line by themselves.

Example:

---

Create links with square brackets and parentheses.

Example:

[Visit GitHub](https://github.com "GitHub Homepage")

Rendered as:
Visit GitHub

Define the link separately and refer to it.

Example:

[GitHub][1]

[1]: https://github.com "GitHub Homepage"

Images

Embed images by prefixing the link with an exclamation mark.

Example:

![Alt text](https://via.placeholder.com/150 "Image Title")

Rendered as an image.


Tables

You can create tables using pipes and hyphens.

Example:

| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |

Rendered as:

Syntax Description
Header Title
Paragraph Text

Escaping Special Characters

If you need to display a character that is part of the Markdown syntax, prefix it with a backslash (\).

Example:

\# This is not a heading, but literal text.

Rendered as:
# This is not a heading, but literal text.


Extended Syntax

Markdown processors may support extra features such as:

  • Tables: (see above)
  • Footnotes:

    Here is a sentence with a footnote.[^1]
    
    [^1]: This is the footnote text.
    
  • Task Lists: ```markdown
    • Completed task
    • Incomplete task ```
  • Strikethrough: (shown above)

Note: Support for extended features may vary depending on your Markdown processor.


Conclusion

This guide has covered the basics of Markdown syntax—from headings and paragraphs to links, images, and code blocks. Use this file as a reference in your projects and feel free to update it as you learn more.

Happy writing in Markdown!


End of Markdown Syntax Guide