31 October 2013

如同HTML/XML/SGML/TeX一样,Markdown 同样是一种 Markup Language(标记语言)。只不过,Markdown 是更轻量级的、对书写和阅读更友好的标记语言

常用语法

  1. 空一行分段
  2. 行末加两个或多个空格才是真正的换行
  3. >等同于blockquote
  4. #这是 H1,## 这是 H2,###### 这是 H6
  5. *强调*等同于<em>强调</em>
  6. _强调_等同于<em>强调</em>
  7. **加粗**等同于<strong>加粗</strong>
  8. __加粗__等同于<strong>加粗</strong>
  9. ~~无效内容~~
  10. 代码区块,缩进 4 个空格或是 1 个制表符
  11. 如果要在文字前后直接插入普通的星号或底线,你可以用反斜线
  12. 如果要标记一小段行内代码,你可以用反引号把它包起来 `

链接

This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute. #####自动连接
<http://example.com/> ####图片
![Alt text](/path/to/img.jpg)
![Alt text](/path/to/img.jpg "Optional title")

Sublime Text Markdown插件

####1.MarkdownEditing

从视觉和便捷性上针对 Markdown 文档的编辑进行了一系列的优化

Keymap for Windows and Linux. Most of them are similar with the keymap on Mac OS X.

  • Ctrl + Win + V will paste the contents of the clipboard as an inline link on selected text
  • Ctrl + Win + R will paste the contents of the clipboard as a reference link
  • Ctrl + Win + K inserts a standard inline link, Shift + Win + K inserts an inline image
  • Alt + Win + B and Alt + Win + I are bound to bold and italics (Markdown).
  • Ctrl + 1 through Ctrl + 6 will add the corresponding number of hashmarks for headlines. Works on blank lines and selected text * in tandem with the above headline tools. If you select an entire existing headline, the current hashmarks will be removed and * replaced with the header level you requested. This command now respects the “match_header_hashes” preference setting.
  • Ctrl + ⇧6 will insert a footnote and jump to its definition. If your cursor is in a definition, it will jump back to the marker.
  • 2.Markdown Preview

    快速生成HTML文件或者在浏览器中预览

use cmd+shift+P then Markdown Preview to show the follow commands:

  • Markdown Preview: Python Markdown: Preview in Browser
  • Markdown Preview: Python Markdown: Export HTML in Sublime Text
  • Markdown Preview: Python Markdown: Copy to Clipboard
  • Markdown Preview: Github Flavored Markdown: Preview in Browser
  • Markdown Preview: Github Flavored Markdown: Export HTML in Sublime Text
  • Markdown Preview: Github Flavored Markdown: Copy to Clipboard
  • Markdown Preview: Open Markdown Cheat sheet

也可以绑定快捷键 { “keys”: [“alt+m”], “command”: “markdown_preview”, “args”: {“target”: “browser”, “parser”:”markdown”}

Just use Ctrl+B (Windows/Linux) or cmd+B (Mac) to build current file