# Beginner Level Markdown Tutorial

## Table of Contents
1. [Introduction to Markdown](#introduction-to-markdown)
    - [What is Markdown?](#what-is-markdown)
    - [Why Markdown?](#why-markdown)
    - [Installing a Markdown Editor](#installing-a-markdown-editor)
2. [Basic Syntax](#basic-syntax)
    - [Headings](#headings)
    - [Paragraphs](#paragraphs)
    - [Line Breaks](#line-breaks)
    - [Emphasis](#emphasis)
    - [Blockquotes](#blockquotes)
    - [Lists](#lists)
        - [Ordered Lists](#ordered-lists)
        - [Unordered Lists](#unordered-lists)
        - [Nested Lists](#nested-lists)
    - [Code](#code)
        - [Inline Code](#inline-code)
        - [Code Blocks](#code-blocks)
    - [Horizontal Rules](#horizontal-rules)
3. [Links and Images](#links-and-images)
    - [Links](#links)
        - [Inline Links](#inline-links)
        - [Reference Links](#reference-links)
        - [Automatic Links](#automatic-links)
    - [Images](#images)
4. [Tables](#tables)
5. [Advanced Markdown](#advanced-markdown)
    - [Footnotes](#footnotes)
    - [Strikethrough](#strikethrough)
    - [Task Lists](#task-lists)
6. [Markdown Best Practices](#markdown-best-practices)
    - [Keep It Simple](#keep-it-simple)
    - [Consistent Formatting](#consistent-formatting)
    - [Preview Your Markdown](#preview-your-markdown)
    - [Use Meaningful Link Text](#use-meaningful-link-text)
    - [Document Structure](#document-structure)
7. [Conclusion](#conclusion)

## Introduction to Markdown

### What is Markdown?
- Markdown is a lightweight markup language with plain text formatting syntax.
- It is designed to be easy to read and write, and it can be converted to HTML and other formats.
- Created by John Gruber in 2004, Markdown is widely used for writing documentation, README files, blog posts, and more.

### Why Markdown?
- Markdown is simple and easy to learn, making it accessible for beginners and efficient for experienced users.
- It is platform-independent and can be edited with any text editor.
- Markdown files are plain text, so they can be version-controlled with systems like Git.
- Markdown enhances readability, making it suitable for technical documentation.

### Installing a Markdown Editor
- You can use any text editor to write Markdown, but specialized Markdown editors offer additional features like live preview.
- Some popular Markdown editors include:
  - **Visual Studio Code**: A powerful code editor with Markdown support. [Download Visual Studio Code](https://code.visualstudio.com/)
  - **Typora**: A minimalistic Markdown editor with live preview. [Download Typora](https://typora.io/)
  - **Dillinger**: An online Markdown editor with cloud storage integration. [Use Dillinger Online](https://dillinger.io/)
  - **Markdown Here**: A browser extension that allows you to write Markdown in any web app. [Install Markdown Here](https://markdown-here.com/)

## Basic Syntax

### Headings
- Headings are created using the `#` symbol. The number of `#` symbols indicates the heading level.
- Headings range from level 1 (largest) to level 6 (smallest).
- Example:
    ```markdown
    # Heading 1
    ## Heading 2
    ### Heading 3
    #### Heading 4
    ##### Heading 5
    ###### Heading 6
    ```
    # Heading 1
    ## Heading 2
    ### Heading 3
    #### Heading 4
    ##### Heading 5
    ###### Heading 6

### Paragraphs
- Paragraphs are created by writing text separated by one or more blank lines.
- Example:
    ```markdown
    This is a paragraph.

    This is another paragraph.
    ```
    This is a paragraph.

    This is another paragraph.

### Line Breaks
- To create a line break (without starting a new paragraph), end a line with two or more spaces, and then type return.
- Example:
    ```markdown
    This is the first line.  
    This is the second line.
    ```
    This is the first line.  
    This is the second line.

### Emphasis
- Emphasis can be added using asterisks `*` or underscores `_`.
- To create italic text, wrap the text with one `*` or `_`.
- To create bold text, wrap the text with two `**` or `__`.
- To create bold and italic text, wrap the text with three `***` or `___`.
- Example:
    ```markdown
    *Italic* or _Italic_

    **Bold** or __Bold__

    ***Bold and Italic*** or ___Bold and Italic___
    ```
    *Italic* or _Italic_

    **Bold** or __Bold__

    ***Bold and Italic*** or ___Bold and Italic___

### Blockquotes
- Blockquotes are created using the `>` symbol. Blockquotes can be nested by adding additional `>` symbols.
- Example:
    ```markdown
    > This is a blockquote.
    > 
    > This is another line in the same blockquote.
    ```
    > This is a blockquote.
    > 
    > This is another line in the same blockquote.

- Nested Blockquote:
    ```markdown
    > This is the first level of quoting.
    > 
    >> This is nested blockquote.
    ```
    > This is the first level of quoting.
    > 
    >> This is nested blockquote.

### Lists

#### Ordered Lists
- Ordered lists use numbers followed by a period. The numbers can be in any order; Markdown will automatically number them correctly.
- Example:
    ```markdown
    1. First item
    2. Second item
    3. Third item
    ```
    1. First item
    2. Second item
    3. Third item

#### Unordered Lists
- Unordered lists use asterisks `*`, plus `+`, or minus `-`.
- Example:
    ```markdown
    * Item 1
    * Item 2
    * Item 3
    ```
    * Item 1
    * Item 2
    * Item 3

#### Nested Lists
- Lists can be nested by indenting the items. Both ordered and unordered lists can be nested.
- Example:
    ```markdown
    1. Item 1
       - Subitem 1
       - Subitem 2
    2. Item 2
    ```
    1. Item 1
       - Subitem 1
       - Subitem 2
    2. Item 2

### Code

#### Inline Code
- Inline code is created using backticks `` ` ``. This is useful for short snippets of code within a sentence.
- Example:
    ```markdown
    This is `inline code`.
    ```
    This is `inline code`.

#### Code Blocks
- Code blocks are created using triple backticks ```` ``` ```` or indenting with four spaces. This is useful for larger blocks of code.
- You can also specify the language for syntax highlighting by adding the language name after the opening backticks.
- Example:
    ````markdown
    ```python
    def hello_world():
        print("Hello, World!")
    ```
    ````
    ```python
    def hello_world():
        print("Hello, World!")
    ```

### Horizontal Rules
- Horizontal rules are created using three or more hyphens `---`, asterisks `***`, or underscores `___`. They are useful for separating sections of content.
- Example:
    ```markdown
    ---

    ***

    ___
    ```
    ---
    
    ***

    ___

## Links and Images

### Links

#### Inline Links
- Inline links are created using square brackets for the text and parentheses for the URL.
- You can also add a title, which appears as a tooltip when you hover over the link, by placing it in quotes after the URL.
- Example:
    ```markdown
    [This is a link](https://www.example.com)
    
    [This is a link with a title](https://www.example.com "Example Title")
    ```
    [This is a link](https://www.example.com)
    
    [This is a link with a title](https://www.example.com "Example Title")

#### Reference Links
- Reference links are created using square brackets for the text and a label, with the URL defined elsewhere in the document. This is useful for managing long URLs or when the same link is used multiple times.
- Example:
    ```markdown
    [This is a reference link][1]

    [1]: https://www.example.com
    ```
    [This is a reference link][1]

    [1]: https://www.example.com

#### Automatic Links
- Automatic links are created by enclosing the URL in angle brackets. This is useful for quick links without custom text.
- Example:
    ```markdown
    <https://www.example.com>
    ```
    <https://www.example.com>

### Images
- Images are created using an exclamation mark followed by square brackets for the alt text and parentheses for the URL.
- You can also add a title, which appears as a tooltip when you hover over the image, by placing it in quotes after the URL.
- Example:
    ```markdown
    ![Alt text](https://www.example.com/image.jpg)
    
    ![Alt text with title](https://www.example.com/image.jpg "Image Title")
    ```
    ![Alt text](http://www.codeforgovtech.in/wp-content/uploads/2024/01/logo.webp)
    
    ![Alt text with title](https://www.example.com/image.jpg "Image Title")

## Tables
- Tables are created using pipes `|` and hyphens `-` to define the structure. Colons `:` can be used to align columns.
- Example:
    ```markdown
    | Header 1 | Header 2 | Header 3 |
    | -------- | :------: | -------: |
    | Row 1    | Data 1   | Data 2   |
    | Row 2    | Data 3   | Data 4   |
    ```
    | Header 1 | Header 2 | Header 3 |
    | -------- | :------: | -------: |
    | Row 1    | Data 1   | Data 2   |
    | Row 2    | Data 3   | Data 4   |

## Advanced Markdown

### Footnotes
- Footnotes are created using square brackets and a caret `[^1]`. The footnote content is placed at the end of the document.
- Example:
    ```markdown
    This is a footnote reference[^1].

    [^1]: This is the footnote.
    ```
    This is a footnote reference[^1].

    [^1]: This is the footnote.

### Strikethrough
- Strikethrough text is created using double tildes `~~`. This is useful for indicating deleted text or completed tasks.
- Example:
    ```markdown
    ~~This is strikethrough text~~
    ```
    ~~This is strikethrough text~~

### Task Lists
- Task lists are created using square brackets. A checked box `[x]` indicates a completed task, and an unchecked box `[ ]` indicates a pending task.
- Example:
    ```markdown
    - [x] Task 1
    - [ ] Task 2
    - [ ] Task 3
    ```
    - [x] Task 1
    - [ ] Task 2
    - [ ] Task 3

## Tutorial you can follow for polishing your markdown concepts:
- [Markdown playground](https://dillinger.io/)
- [A2Z Makdown concepts in 10 minutes 🎥](https://www.youtube.com/watch?v=_PPWWRV6gbA&t=60s)


## Markdown Best Practices

### Keep It Simple
- Use Markdown's simplicity to your advantage. Avoid overly complex formatting. Focus on readability and clarity.

### Consistent Formatting
- Maintain consistent formatting throughout your document for better readability. Use the same style for headings, lists, links, etc.

### Preview Your Markdown
- Use a Markdown editor with live preview or an online preview tool to check how your Markdown renders. This helps in catching formatting errors and ensuring the document looks as expected.

### Use Meaningful Link Text
- Use descriptive link text to give readers a clear idea of what they are clicking on. Avoid using generic text like "click here."

### Document Structure
- Organize your document with clear headings and subheadings to make it easier to navigate. Use lists and tables to present information in a structured way.

## Conclusion

This tutorial covered the basics of Markdown, including document structure, common elements, links, images, tables, and advanced features. Markdown is a powerful and easy-to-learn language for writing formatted text. Practice using Markdown to enhance your documentation, blog posts, and other writing. Happy writing!
