PmWikiZhTw: TextFormattingRules

本頁面提供 PmWiki 寫作語法的完整清單。

其實不使用下列的寫作語法也可以輕鬆地建立和編輯網頁,但是一旦你需要格式化你的文字內容,請仔細閱讀底下的說明。

如果要練習這些寫作語法,請到 測試沙箱

文字段落

段落縮排(常用在引用別人的文章內容)

在段落的開頭使用箭頭 ->,可以產生段落縮排,連字符號 ---> 越多,縮得越深。

使用範例:

 ->Four score and seven years ago our fathers placed upon this
 continent a new nation, conceived in liberty and dedicated to the
 proposition that all men are created equal.

顯示結果:

Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal.

強調文字語氣

要使用更複雜的格式化文字,請參考 文字格式 的說明。

標題

在每行的開頭使用驚嘆號 !,表示本行是標題,感歎號越多,標題層次越減。

使用範例:

 ! Level 1 Heading
 !! Level 2 Heading
 !!! Level 3 Heading
 !!!! Level 4 Heading
 !!!!! Level 5 Heading
 !!!!!! Level 6 Heading

顯示結果:

Level 1 Heading

Level 2 Heading

Level 3 Heading

Level 4 Heading

Level 5 Heading
Level 6 Heading


項目列表

在每行的開頭使用星號 *,表示本行是項目列表,星號越多,層次越深。

使用範例:

 * First-level list item
 ** Second-level list item
 ** Another second-level item
 * A first-level item

顯示結果:

編號列表

在每行的開頭使用井字號 #,表示本行是編號列表,井字號越多,層次越深。

使用範例:

 # Prepare the experiment
 ## Unwrap the pop-tart
 ## Insert the pop-tart into the toaster
 # Begin cooking the pop tart
 # Stand back

顯示結果:

  1. Prepare the experiment
    1. Unwrap the pop-tart
    2. Insert the pop-tart into the toaster
  2. Begin cooking the pop tart
  3. Stand back

定義列表

在每行的開頭使用冒號 :,表示本行是定義列表,冒號越多,層次越深。

使用範例:

 :term:definition of term
 ::second-level item: definition of 2nd-level item

顯示結果:

term
definition of term
second-level item
definition of 2nd-level item

水平線

在每行的開頭使用至少四個或更多的連字符號 ----,可以產生水平線。

網頁連結

自由連結

free link 是不遵循 WikiWord 命名規則的網頁連結。

如果在文章中使用 WikiWord ,且顯示的連結文字看起來很突兀的話,這時候使用雙大括號,例如 {{free links}} 來建立連結,會很有用。

{{text}} 會連結到名稱為 Text 的網頁,{{basic editing}} 則會替實際名稱為 BasicEditing 的網頁建立連結,但是這時會顯示成 basic editing 的連結文字,在閱讀文章上,這樣比 WikiWord 看起來顯得較為自然美觀。

雙大括號 }} 後面還可以加上任意文字,所以 {{wiki word}}s 顯示為 wiki words 的網頁連結。

請參考 自由連結 裡頭更詳盡的說明。

不做格式化(常用於顯示程式代碼

放在 [= 和 =] 當中的任何文字不會被 PmWiki 格式化。例如,[=WikiWords=] 將不會自動建立連結,而是顯示成一般的文字 WikiWords。

[= 和 =] 之間可以跨行,這會讓整個段落不被格式化。

例如,每行開頭的 [= 會讓到下一個 =] 中的文字顯示為等寬字型(monospace)的純文字。

表格

在每行的開頭使用 '||',表示這是表格,'||' 後面可以設定整個表格的 HTML 顯示屬性。

表格欄位也是使用 '||' 來隔開,每個欄位前後都留有空格,表示文字置中;只有前面留有空格,表示文字向右對齊;沒有特別設定,則一律是向左對齊。

完全空白的欄位將會自動合併前一個欄位(目前還沒有辦法合併多行)。

使用範例:

        ||align=center border=1 width=50%
        ||Left   || Center ||  Right||
        ||A      ||    B   ||      C||
        ||       || single || ||
        ||       || multi span ||||

顯示結果:

Left Center Right
A B C
single
multi span

請參考 SimpleTablesSimpleTables2AdvancedTables (英文)裡頭更詳盡的說明。

特別符號

請參考 SpecialCharacters 的說明(英文)。

註釋文字

%comment% 加在文字之前,表示這是註釋文字。

加上 %comment% 註釋後,直到行尾或下一個 %% 中的整段文字將不會在網頁上顯示出來。

使用範例:

 %comment% This is a hidden comment line that doesn't show.
本頁更新於 2004 年 04 月 01 日,07:32 PM