Skip to content

Latest commit

 

History

History
349 lines (290 loc) · 11 KB

markdown.md

File metadata and controls

349 lines (290 loc) · 11 KB

Beginner Level Markdown Tutorial

Table of Contents

  1. Introduction to Markdown
  2. Basic Syntax
  3. Links and Images
  4. Tables
  5. Advanced Markdown
  6. Markdown Best Practices
  7. 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:

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:
    # 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:

    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:
    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:

    *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:

    > 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:

    > 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:
    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:
    * 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:
    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:
    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:
    ```python
    def hello_world():
        print("Hello, World!")
    ```
    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:
    ---
    
    ***
    
    ___



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:

    [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

    This is a link with a 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:
    [This is a reference link][1]
    
    [1]: https://www.example.com
    This is a reference link

Automatic Links

  • Automatic links are created by enclosing the URL in angle brackets. This is useful for quick links without custom text.
  • Example:
    <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:

    ![Alt text](https://www.example.com/image.jpg)
    
    ![Alt text with title](https://www.example.com/image.jpg "Image Title")

    Alt text

    Alt text with title

Tables

  • Tables are created using pipes | and hyphens - to define the structure. Colons : can be used to align columns.
  • Example:
    | 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:

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

    This is a footnote reference1.

Strikethrough

  • Strikethrough text is created using double tildes ~~. This is useful for indicating deleted text or completed tasks.
  • Example:
    ~~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:
    - [x] Task 1
    - [ ] Task 2
    - [ ] Task 3
    • Task 1
    • Task 2
    • Task 3

Tutorial you can follow for polishing your markdown concepts:

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!

Footnotes

  1. This is the footnote.