Skip to content

Instantly share code, notes, and snippets.

@promisepreston
Last active December 9, 2019 15:55
Show Gist options
  • Save promisepreston/35e283bc3d0b1c2d4ae75be33b52666d to your computer and use it in GitHub Desktop.
Save promisepreston/35e283bc3d0b1c2d4ae75be33b52666d to your computer and use it in GitHub Desktop.
My Personal Cheat Sheet for Markdown

Markdown Cheat Sheet

Headers

H1

H2

H3

H4

H5
H6

Emphasis

Emphasis, aka italics, uses asterisks or underscores.

Strong emphasis, aka bold, uses asterisks or underscores.

Combined emphasis uses asterisks and underscores.

Strikethrough uses two tildes. Scratch this.

Lists

Unordered

  • Item 1
  • Item 2
    • Item 2a
    • Item 2b

Ordered

  1. Item 1
  2. Item 2
  3. Item 3
    1. Item 3a
    2. Item 3b

Images

If you want to embed images, this is how you do it: GitHub Logo

Format: Alt Text

Links

http://github.com - automatic! GitHub

Blockquotes

As Kanye West said:

We're living the future so the present is our past.

Inline code

I think you should use an <addr> element here instead.

Block code

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

You can also simply indent your code by four spaces:

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

Here’s an example of Python code without syntax highlighting:

def foo(): if not bar: return True

Task Lists

  • @mentions, #refs, links, formatting, and tags supported
  • list syntax required (any unordered or ordered list supported)
  • this is a complete item
  • this is an incomplete item

If you include a task list in the first comment of an Issue, you will get a handy progress indicator in your issue list. It also works in Pull Requests!

Tables

You can create tables by assembling a list of words and dividing them with hyphens - (for the first row), and then separating each column with a pipe |:

First Header Second Header
Content from cell 1 Content from cell 2
Content in the first column Content in the second column

Username @mentions

Typing an @ symbol, followed by a username, will notify that person to come and view the comment. This is called an “@mention”, because you’re mentioning the individual. You can also @mention teams within an organization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment