Markdown

2013/03/20 Linux

Markdown is a plain text formatting syntax designed so that it can optionally be converted to HTML using a tool by the same name. Markdown is popularly used as format for readme files, or for writing messages in online discussion forums, or in text editors for the quick creation of rich text documents.0

Emacs

read Emacs Markdown Mode for more details

  1. C-c C-c m: run Mark­down on the cur­rent buffer and pre­view the out­put in an­other buffer. or you can use C-c C-c p to preview in browser.
  2. M-x html-mode: move to html-mode on this other buffer.
  3. M-x sgml-tags-invisible: hide the html tags to display something close to the output.
  4. Then every time you want to refresh the rendering, simply run again C-c C-c m on the markdown buffer.

quote

a blank line then indent every line will generate

<pre><code></code></pre>
[title](link)
![iamge](link)

Another link style which looks like foot note:

[title] [link-id]

[link-id]: link "title"

list

  1. ul: {*|+|-}
  2. ol: {\d+\.} you can escape . to avoid ol when you use “^1986. some word”.

table

markdown can generate table easily, but its native css support is too simple to meet my requirement.

table header | header 2
--- | ---
content | content 2

will reproduce the follow content:

table header header 2
content content 2

read Markdown Cheatsheet for more details.

Math

add <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default"></script> in anywhere you like, then write the math formulars. $$formular$$ or inline version \\(formular\\). For example, $$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$ will display:

\[x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\]

inline version: \(x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\)

License: (CC 3.0) BY-NC-SA

Search

    Table of Contents