Tuesday, 31 March 2026

Markdown formatting

Markdown is a lightweight markup language that allows you to add formatting elements to plaintext documents. It was designed to be easy to read and easy to write, eventually converting into structurally valid HTML.

Think of it as the "shorthand" of the internet—perfect for README files, forum posts, and documentation.


Common Markdown Syntax

Here are the most frequently used special characters and how they transform your text:

1. Headers

Use the hash symbol (#) followed by a space. The number of hashes determines the size.

  • # Heading 1 (Equivalent to <h1>)

  • ## Heading 2 (Equivalent to <h2>)

  • ### Heading 3 (Equivalent to <h3>)

2. Emphasis

To draw attention to specific words:

  • Bold: Wrap text in double asterisks **word** or underscores __word__.

  • Italics: Wrap text in single asterisks *word* or underscores _word_.

  • ~~Strikethrough~~: Wrap text in double tildes ~~word~~.

3. Lists

Organizing data is straightforward:

  • Unordered Lists: Use a dash -, plus +, or asterisk *.

  • Ordered Lists: Use numbers followed by a period 1., 2., etc.

  • Task Lists: Use - [ ] for incomplete and - [x] for complete tasks.

4. Links and Images

The syntax for these is very similar:

  • Links: [Display Text](URL)

  • Images: ![Alt Text](ImageURL)

5. Blockquotes and Code

  • Quotes: Use the "greater than" sign >.

  • Inline Code: Use backticks `code`.

  • Code Blocks: Use triple backticks ( ``` ) on lines above and below the code.


Markdown Formatting Table

FeatureSyntaxResult
Bold**Text**Text
Italic*Text*Text
Link[Google](https://google.com)Google
Horizontal Rule---(A thin dividing line)

Comprehensive Example

If you were to write the following in a .md file:

Markdown
# My Travel Blog

Welcome to my site! Here are my **top three** favorite cities:
1. Tokyo
2. Paris
3. New York

> "Travel is the only thing you buy that makes you richer."

### Gear List
* Camera (DSLR)
* Comfortable shoes
* [Map App](https://maps.google.com)

Check out my code for the weather widget:
`print("Hello, Traveler!")`

The Resulting Render:

My Travel Blog

Welcome to my site! Here are my top three favorite cities:

  1. Tokyo

  2. Paris

  3. New York

"Travel is the only thing you buy that makes you richer."

Gear List

  • Camera (DSLR)

  • Comfortable shoes

  • Map App

Check out my code for the weather widget:

print("Hello, Traveler!")

No comments:

Post a Comment