Skip to content

Latest commit

 

History

History
229 lines (162 loc) · 3.46 KB

Markdown.md

File metadata and controls

229 lines (162 loc) · 3.46 KB
# Markdown Tutorial

Markdown is a lightweight and easy-to-use syntax for styling text. It’s commonly used for documentation, blogging, and writing in code repositories like GitHub. Here's a comprehensive tutorial.

---

Basic Structure and Syntax of Markdown

1. Headings

Use the # symbol to create headings. The number of # determines the level of the heading (1 to 6 levels).

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

Output:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

2. Emphasis (Bold and Italic)

  • Bold: Use ** or __ to bold text.
  • Italic: Use * or _ to italicize text.
  • Bold and Italic: Combine both.
**Bold Text**
*Italic Text*
***Bold and Italic Text***

Output:

Bold Text
Italic Text
Bold and Italic Text


3. Lists

a) Ordered Lists:

Use numbers followed by a period for ordered lists.

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

b) Unordered Lists:

Use -, +, or * for unordered lists.

- Item 1
- Item 2
  - Sub-item 2.1
  - Sub-item 2.2
- Item 3

Output:

  1. First item
  2. Second item
  3. Third item
  • Item 1
  • Item 2
    • Sub-item 2.1
    • Sub-item 2.2
  • Item 3

4. Links

Create links using the syntax [link text](URL).

[Visit Google](https://www.google.com)

Output:

Visit Google


5. Images

Insert images using the syntax ![alt text](image URL).

![Markdown Logo](https://markdown-here.com/img/icon256.png)

Output:

Markdown Logo


6. Code and Code Blocks

a) Inline Code:

Use backticks ` for inline code.

Use `git status` to check the status.

b) Code Block:

Use triple backticks or tildes for multi-line code blocks. Specify the language for syntax highlighting.

```go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

### Output:
```go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

7. Tables

Create tables using | and -.

| Name    | Age | Country |
|---------|-----|---------|
| Alice   | 25  | USA     |
| Bob     | 30  | UK      |
| Charlie | 22  | Canada  |

Output:

Name Age Country
Alice 25 USA
Bob 30 UK
Charlie 22 Canada

8. Blockquotes

Use > for blockquotes.

> This is a blockquote.
> You can write multiple lines.

Output:

This is a blockquote.
You can write multiple lines.


9. Horizontal Rule

Use ---, ***, or ___ for horizontal rules.

---

Output:



10. Task Lists

Create task lists using - [ ] for unchecked and - [x] for checked items.

- [x] Task 1
- [ ] Task 2
- [ ] Task 3

Output:

  • Task 1
  • Task 2
  • Task 3

11. HTML in Markdown

You can also use HTML tags in Markdown.

<p style="color: red;">This is a red text.</p>

Output:

This is a red text.


Markdown is a powerful and easy tool for documentation. With this tutorial, you can format your content effectively.