无标题文章

Sample Markdown Cheat Sheet


===========================



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



If you use the fabulous [Sublime Text 2/3 editor][ST] along with the [Markdown Preview plugin][MarkdownPreview], 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. and percentage signs : % and `%`



This is a paragraph with a footnote (builtin parser only). [^note-id]



Insert `[ TOC ]` without spaces to generate a table of contents (builtin parsers only).



## Indentation


> Here is some indented text


>> even 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](http://lmgtfy.com/) and [another one with a title](http://lmgtfy.com/ "Hello, world").



Links can also be reference based : [reference 1][ref1] or [reference 2 with title][ref2].



References are usually placed at the bottom of the document



## Images



A sample image :



![revolunet logo](http://www.revolunet.com/static/parisjs8/img/logo-revolunet-carre.jpg "revolunet logo")



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



![revolunet logo][revolunet-logo]




## Code



It's 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.  If `enable_highlight` is `true`, syntax highlighting will be included (for the builtin parser - the github parser does this automatically).



    <script>


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


    </script>



## Math



When `enable_mathjax` is `true`, inline math can be included \\(\frac{\pi}{2}\\) $\pi$



Alternatively, math can be written on its own line:



$$F(\omega) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} f(t) \, e^{ - i \omega t}dt$$



\\[\int_0^1 f(t) \mathrm{d}t\\]



\\[\sum_j \gamma_j^2/d_j\\]





## GitHub Flavored Markdown



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



 * User/Project@SHA: revolunet/sublimetext-markdown-preview@7da61badeda468b5019869d11000307e07e07401


 * User/Project#Issue: revolunet/sublimetext-markdown-preview#1


 * User : @revolunet



Some Python code :



```python


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 :



```js


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 :)');


            });


        });


    });


})


