markdown語法

Welcome to Leanote! 歡迎來到Leanote!

1. 排版

粗體 斜體

這是一段錯誤的文本。

引用:

引用Leanote官方的話, 爲什麼要做Leanote, 原因是...

有充列表:

  1. 支持Vim
  2. 支持Emacs

無序列表:

  • 項目1
  • 項目2

2. 圖片與鏈接

圖片: leanote 鏈接:

這是去往Leanote官方博客的鏈接

3. 標題

以下是各級標題, 最多支持5級標題

# h1
## h2
### h3
#### h4
##### h4
###### h5

4. 代碼

示例:

function get(key) {
    return m[key];
}

代碼高亮示例:

/**
* nth element in the fibonacci series.
* @param n >= 0
* @return the nth element, >= 0.
*/
function fib(n) {
  var a = 1, b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}
 
document.write(fib(10));
class Employee:
   empCount = 0
 
   def __init__(self, name, salary):
        self.name = name
        self.salary = salary
        Employee.empCount += 1

5. Markdown 擴展

Markdown 擴展支持:

  • 表格
  • 定義型列表
  • Html 標籤
  • 腳註
  • todo list
  • 目錄
  • 時序圖與流程圖
  • MathJax 公式

5.1 表格

ItemValue
Computer$1600
Phone$12
Pipe$1

可以指定對齊方式, 如Item列左對齊, Value列右對齊, Qty列居中對齊

ItemValueQty
Computer$16005
Phone$1212
Pipe$1234

5.2 定義型列表

名詞 1 : 定義 1(左側有一個可見的冒號和四個不可見的空格)

代碼塊 2 : 這是代碼塊的定義(左側有一個可見的冒號和四個不可見的空格)

    代碼塊(左側有八個不可見的空格)

5.3 Html 標籤

支持在 Markdown 語法中嵌套 Html 標籤,譬如,你可以用 Html 寫一個縱跨兩行的表格:

<table>
    <tr>
        <th rowspan="2">值班人員</th>
        <th>星期一</th>
        <th>星期二</th>
        <th>星期三</th>
    </tr>
    <tr>
        <td>李強</td>
        <td>張明</td>
        <td>王平</td>
    </tr>
</table>

<table> <tr> <th rowspan="2">值班人員</th> <th>星期一</th> <th>星期二</th> <th>星期三</th> </tr> <tr> <td>李強</td> <td>張明</td> <td>王平</td> </tr> </table>

提示, 如果想對圖片的寬度和高度進行控制, 你也可以通過img標籤, 如:

<img src="http://leanote.com/images/logo/leanote_icon_blue.png" width="50px" />

5.4 腳註

Leanote[^footnote]來創建一個腳註 [^footnote]: Leanote是一款強大的開源雲筆記產品.

5.5 todo list

Leanote 近期任務安排:

  • [x] bbs 維護
  • [ ] Desktop 發佈新版
    • [x] Markdown編輯器添加Todo list
    • [x] 修復白屏問題
    • [ ] 修復issue3
  • [ ] Leanote 維護
    • [ ] 修復issue4

5.6 目錄

通過 [TOC] 在文檔中插入目錄, 如:

[TOC]

5.7 時序圖與流程圖

Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!

流程圖:

st=>start: Start
e=>end
op=>operation: My Operation
cond=>condition: Yes or No?
 
st->op->cond
cond(yes)->e
cond(no)->op

提示: 更多關於時序圖與流程圖的語法請參考:

5.8 MathJax 公式

$ 表示行內公式:

質能守恆方程可以用一個很簡潔的方程式 $E=mc^2$ 來表達。

$$ 表示整行公式:

$$\sum_{i=1}^n a_i=0$$

$$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $$

$$\sum^{j-1}{k=0}{\widehat{\gamma}{kj} z_k}$$

更復雜的公式: $$ \begin{eqnarray} \vec\nabla \times (\vec\nabla f) & = & 0 \cdots\cdots梯度場必是無旋場\ \vec\nabla \cdot(\vec\nabla \times \vec F) & = & 0\cdots\cdots旋度場必是無散場\ \vec\nabla \cdot (\vec\nabla f) & = & {\vec\nabla}^2f\ \vec\nabla \times(\vec\nabla \times \vec F) & = & \vec\nabla(\vec\nabla \cdot \vec F) - {\vec\nabla}^2 \vec F\ \end{eqnarray} $$

訪問 MathJax 參考更多使用方法。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章