1. 程式人生 > >Typora系列之Quick Start-Markdown Reference

Typora系列之Quick Start-Markdown Reference

        最近發現了 Markdown 這種從來沒有接觸過的寫作方式,看起來很厲害的樣子。於是用了一個週末的時間研究了好幾個 Markdown 寫作軟體,如Markdown 2,Yu writer,Typora等,綜合對比 Typora 最符合我的口味,該軟體目前還在內測階段,有Mac,Windows 和 Linux 版本。

Typora 官網 -> https://typora.io/

Typora 官方文件 -> https://support.typora.io/

        下面的程式碼是根據 Markdown Reference 學習的原始碼,由於 CSDN 的 Markdown 與 Typora 有所出入,所以此處就不貼出 Typora-learning.md 檔案,感興趣的童鞋可以到博主 GitHub 目錄下檢視/下載相應資料:

        https://github.com/fhqfghgdx/Markdown-Learning

        小白上路,大神輕噴!^_^

[TOC]

# Block Elements

## Paragraph and line breaks

一個段落只是一個或多個連續的文字行。在Markdown原始碼中,段落由多個空行分隔。在Typora中,您只需按回車即可建立一個新段落。

按下Shift + Enter 可建立一個換行符。但是,大多數markdown解析器會忽略單行換行,讓其他markdown解析器識別您的換行符,您可以在行末留出兩個空格,或者插入<br/>

## Headers

建立一級到六級標題

```markdown
# 標題1
## 標題2
...
###### 標題6
```

快捷鍵:

![標題快捷鍵](E:\OneDrive\GitHub\Markdown-Learning\Picture\標題快捷鍵.png)



## Blockquotes

使用 '>' 符號

```markdown
> This is a blockquote with two paragraphs. This is first paragraph.
```

> This is a blockquote with two paragraphs. This is first paragraph.
>
> This is second pragraph.Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> This is another blockquote with one paragraph. There is three empty line to seperate two blockquote.
>
> 在引用中再次引用
>
> > 二級引用第一段
> >
> > 二級引用第二段
> >
> > > 三級引用第一段
> > >
> > > ...

原始碼:

```markdown
> This is a blockquote with two paragraphs. This is first paragraph.
>
> This is second pragraph.Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> This is another blockquote with one paragraph. There is three empty line to seperate two blockquote.
>
> 在引用中再次引用
>
> > 二級引用第一段
> >
> > 二級引用第二段
> >
> > > 三級引用第一段
> > >
> > > ...
```



## Lists

無序列表:使用 '*','+','-'

有序列表:使用 '1.','2.',...

### un-ordered list

+ Red
  + Green
    + Block
  + Yellow
    + Blue

原始碼:

```markdown
+ Red
  + Green
    + Block
  + Yellow
    + Blue
```

**注: 快捷鍵 Ctrl + / 切換檢視為原始碼模式**



### ordered list

1. Red
   1. Green
      1. Block
   2. Yellow
      1. Blue

原始碼:

```markdown
1. Red
   1. Green
      1. Block
   2. Yellow
      1. Blue
```



## Task list

建立任務列表形式的條目

- [x] A task list item
- [ ] list syntax required
  - [ ] normal **formatting** , @mentions, #1234 refs
  - [x] incomplete
  - [ ] complete

原始碼:

```markdown
- [x] A task list item
- [ ] list syntax required
  - [ ] normal **formatting** , @mentions, #1234 refs
  - [x] incomplete
  - [ ] complete
```



## (Fenced) Code Blocks

Typora 僅支援 GitHub 格式的程式碼塊,而不支援 Markdown 原始程式碼塊的格式。

使用 Fence 建立程式碼塊:使用連續的三個 '```',Typora 將把其之後的行解析成程式碼塊。

```markdown
Code block line 1
```

設定程式碼塊語言:'```Python'

```python
import Serial
...
```



## Math Blocks

建立公式:兩個連續的 '$$'

Input `$$`, then press ‘Return’ key will trigger an input field which accept *Tex/LaTex* source.  
$$
\mathbf{V}_1 \times \mathbf{V}_2 =  \begin{vmatrix} 
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} &  \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} &  \frac{\partial Y}{\partial v} & 0 \\
\end{vmatrix}
$$

原始碼:

