GitHub Flavored Markdown, often shortened as GFM, is the dialect of Markdown that is currently supported for user content on GitHub.com and GitHub Enterprise. This formal specification, based on the CommonMark Spec, defines the syntax and semantics of this dialect. The language uses simple text with minimal markup and can convert it to a growing number of formats. However, not all markdown parsers are created equally. Because the original spec hasn’t evolved with the times, alternate versions like Multi-Markdown, GFM (Github Flavored Markdown), Markdown Extra and others have expanded the language. GitHub Pages provides support for the following Markdown elements. GitHub Pages uses Jekyll, which uses the kramdown Markdown processor. Support for Additional Syntax Elements As an added bonus, GitHub Pages provides support for several obscure elements. You can add an optional language identifier to enable syntax highlighting in your fenced code block. For example, to syntax highlight Ruby code: ```ruby require 'redcarpet' markdown = Redcarpet.new ('Hello World!' ) puts markdown.tohtml ``` We use Linguist to perform language detection and to select third-party grammars for syntax highlighting.

  1. Github Markdown Language Support Center
  2. Github Markdown Language Support
  3. Github Markdown Language Support Tools
  4. Github Markdown Language Support Download

Markdown is a lightweight and easy-to-use syntax for styling all forms of writing on the GitHub platform.

What you will learn:

  • How the Markdown format makes styled collaborative editing easy
  • How Markdown differs from traditional formatting approaches
  • How to use Markdown to format text
  • How to leverage GitHub’s automatic Markdown rendering
  • How to apply GitHub’s unique Markdown extensions

What is Markdown?

Markdown is a way to style text on the web. You control the display of the document; formatting words as bold or italic, adding images, and creating lists are just a few of the things we can do with Markdown. Mostly, Markdown is just regular text with a few non-alphabetic characters thrown in, like # or *.

You can use Markdown most places around GitHub:

  • Comments in Issues and Pull Requests
  • Files with the .md or .markdown extension

For more information, see “Writing on GitHub” in the GitHub Help.

Examples

It's very easy to make some words bold and other words italic with Markdown. You can even link to Google!

Syntax guide

Here’s an overview of Markdown syntax that you can use anywhere on GitHub.com or in your own text files.

Headers

Emphasis

Lists

Unordered

Ordered

Images

Links

Blockquotes

Inline code

GitHub Flavored Markdown

GitHub.com uses its own version of the Markdown syntax that provides an additional set of useful features, many of which make it easier to work with content on GitHub.com.

Note that some features of GitHub Flavored Markdown are only available in the descriptions and comments of Issues and Pull Requests. These include @mentions as well as references to SHA-1 hashes, Issues, and Pull Requests. Task Lists are also available in Gist comments and in Gist Markdown files.

Syntax highlighting

Here’s an example of how you can use syntax highlighting with GitHub Flavored Markdown:

You can also simply indent your code by four spaces:

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

Task Lists

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

Would become:

Github Markdown Language Support
First HeaderSecond Header
Content from cell 1Content from cell 2
Content in the first columnContent in the second column

SHA references

Any reference to a commit’s SHA-1 hash will be automatically converted into a link to that commit on GitHub.

Issue references within a repository

Any number that refers to an Issue or Pull Request will be automatically converted into a link.

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.

Automatic linking for URLs

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

Strikethrough

Any word wrapped with two tildes (like ~~this~~) will appear crossed out.

Emoji

GitHub supports emoji!

Github markdown language support tool

To see a list of every image we support, check out the Emoji Cheat Sheet.

Last updated Jan 15, 2014

This is intended as a quick reference and showcase. For more complete info, see John Gruber's original spec and the Github-flavored Markdown info page.

This cheatsheet is specifically Markdown Here's version of Github-flavored Markdown. This differs slightly in styling and syntax from what Github uses, so what you see below might vary a little from what you get in a Markdown Here email, but it should be pretty close.

Table of Contents

Headers
Emphasis
Lists
Links
Images
Code and Syntax Highlighting
Blockquotes
Inline HTML
Horizontal Rule
Line Breaks

Github markdown language support## Headers

H2

H3

H4

H5
H6

Alternatively, for H1 and H2, an underline-ish style:

Alt-H2

## Emphasis

Github Markdown Language Support Center

Emphasis, aka italics, with asterisks or underscores.

Strong emphasis, aka bold, with asterisks or underscores.

Combined emphasis with asterisks and underscores.

## Lists
  1. First ordered list item
  2. Another item
  • Unordered sub-list.
  1. Actual numbers don't matter, just that it's a number

  2. Ordered sub-list

  3. And another item.

    Some text that should be aligned with the above item.

  • Unordered list can use asterisks
  • Or minuses
  • Or pluses
## Links

There are two ways to create links.

Or leave it empty and use the link text itself

Some text to show that the reference links can follow later.

## Images

Here's our logo (hover to see the title text):

Inline-style:

Reference-style:

## Code and Syntax Highlighting

Code blocks are part of the Markdown spec, but syntax highlighting isn't. However, many renderers -- like Github's and Markdown Here -- support syntax highlighting. Markdown Here supports highlighting for dozens of languages (and not-really-languages, like diffs and HTTP headers); to see the complete list, and how to write the language names, see the highlight.js demo page.

Inline code has back-ticks around it.

Blocks of code are either fenced by lines with three back-ticks ```, or are indented with four spaces. I recommend only using the fenced code blocks -- they're easier and only they support syntax highlighting.

(Github Wiki pages don't seem to support syntax highlighting, so the above won't be colourful (the strings are not red, for example). Try it out in a Markdown Here email or a Github Markdown README or Github Issue -- you can preview a new Issue without submitting it.)

Again, to see what languages are available for highlighting, and how to write those language names, see the highlight.js demo page.

## Blockquotes

Blockquotes are very handy in email to emulate reply text.This line is part of the same quote.

Quote break.

Github Markdown Language Support

This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can putMarkdown into a blockquote.

## Inline HTML

You can also use raw HTML in your Markdown, and it'll mostly work pretty well. Here are a couple of common examples:

Definition list
Is something people use sometimes.
Markdown in HTML
Does *not* work **very** well. Use HTML tags.
TablesAreCool
ZebraStripesArePretty
HereIsAnotherRow
## Horizontal Rule

Three or more...

Hyphens

Asterisks

Underscores

## Line Breaks

My basic recommendation for learning how line breaks work is to experiment and discover -- hit <Enter> once, then hit it twice, see what happens. You'll soon learn to get what you want. 'Markdown Toggle' is your friend.

Github Markdown Language Support Tools

Here are some things to try out:

With only a single newline, this line andthis line will be a single line.

But this one is separated by two newlines and so will be a separate paragraph.

Github Markdown Language Support Download

This line has two spaces at the end (hard for you to see, but trust me!).
So this is a separate line in the same paragraph.