Skip to the content.

Hacktoberfest 2021

image

Markdown

Why use Markdown?

Basics of Markdown

Syntax highlighted code block

# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6


- Bulleted
- List

1. Numbered
2. List

**Bold** and _Italic_ and `Code` text

[Link](url) and ![Image](src)

Headings

All Markdown files should contain headers. You need a level 1 header for the title of your Markdown file, and at least level 2 headers for the subheadings within the body text. Headings make your text more readable and help to break up the topics.

In Markdown, headings are formatted with hashes (#) in front of the line containing your heading. You can use up to six hashes, with the number of hashes corresponding to a heading level.

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

Your text will look like this:

Heading level 1

Heading level 2

Heading level 3

Heading level 4

Heading level 5
Heading level 6

Paragraphs

When writing your Markdown body text, you’ll likely want to split your information up into paragraphs (with a noticeable gap between each paragraph). Paragraphs are divided by a blank line (a line containing no characters) between consecutive paragraphs.

Your text will look like this:

Paragraph 1

Paragraph 2


Line breaks

Sometimes, you’ll want to split your information up by inserting a new line, with less space than you’d get from formatting as a paragraph. This is called a line break.

To insert a line break into your Markdown file, finish your line with at least two spaces and press return. This will render a new line for your text.

Your text will look like this:

Line 1
Line 2


Formatting text in Markdown

To format the text, follow these rules:


- For italics, wrap the item with one star on each side: *one star on each side*.
- For bold text, wrap the item with two stars on each side: **two stars on each side**.
- For striking through text in GitHub Markdown, wrap the item in two tildes: ~~strikethrough~~.
- For links, wrap link text in brackets [ ], and then wrap the URL in parentheses ( ): [This text links to Markdown](https://sushreesatarupa.github.io/Markdown/).

Emphasis

When writing your content in Markdown, you might want to place a bit more emphasis on certain words or phrases. The first way you can emphasise your text is in italics.

You can make your text italic by wrapping your text with one asterisk on each side (alternatively, you can use underscores in place of the asterisks). Once your application detects the second asterisk, your formatting for this element is considered “closed”.

Your text will look like this:

Bold formatting provides a slightly heavier emphasis than italics, but it works in exactly the same way. This time, use two asterisks to wrap the text you want to make bold (alternatively, you can use underscores in place of asterisks).

Your text will look like this:

If you really want to make a point, you can make your text simultaneously bold and italic to give it even more weight! To make your text bold and italic, use three asterisks (or three underscores) to wrap your word or phrase.

Your text will look like this:

*This text is italic*
_This text is also italic_

**This text is bold**
__This text is also bold__

***This text is italic and bold.***
___This text is also italic and bold___


Note that if you want to link to a local file, within the same server as your other Markdown files, you can format your link with a forward slash followed by the relative URL. Your text will look like this: This is link text


Images

![image](https://user-images.githubusercontent.com/64991656/132938832-0394a87c-fb2d-4d7d-b478-d1b7c474df80.png)

The image will look like this:
image


When your Markdown file is rendered to HTML, the image will be embedded directly into the body text.


Lists

Unordered lists

It’s up to you to choose which symbol you prefer. The result you get is the same.

- Just add a dash first and then write a text.
- If you add another dash in the following line, you will have another item in the list.
  - If you add four spaces or use a tab key, you will create an indented list.
    - If you need to insert an indented list within an intended one, just press a tab key again.
 
 Sometimes you want bullet points:

* Start a line with a star
* Profit!

The formatted text will look like this:

Sometimes you want bullet points:

Ordered lists

1. Just type a number followed by a dot.
2. If you want to add a second item, just type in another number followed by a dot.
1. If you make a mistake when typing numbers, fear not, Markdown will correct it for you.
    1. If you press a tab key or type four spaces, you will get an indented list and the numbering
    will start from scratch.
        1. If you want to insert an indented numbered list within an existing indented numbered one,
        just press the tab key again.
            - If need be, you can also add an indented unordered list within an indented numbered one, an vice versa,
            by pressing a tab key and typing a dash.

The formatted text will look like this:

  1. Just type a number followed by a dot.
  2. If you want to add a second item, just type in another number followed by a dot.
  3. If you make a mistake when typing numbers, fear not, Markdown will correct it for you.
    1. If you press a tab key or type four spaces, you will get an indented list and the numbering will start from scratch.
      1. If you want to insert an indented numbered list within an existing indented numbered one, just press the tab key again.
        • If need be, you can also add an indented unordered list within an indented numbered one, an vice versa, by pressing a tab key and typing a dash.

Blockquotes

Sometimes in Markdown, we will want to reference an external source using quotation marks. This is called a blockquote. You represent any blockquote by preceding the first line of the block quote with a greater-than sign or angle bracket (>). Gruber recommends inserting the angle bracket before every line of your blockquote.

Your text will look like this:

This is a blockquote

This is a blockquote

This is a blockquote

Horizontal rules

A horizontal rule is a useful little element that you can use to visually split up blocks of text within your Markdown file. A horizontal rule is represented by three or more hyphens (-), asterisks (*), or underscores (_). Whichever symbol you use renders the same output.

Your text will look like this: —


Create a horizontal rule with three or more hyphens, asterisks, or underscores on a line:
---

* * *

___

The formatted text will look like this:




Code blocks and snippets

Code snippets

`This is a code snippet`

Your text will look like this: This is a code snippet

Code blocks

There are many different ways to style code with GitHub’s markdown. If you have inline code blocks, wrap them in backticks: var example = true.

`var example = true`

If you’ve got a longer block of code, you can indent with four spaces:

if (isAwesome){
  return true
}

GitHub also supports something called code fencing, which allows for multiple lines without indentation:
image

if (isAwesome){
  return true
}

And if you’d like to use syntax highlighting, include the language:
image

if (isAwesome){
  return true
}

Escaping

Your text should look like this: *

You can escape any of these characters:

\ backslash
` backtick
* asterisk
_ underscore
{} curly braces
[] square brackets
() parentheses
# hash symbol
+ plus sign
– minus sign (hyphen)
. dot
! exclamation mark

Lists within blockquotes


HTML

-This formatting also works for your other Markdown syntax, such as emphasis. Instead of This element is bold, you could format it in HTML as This element is bold.

Instead of **This element is bold**, you could format it in HTML as <bold>This element is bold</bold>.

Quotes

—Tara Reid, actress ```

The quote will look like this:

“I make Jessica Simpson look like a rock scientist.”

—Tara Reid, actress


GitHub Flavored Markdown

Syntax highlighting

function fancyAlert(arg) {
  if(arg) {
    $.facebox({div:'#foo'})
  }
}

def foo(): if not bar: return True

Task Lists

- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [ ] this is an incomplete item

Tables

Username @mentions

Automatic linking for URLs

Any URL (like http://www.github.com/) will be automatically converted into a clickable link.

Emoji

GitHub supports emoji!

Need help to insert emojis? Check out these resources!

image


Some Sample README


Resources for Help


Contributors