```markdown
$$
\mathbf{V}_1 \times \mathbf{V}_2 =  \begin{vmatrix} 
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} &  \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} &  \frac{\partial Y}{\partial v} & 0 \\
\end{vmatrix}
$$
```



## Tables

Input `| First Header  | Second Header |` and press `return` key will create a table with two column. 

### 使用原始碼格式建立表格:

切換到Markdown原始碼檢視輸入下面的程式碼塊

```markdown
| Left-Aligned  | Center Aligned  | Right Aligned |
| :------------ |:---------------:| -----:|
| col 3 is      | some wordy text | $1600 |
| col 2 is      | centered        |   $12 |
| zebra stripes | are neat        |    $1 |
```

再切換回標準檢視可以看到如下表格

| Left-Aligned  | Center Aligned  | Right Aligned |
| :------------ |:---------------:| -----:|
| col 3 is      | some wordy text | $1600 |
| col 2 is      | centered        |   $12 |
| zebra stripes | are neat        |    $1 |

### 使用 Typora 快速建立表格

**快捷鍵:Ctrl + T**,可以快速設定對齊方式,而不是使用 ':' 與 '-' 結合的方法

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



## Footnotes

You can create footnates like this[^1] and that[^2] .

[^1]: Here is the *this* of the **footnote**
[^2]: Here is the *that* of the **footnote**

原始碼:

```markdown
You can create footnates like this[^1] and that[^2] .

[^1]: Here is the *this* of the **footnote**
[^2]: Here is the *that* of the **footnote**
```



## Horizontal Rules

建立水平分割線:'***' 或 '---'

例如:

***

---

原始碼:

```
***

---
```



## YAML Front Matters

