說明文件
Introduction
歡迎來到 ghostwriter!這個快速參考指南會提供以 Markdown 寫作的範例。Markdown 是由 John Gruber 所發明的純文字標記格式。更多資訊請參考 John Gruber 的網站:http://www.daringfireball.net。
ghostwriter has built-in support for the cmark-gfm processor. However, it also can auto-detect Pandoc, MultiMarkdown, or cmark processors. Simply install any of these processors and ensure that their installation locations are added to your system's PATH
environment variable. ghostwriter will auto-detect their installation on startup, and give you live HTML preview and export options accordingly.
標題
# Level 1 Heading
## Level 2 Heading ##
###### Level 6 Heading
Level 1 Heading
===============
some text
Level 2 Heading
---------------
some more text
段落
This is a paragraph.
This is another line in the same paragraph using a manual line break.
This is a new paragraph.
行內格式化
有兩種方式可以指定斜體或是粗體。第一種方式是前後使用一個星號 (*) 代表斜體,兩個代表粗體;第二種方式是前後使用底線 (_),同樣也是一個代表斜體,兩個代表粗體。
This is *italics* with asterisks.
This is _italics_ with underscores.
This is **bold** with asterisks.
This is __bold__ with underscores.
您也可以將它們混合成 斜體 + 粗體,例如:
This is ***bold italics*** with asterisks.
This is **_bold italics_** mixing.
This is another *__bold italics__*.
etc.
連結
您可以連結到各種網站:
Click [here](http://url.com "Title") to visit a website.
也可以用參照連結:
[This][id] is a reference link which is defined below.
[id]: http://url.com "Title"
影像
可以如此內嵌影像:
![alternate text](./image.jpg "Title")
也可以使用參照連結語法:
![alternate text][id] for a reference defined below.
[id]: ./image.jpg "Title"
列表
您可以使用有序清單:
1. Item one.
2. Item two.
3. Item three.
或是無序清單:
* Item one.
+ Item two.
- Item three.
可以混合並使用清單內的清單:
1. Item one.
* Subitem one.
* Subitem two.
2. Item two.
- Subitem one.
- Subitem two.
3. Item three.
1. Subitem three.
程式碼區塊
可以用四個或更多空格,或是一個 tab 字元,來建立程式碼區塊:
This is a normal paragraph, followed by a code block.
for (int i = 0; i < 10; i++) {
System.out.println("i = " + i);
}
The above will be displayed as a preformatted block of code.
使用 Pandoc 或 GitHub 等某些 Markdown 轉換器時,您可以使用 GitHub-Flavored Markdown 的反引號(```)來框住程式碼區塊,而非使用縮排。例如:
```
for (int i = 0; i < 10; i++) {
System.out.println("i = " + i);
}
```
上方也會被顯示成預先格式化的程式碼區塊。
行內程式碼
您可以在段落內使用反引號 () 來標記程式碼,像是這個
<html>
標籤。您可以重複反引號來指定反引號本身,例如:```
escaped backtick
`` ```。
區塊引文
您可以使用電子郵件風格的大於符號來標記區塊引文,例如:
> This is a block quote.
>
>> This is a nested block quote.
水平線
用三個或更多 dash (-)、底線 (_) 或星號 (*) 來標記水平線,例如:
---
***
___
字元之間甚至可以有空格:
- - -
Markdown 延伸
Some Markdown processors add syntax for tables, footnotes, and so forth to extend the original John Gruber Markdown specification. Below is a footnote usage example for Pandoc, MultiMarkdown, and other processors that support the extension:
Here is the body text that has a footnote.[^footnoteid]
[^footnoteid]: Here is the footnote text.
以下是一個 Pandoc 表格範例:
Column One Column Two
---------- ----------
Row Text 1 Row Text 2
Row Text 1 Row Text 2
Table: Pandoc sample table.
Below is a sample cmark-gfm or MultiMarkdown table:
Column One | Column Two
---------- | ----------
Row Text 1 | Row Text 2
Row Text 1 | Row Text 2
There are even more table syntaxes that these Markdown processors can support. There are also many more extensions. For more information on these processors, please visit the following websites:
- Pandoc: http://johnmacfarlane.net/pandoc/
- MultiMarkdown: http://fletcherpenney.net/multimarkdown/
- cmark: http://github.com/jgm/cmark/
- cmark-gfm: http://github.com/github/cmark
The original John Gruber Markdown specification can be found at http://daringfireball.net/projects/markdown/.
快捷鍵
ghostwriter 支援 Markdown 編輯時使用以下快捷鍵:
- Ctrl+B
- 套用粗體(強烈)格式。
- Ctrl+I
- 套用斜體(強調)格式。
- Ctrl+K
- 套用刪除線格式。
- Ctrl+/
- 在游標位置插入一個 HTML 註解;有選取文字時將所選文字變為 HTML 註解。
- Tab
- 將選取行數向右縮排。
- Shift+Tab
- 將選取行數向左縮排。
- Shift+Enter
- 插入 Markdown 風格的換行。
- Ctrl+Enter
- 插入普通的換行,但不繼續使用目前的縮排。換句話說,在有縮排的行數上打字時按下
Ctrl+Enter
,新的一行將不會有縮排。Ctrl 修飾鍵和 Shift 修飾鍵可以並用,代表插入 Markdown 風格換行並不要縮排新行。 - Ctrl+.
- 將目前行數或是選取行數變為區塊引文。
- Ctrl+,
- 從目前行或是所選行數移除任何區塊引文格式。
- Ctrl+8
- 將目前行數或是選取行數變為使用
*
標記的無序清單。例如,如果您有在以下行數中選取文字:List item one. List item two.
按下此快捷鍵會將所選行數變成無序清單,像這樣:
* List item one. * List item two.
- Ctrl+Shift+-
- 將目前行數或是選取行數變為使用
-
標記的無序清單。例如,如果您有在以下行數中選取文字:List item one. List item two.
按下此快捷鍵會將所選行數變成無序清單,像這樣:
- List item one. - List item two.
- Ctrl+Shift+=
- 按下
Ctrl
和Shift
和=
會將目前行數或是選取行數變為使用+
標記的無序清單。例如,如果您有在以下行數中選取文字:List item one. List item two.
按下此快捷鍵會將所選行數變成無序清單,像這樣:
+ List item one. + List item two.
- Ctrl+1
- 將目前行數或是選取行數變為使用
.
分隔的有序清單。例如,如果您有在以下行數中選取文字:List item one. List item two.
按下此快捷鍵會將選取行數變成有序清單,像這樣:
1. List item one. 2. List item two.
- Ctrl+0
- 將目前行數或是選取行數變為使用
)
分隔的有序清單。例如,如果您有在以下行數中選取文字:List item one. List item two.
按下此快捷鍵會將選取行數變成有序清單,像這樣:
1) List item one. 2) List item two.
- Ctrl+T
- 將目前行數或是選取行數變成 GitHub 風格 Markdown 的工作清單項目。例如,如果您選取了以下行數的文字:
Important thing to do. Another important thing to do.
按下此快捷鍵會將所選行數變成工作清單,像這樣:
- [ ] Important thing to do. - [ ] Another important thing to do.
- Ctrl+D
- 目前行數是一個 GitHub 風格 Markdown 的工作清單項目時,按下此快捷鍵會切換該工作項目的完成狀態。完成時勾選方塊中會寫
x
,未完成時則會留空。例如:- [ ] This is an incomplete task. - [x] This task as done!
- 相符字元
- When text within a single line is selected, pressing any of the above characters will enclose the selected text with that character and its matching closing character. For example, if you select the word
dog
and then enter the(
character, the worddog
will be enclosed in parentheses and become(dog)
. Below is a table showing the typed character and the matching closing character:Opening Closing " " ' ' ( ) [ ] { } * * _ _ ` ` < >
To enable auto-matching of characters as you type, check "Automatically match characters while typing" from the Editor tab in the Preferences dialog, available from the menu bar under the `Settings->Preferences...` option. You can also customize which characters are matched by selecting the "Customize matched characters..." button. - 拖放影像檔
- An alternative to selecting the
Edit->Insert Image...
option from the menu bar is to drag and drop any image file from your file system into the editor window. The application will insert inline image text with your image's file path relative to the currently opened document's location, or the full path if the document is untitled. For example:![](../../relative/path/to/your/file.png)
或是文件未命名時:
![](file:///full/path/to/your/file.png)