Skip to content

Instantly share code, notes, and snippets.

@lotsofcode
Created March 5, 2013 17:32
Show Gist options
  • Select an option

  • Save lotsofcode/5092167 to your computer and use it in GitHub Desktop.

Select an option

Save lotsofcode/5092167 to your computer and use it in GitHub Desktop.
Markdown Template

Sample Markdown Cheat Sheet

This is a sample markdown file to help you write Markdown quickly :)

If you use the fabulous Sublime Text 2 editor along with the Markdown Preview plugin, open your ST2 Palette with CMD+P then choose Markdown Preview in browser to see the result in your browser.

Text basics

this is italic and this is bold . another italic and another bold

this is important text.

Indentation

Here is some indented text

event more indented

Titles

Big title (h1)

Middle title (h2)

Smaller title (h3)

and so on (hX)

and so on (hX)
and so on (hX)

Example lists (1)

  • bullets can be -, +, or *

  • bullet list 1

  • bullet list 2

    • sub item 1

    • sub item 2

      with indented text inside

  • bullet list 3

  • bullet list 4
  • bullet list 5

Links

This is an example inline link and another one with a title.

Links can also be reference based : reference 1 or reference 2 with title.

References are usually placed at the bottom of the document

Images

A sample image :

revolunet logo

As links, images can also use references instead of inline links :

revolunet logo

Code

Its quite easy to show code in markdown files.

Backticks can be used to highlight some words.

Also, any indented block is considered a code block.

<script>
    document.location = 'http://lmgtfy.com/?q=markdown+cheat+sheet';
</script>

GitHub Flavored Markdown

If you use the Github parser, you can use some of Github Flavored Markdown syntax :

Some Python code :

import random

class CardGame(object):
    """ a sample python class """
    NB_CARDS = 32
    def __init__(self, cards=5):
        self.cards = random.sample(range(self.NB_CARDS), 5)
        print 'ready to play'

Some Javascript code :

var config = {
    duration: 5,
    comment: 'WTF'
}
// callbacks beauty un action
async_call('/path/to/api', function(json) {
    another_call(json, function(result2) {
        another_another_call(result2, function(result3) {
            another_another_another_call(result3, function(result4) {
                alert('And if all went well, i got my result :)');
            });
        });
    });
})

About

This plugin and this sample file is proudly brought to you by the revolunet team

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