Typora support [YAML Front Matters](https://jekyllrb.com/docs/frontmatter/) now. Input `---` at the top of the article and then press `Enter` will introduce one. Or insert one metadata block from the menu. 

**注:快捷鍵 Ctrl + Shift + L 隱藏/顯示側邊欄**



## Table of Contents(TOC)

輸入 '[toc]' 按 enter 鍵會生成本文件的目錄

**切換到原始碼模式,可以看到本文在開頭添加了 `[TOC]`,用於生成本文的目錄結構,且隨著文章修改而自動更新**



# Span Element

## Links

Markdown 支援兩種型別的 links: inline 和 reference

兩種模式的連結名稱都使用 [] 包含

This is [an example](https://www.baidu.com "百度一下") inline link.
[This link](https://www.baidu.com) has no title attribute.

原始碼:

```markdown
This is [an example](https://www.baidu.com "百度一下") inline link.
[This link](https://www.baidu.com) has no title attribute.
```

### Internal Links(內部引用)

Command(on Windows: Ctrl) + Click [This link](https://support.typora.io/Markdown-Reference/#block-elements) will jump to header `Block Elements`. To see how to write that, please move cursor or click that link with `⌘` key pressed to expand the element into markdown source. 

### Reference Links

可以先建立一個連線,[] 中的內容用一個“變數”代替,然後在本文章的任意位置均可以對該“變數”進行賦值,設定其網址和標題,如下:

This is [an example][id] reference-style link.

Then, anywhere in the document, you define your link label like this, on a line by itself:

[id]: http://example.com/  "Optional Title Here"

原始碼:

```markdown
This is [an example][id] reference-style link.

Then, anywhere in the document, you define your link label like this, on a line by itself:

[id]: http://example.com/  "Optional Title Here"
```

也可以將中括號內空出來,僅使用連線名稱作為“變數”去賦值:

[Baidu][]

And then difine the link:

[Baidu]:http://www.baidu.com/

原始碼:

```markdown
[Google][]
And then define the link:
[Google]:http://google.com
```



## URLs

Typora 可以插入 URLs 作為連結,由 <> 包含

`<
[email protected]
>` becomes [[email protected]](mailto:[email protected]). `<baidu>`的地址是:www.baidu.com ## Images ### 快捷鍵 Ctrl + Shift + I 手動編輯 `![xxx](//path)`或使用快捷鍵 Ctrl + Shift + I ![藍色經典](E:\OneDrive\GitHub\Markdown-Learning\Picture\藍色經典.jpg) 原始碼: ```markdown ![藍色經典](E:\OneDrive\GitHub\Markdown-Learning\Picture\藍色經典.jpg) ``` ### 直接將圖片拖進文章 此方式將自動地建立圖片的連結資訊 ![wallhaven-133008](E:\OneDrive\GitHub\Markdown-Learning\Picture\wallhaven-133008.jpg) 原始碼: ```markdown ![wallhaven-133008](E:\OneDrive\GitHub\Markdown-Learning\Picture\wallhaven-133008.jpg) ``` ## Emphasis 設定斜體突出顯示,快捷鍵:Ctrl + I,或手輸 `*xxx*` 或 `_xxxx_` *single asterisks* _single underscores_ 原始碼: ```markdown *single asterisks* _single underscores_ ``` **注:若需要使用`*`等特殊符號作為文字顯示,則需要使用`\`對其進行轉義** ## Strong 設定粗體突出顯示,快捷鍵:Ctrl + B,或手輸`**xxxx**` ## Code `` `符號用於程式碼引用 **注:在行內的程式碼塊引用使用兩個`` ` 包含文字,如:** ```markdown `code` ``code`` ``` ## Strikethrough 為文字新增刪除線,使用`Shift` + `` `鍵,在文字兩端新增 '~~' 符號 `Mistaken text.` becomes ~~Mistaken text~~ 原始碼: ```markdown `Mistaken text.` becomes ~~Mistaken text~~ ``` ## Underlines 為文字新增下劃線:`<u>xxx</u>` `<u>Underline</u>` becomes <u>Underline</u>. 原始碼: ```markdown `<u>Underline</u>` becomes <u>Underline</u>. ``` ## Emoji:happy: `smile` -> :smile: `satified`-> :satisfied: ...... 原始碼: ```markdown `smile` -> :smile: `satified`-> :satisfied: ``` **以下功能需要開啟 Markdown 擴充套件功能,在 Typora 中設定路徑:** **檔案->偏好設定->Markdown擴充套件語法->全部勾選** ![Markdown擴充套件語法](E:\OneDrive\GitHub\Markdown-Learning\Picture\Markdown 擴充套件語法.png) ## Inline Math $\lim_{x \to \infty} \exp(-x) = 0$ 原始碼: ``` $\lim_{x \to \infty} \exp(-x) = 0$ ``` ## Subscript 下標設定:使用`~`包含下標文字 H~2~O X~long~ 原始碼: ```markdown H~2~O X~long~ ``` ## Superscript 上標設定:使用`^`包含上標文字 X^2^ 原始碼: ```markdown X^2^ ``` ## Highlight 高亮設定:使用`==`包含高亮文字 Here is the *test* of ==footnote.== 原始碼: ```markdown Here is the *test* of ==footnote.== ```

相關推薦

Typora系列Quick Start-Markdown Reference

        最近發現了 Markdown 這種從來沒有接觸過的寫作方式,看起來很厲害的樣子。於是用了一個週末的時間研究了好幾個 Markdown 寫作軟體,如Markdown 2,Yu writer,Typora等,綜合對比 Typora 最符合我的口味,該軟體目前還在內

caffe日常坑系列:undefined reference to symbol '_ZN2cv6String10deallocateEv'

iss ren and tor ssi symbols str mis locate 在使用caffe庫編譯C++時出現的 解決如下: /usr/bin/ld: /tmp/ccA5JGRP.o: undefined reference to symbol ‘_ZN2cv

Quick start Solr 安裝指南(一)

align yum 文件夾 CP 基礎 成功 引擎 全文搜索 回車 Solr簡介 1. 企業站內搜索技術選型在一些大型門戶網站、電子商務網站等都需要站內搜索功能,使用傳統的數據庫查詢方式實現搜索無法滿足一些高級的搜索需求,比如:搜索速度要快、搜索結果按相關度排序、搜索內容

quick-cocos2d-x 學習系列十三 觸控

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

quick-cocos2d-x 學習系列十四 測試用例

quick-cocos2d-x 學習系列之十四 測試用例                   定義變數,建立13個場景名字 &nbs

Spark文件閱讀二:Programming Guides - Quick Start

Quick Start: https://spark.apache.org/docs/latest/quick-start.html   在Spark 2.0之前,Spark的程式設計介面為RDD (Resilient Distributed Dataset)。而在2.0之後,RDDs被D

提升HTML5的性能體驗系列五 webview啟動速度優化及事件順序解析

執行時間 很快 runt 代碼 模式 本地 技術 apk loaded webview加載時有5個事件。觸發順序為loading、titleUpdate、rendering、rendered、loaded。webview開始載入頁面時觸發loading,載入過程中如果&am

opensslBIO系列22---Cipher類型的BIO

能夠 lte net 操作 適應 signed tar sign 論壇 Cipher類型BIO ---依據openssl doc\crypto\bio_f_cipher.pod翻譯和自己的理解寫成 (作者:DragonKing, Mail: [email

opensslBIO系列12---文件描寫敘述符(fd)類型BIO

scrip 所在 pri 返回 div static 實現 論壇 res 文件描寫敘述符(fd)類型BIO ---依據openssl doc\crypto\bio_s_fd.pod翻譯和自己的理解寫成 (作者:DragonKing [email 

5Python全棧系列IO多路復用

技術 多線程 課程 網絡連接 write Python全棧之路系列之IO多路復用What is IO Multiplexing?IO多路復用是指內核一旦發現進程指定的一個或者多個IO條件準備讀取,它就通知該進程。舉例說明你是一名老師(線程),上課了(啟動線程),這節課是自習課,學生都在自習

5Python全棧系列算法

import 英語 臺灣 空間 元素 ython全棧之路系列之算法一個算法的優劣可以用空間復雜度與時間復雜度來衡量。冒泡排序冒泡排序(英語:Bubble Sort,臺灣另外一種譯名為:泡沫排序)是一種簡單的排序算法。它重復地走訪過要排序的數列,一次比較兩個元素,如果他們的順序錯誤就把他們交

1Python全棧系列Django初體驗

編寫程序 online 網絡開發 程序員 堪薩斯 Python全棧之路系列之Django初體驗Django不得不說在Python中是一個非常強大的全棧框架,而且入門也比較簡單,只要你學完了基本的Django知識,接著再做一兩個項目,不大不小就成,然後你再去學其它的框架你會發現,在那些小而美

2Python全棧系列Tornado的Cookie與Sess

requestPython全棧之路系列之Tornado的Cookie與Sess主要的代碼結構為:#!/usr/bin/env python # _*_coding:utf-8 _*_ import tornado.ioloop import tornado.web class MainHandler(to

5Python全棧系列Django模型續

模型續Python全棧之路系列之Django模型續連表操作一對一在app的models.py文件內添加以下內容用戶創建一對多關系的表:from django.db import models # Create your models here. class UserType(models.Model):

2Python全棧系列Django路由與視圖

request 配置文件 hello 文章 Python全棧之路系列之Django路由與視圖路由說白了就是與視圖(函數)的對應關系,怎麽說呢,一個路由對應一個視圖,比如上面文章中所提到的那樣,當打開/users/路徑的時候會讓users這個函數來進行邏輯處理,把處理的結果再返回到前端。那麽dj

1Python標準庫系列模塊介紹

requestPython標準庫系列之模塊介紹Python的模塊其實就是封裝了一個或者多個功能的代碼集合,以便於重用,模塊可以是一個文件也可以是一個目錄,目錄的形式稱作包。模塊分類內置模塊內置模塊可以理解成當你安裝好python環境之後,直接可以使用import導入的就是內置模塊,默認模塊路徑為:C:\Pyt

Irrlicht 3D Engine 筆記系列 教程4 - Movement

its pointer released 動畫 could cal 延遲 代碼 ren 作者: i_dovelemon 日期: 2014 / 12 / 16 來源: CSDN 主題: Event Receiver, Animator, Framerate indepen

Android開發系列SQLite

分組 ets ket where pla 情況 流行 database which 上篇博客提到過SQLite。它是嵌入式數據庫,因為其輕巧但功能強大,被廣泛的用於嵌入式設備其中。後來在智能手機、平板流行之後,它作為文件型數據庫,差點兒成為了智能設備單機數據庫的必選,能夠

R語言數據分析系列

r語 來看 tab barplot code 繪制 ber map lib R語言數據分析系列之五 —— by comaple.zhang 本節來討論一下R語言的基本圖形展示,先來看一張效果圖吧。 這是一張用R語言生成的,虛擬的wordcloud雲圖,詳細

Git 系列tag的用法---為你的代碼標記版本號

嘗試 自動生成 tag lib 去掉 現在 blank title checkout 版權聲明:本文為博主原創文章,未經博主允許不得轉載。 目錄(?)[-] 本地倉庫操作 遠程倉庫操作 其他 tag 操作 在做app開發的時候經常有版本的概念,比如v1