```



The Github Markdown also brings some [nice Emoji support][emoji] : :+1: :heart: :beer:



[^note-id]: This is the text of the note.



## Parsers and Extensions



Markdown Preview comes with **Python-Markdown** preloaded.



### *Python-Markdown*



The [Python-Markdown Parser][] provides support for several extensions.



[Python-Markdown Parser]: https://github.com/waylan/Python-Markdown



#### Extra Extensions



* `abbr` -- [Abbreviations][]


* `attr_list` -- [Attribute Lists][]


* `def_list` -- [Definition Lists][]


* `fenced_code` -- [Fenced Code Blocks][]


* `footnotes` -- [Footnotes][]


* `tables` -- [Tables][]


* `smart_strong` -- [Smart Strong][]



[Abbreviations]: http://pythonhosted.org/Markdown/extensions/abbreviations.html


[Attribute Lists]: http://pythonhosted.org/Markdown/extensions/attr_list.html


[Definition Lists]: http://pythonhosted.org/Markdown/extensions/definition_lists.html


[Fenced Code Blocks]: http://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html


[Footnotes]: http://pythonhosted.org/Markdown/extensions/footnotes.html


[Tables]: http://pythonhosted.org/Markdown/extensions/tables.html


[Smart Strong]: http://pythonhosted.org/Markdown/extensions/smart_strong.html




You can enable them all at once using the `extra` keyword.



    extensions: [ 'extra' ]



If you want all the extras plus the `toc` extension,


your settings would look like this:



    {


        ...


        parser: 'markdown',


        extensions: ['extra', 'toc'],


        ...


    }




#### Other Extensions



There are also some extensions that are not included in Markdown Extra


but come in the standard Python-Markdown library.



* `code-hilite` -- [CodeHilite][]


* `html-tidy` -- [HTML Tidy][]


* `header-id` -- [HeaderId][]


* `meta_data` -- [Meta-Data][]


* `nl2br` -- [New Line to Break][]


* `rss` -- [RSS][]


* `sane_lists` -- [Sane Lists][]


* `smarty` -- [Smarty][]


* `toc` -- [Table of Contents][]


* `wikilinks` -- [WikiLinks][]



[CodeHilite]:  http://pythonhosted.org/Markdown/extensions/code_hilite.html


[HTML Tidy]:  http://pythonhosted.org/Markdown/extensions/html_tidy.html


[HeaderId]:  http://pythonhosted.org/Markdown/extensions/header_id.html


[Meta-Data]:  http://pythonhosted.org/Markdown/extensions/meta_data.html


[New Line to Break]:  http://pythonhosted.org/Markdown/extensions/nl2br.html


[RSS]:  http://pythonhosted.org/Markdown/extensions/rss.html


[Sane Lists]:  http://pythonhosted.org/Markdown/extensions/sane_lists.html


[Table of Contents]:  http://pythonhosted.org/Markdown/extensions/toc.html


[WikiLinks]:  http://pythonhosted.org/Markdown/extensions/wikilinks.html


[Smarty]: https://pythonhosted.org/Markdown/extensions/smarty.html



#### 3rd Party Extensions



*Python-Markdown* is designed to be extended.



Some included ones are:



* `delete` -- github style delte support via `~~word~~`


* `githubemoji` --  github emoji support


* `tasklist` -- github style tasklists


* `magiclink` -- github style auto link conversion of http|ftp links


* `headeranchor` -- github style header anchor links


* `github` -- Adds the above extensions in one shot


* `b64` -- convert and embed local images to base64.  Setup by adding this `b64(base_path=${BASE_PATH})`



There are also a number of others available:



Just fork this repo and add your extensions inside the `.../Packages/Markdown Preview/markdown/extensions/` folder.



Check out the list of [3rd Party extensions](


https://github.com/waylan/Python-Markdown/wiki/Third-Party-Extensions).




#### Default Extensions



The default extensions are:



* `footnotes` -- [Footnotes]


* `toc` -- [Table of Contents]


* `fenced_code` -- [Fenced Code Blocks]


* `tables` -- [Tables]



Use the `default` keyword, to select them all.


If you want all the defaults plus the `definition_lists` extension,


your settings would look like this:



    {


        ...


        parser: 'markdown',


        extensions: ['default', 'definition_lists'],


        ...


    }



## Examples



### Tables



The `tables` extension of the *Python-Markdown* parser is activated by default,


but is currently **not** available in *Markdown2*.



The syntax was adopted from the [php markdown project](http://michelf.ca/projects/php-markdown/extra/#table),


and is also used in github flavoured markdown.



| Year | Temperature (low) | Temperature (high) |  


| ---- | ----------------- | -------------------|  


| 1900 |               -10 |                 25 |  


| 1910 |               -15 |                 30 |  


| 1920 |               -10 |                 32 |  




### Wiki Tables



If you are using *Markdown2* with the `wiki-tables` extra activated you should see a table below:



|| *Year* || *Temperature (low)* || *Temperature (high)* ||  


||   1900 ||                 -10 ||                   25 ||  


||   1910 ||                 -15 ||                   30 ||  


||   1920 ||                 -10 ||                   32 ||  




### Definition Lists



This example requires *Python Markdown*'s `def_list` extension.



Apple


:   Pomaceous fruit of plants of the genus Malus in


    the family Rosaceae.



Orange


:   The fruit of an evergreen tree of the genus Citrus.




## About



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



 [ref1]: http://revolunet.com


 [ref2]: http://revolunet.com "rich web apps"


 [MarkdownREF]: http://daringfireball.net/projects/markdown/basics


 [MarkdownPreview]: https://github.com/revolunet/sublimetext-markdown-preview


 [ST]: http://sublimetext.com


 [revolunet]: http://revolunet.com


 [revolunet-logo]: http://www.revolunet.com/static/parisjs8/img/logo-revolunet-carre.jpg "revolunet logo"


 [gfm]: http://github.github.com/github-flavored-markdown/


 [emoji]: http://www.emoji-cheat-sheet.com/



最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 160,165评论 4 364
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,720评论 1 298
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,849评论 0 244
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,245评论 0 213
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,596评论 3 288
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,747评论 1 222
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,977评论 2 315
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,708评论 0 204
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,448评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,657评论 2 249
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,141评论 1 261
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,493评论 3 258
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,153评论 3 238
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,108评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,890评论 0 198
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,799评论 2 277
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,685评论 2 272

推荐阅读更多精彩内容

  • chenwei980阅读 152评论 0 1
  • 不经意的遇见那是缘分,装作陌生的两个人那叫错过。游荡在每一条街道上,拥挤在不同的公交车里,哼唱着各种曲风的调子。一...
    Ailyt阅读 221评论 0 1
  • 每日壁纸路径,复制出来就可以 /data/data/com.google.android.apps.wallpap...
    o知否知否阅读 1,605评论 0 0
  • 我要讲彩票故事,我要吸引更多同频的人关注彩票,关注彩票的公益性,我要为彩票正名。 那么,我的故事,从什么时候开始讲...
    王小暖LOTTERY阅读 480评论 2 3
  • 很多同学的PS4设备要联网玩线上游戏,延迟很高。PS4自身不能安装加速器,如果通过其他办法,又纠结是用梯子加速还是...
    猴哥哥阅读 20,656评论 2 5