Normal Text
Some Links:
Link 1 |
Link 2 |
Link 3
Normal text
In Python
import json
import requests
text = 'my markdown text'
url = 'https://api.github.com/markdown'
data = {'text': text, 'mode': 'gfm'}
data = json.dumps(data, ensure_ascii=False).encode('utf-8')
headers = {'content-type': 'application/json; charset=UTF-8'}
auth = ('', '')
r = requests.post(url, headers=headers, data=data, auth=auth)
r.raise_for_status()
r.encoding = 'utf-8'
markdown_html = r.text
print markdown_html
Get the style sheet from GitHub:
https://www.npmjs.com/package/github-markdown-css
In HTML and use the stylesheet:
<link rel="stylesheet" href="github-markdown.css">
<div class="markdown-body" style="padding-left: 20px; padding-right: 20px;">
{% autoescape off %}
{{ markdown_html }}
{% endautoescape %}
</div>
https://guides.github.com/features/mastering-markdown/
This text will be italic
This will also be italic
This text will be bold
This will also be bold
You can combine them
http://github.com - automatic!
GitHub
As Kanye West said:
We're living the future so
the present is our past.
I think you should use an
<addr>
element here instead.
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'})
}
}
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'})
}
}
def foo():
if not bar:
return True
First Header | Second Header |
---|---|
Content from cell 1 | Content from cell 2 |
Content in the first column | Content in the second column |
16c999e8c71134401a78d4d46435517b2271d6ac
mojombo@16c999e8c71134401a78d4d46435517b2271d6ac
mojombo/github-flavored-markdown@16c999e
#1
mojombo#1
mojombo/github-flavored-markdown#1
@mention
@octocat
It's very easy to make some words bold and other words italic with Markdown. You can even link to Google!
Sometimes you want numbered lists:
Sometimes you want bullet points:
Alternatively,
If you want to embed images, this is how you do it:
Sometimes it's useful to have different levels of headings to structure your documents. Start lines with a #
to create headings. Multiple ##
in a row denote smaller heading sizes.
You can use one #
all the way up to ######
six for different heading sizes.
If you'd like to quote someone, use the > character before the line:
Coffee. The finest organic suspension ever devised... I beat the Borg with it.
- Captain Janeway
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
. 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:
if (isAwesome){
return true
}
And if you'd like to use syntax highlighting, include the language:
if (isAwesome){
return true
}
GitHub supports many extras in Markdown that help you reference and link to people. If you ever want to direct a comment at someone, you can prefix their name with an @ symbol: Hey @kneath — love your sweater!
But I have to admit, tasks lists are my favorite:
When you include a task list in the first comment of an Issue, you will see a helpful progress bar in your list of issues. It works in Pull Requests, too!
And, of course emoji!
@octocat
https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md