1. 程式人生 > 其它 >Markdown語法簡介

Markdown語法簡介

技術標籤:Markdowntyporamarkdowntypora

文章目錄

Markdown語法簡介

原理: markdown實際上是把這些標籤最後轉化為html標籤

Markdown 的目標是實現「易讀易寫」.

可讀性, 無論如何, 都是最重要的. 一份使用 Markdown 格式撰寫的檔案應該可以直接以純文字釋出, 並且看起來不會像是由許多標籤或是格式指令所構成. Markdown 語法受到一些既有 text-to-HTML 格式的影響, 包括 Setext、atx、Textile、reStructuredText、Grutatext 和 EtText, 而最大靈感來源其實是純文字電子郵件

的格式。

0.參考

1.標題

  • #[n] 標題 => n級標題(html: h1-h6)

2.列表

  • 無序列表: * 列表內容(*±) => (html: ul>li)
  • 有序列表: 1. 列表內容 => (html: ol>li)
  • 任務列表:
    • 待辦事項
    • 完成事項

3.區塊引用

  • 引用內容 => (html: blockquote)

4.華麗分割線

  • *** (*-_至少3個)

5.連結

6.圖片

  • 行內式: img
  • 引數式:

    image

7.註釋

The HTML specification is maintained by the W3C

.

8.程式碼框

  • 單行: <p>code</p>
  • 多行:
    <p>code</p>
    

9.表格

  • 必須有至少一個-, 多個時中間不允許有空格; 預設左對齊, :與-之間不允許有空格;
    head1head2head3head4
    r1c1r1c2r1c3r1c4
    r2c1r2c2r2c3r2c41

10.強調

  • 字型傾斜:
    • 傾斜
    • 傾斜
  • 字型加粗:
    • 加粗
    • 加粗
  • 傾斜加粗:
    • 斜粗
    • 斜粗
  • 字型高亮:
    • highlight

11. 上標/下標

上標: X2
下標: H2O

12.刪除線

  • 請刪掉我吧

13.轉義

  • \
  • `
  • *
  • _
  • -
  • +
  • .
  • !
  • #
  • {
  • }
  • [
  • ]

14. 註腳

You can create footnotes like this1

and this2.

15. Table of Contents (TOC)

Enter [toc] and press the Return key to create a “Table of Contents” section. The TOC extracts all headers from the document, and its contents are updated automatically as you add to the document.

編輯器

Typora


  1. Here is the text of the first footnote. ↩︎ ↩︎

  2. footnote ↩︎