wiki:syntax
差異處
這裏顯示兩個版本的差異處。
兩邊的前次修訂版前次修改 下次修改 | 前次修改 | ||
wiki:syntax [2013/01/21 13:18 -0600 Mon. (12 年前)] – wzm | wiki:syntax [2024/08/07 08:12 -0500 Wed. (8 個月前)] (目前版本) – 外部編輯 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | 英文原版說明請見 [[: | + | ====== Formatting Syntax ====== |
- | ====== Wiki 語法 ====== | + | [[doku> |
- | [[DokuWiki]] 支援一些簡單的語法,務求使文檔更易讀。本頁包含了您在編輯頁面時可以使用的語法。點選在頁面頂端或底端的「編修本頁」按鈕,可觀看這一頁的原始檔。如要實驗,請移玉步至[[playground: | + | ===== Basic Text Formatting ===== |
- | 譯者註:接下來就讓我們花點時間看一下吧,不一定要全懂,**建議**挑有用到、有興趣的先學,有其他問題或想學多點再來看這也可以。 | + | DokuWiki supports |
+ | DokuWiki supports **bold**, //italic//, __underlined__ and '' | ||
+ | Of course you can **__//'' | ||
- | ===== 基本文字格式 ===== | + | You can use < |
- | DokuWiki 使用**空行**來區分段落((也就是 XHTML 語法中的 | + | You can use <sub>subscript</sub> and < |
- | Paragraphs are created from blank lines. | + | You can mark something as < |
- | + | ||
- | If you want to force a newline without a paragraph, you can use two backslashes followed by a whitespace or the end of line. | + | |
- | 實際顯示的結果為: | + | You can mark something as < |
- | Paragraphs are created from blank lines. | + | **Paragraphs** are created from blank lines. If you want to **force a newline** without a paragraph, you can use two backslashes followed by a whitespace or the end of line. |
- | If you want to force a newline without a paragraph, you can use two backslashes | + | This is some text with some linebreaks\\ Note that the |
+ | two backslashes | ||
+ | or followed by\\ a whitespace \\this happens without it. | ||
- | 若您想 **強制斷行**((也就是 XHTML 語法中的 < | + | This is some text with some linebreaks\\ Note that the |
+ | two backslashes are only recognized at the end of a line\\ | ||
+ | or followed by\\ a whitespace \\this happens without it. | ||
- | 這是一些有換行標記的文字。\\ 請注意: | + | You should use forced newlines only if really needed. |
- | 兩個倒斜線只在Enter之前\\ | + | |
- | 或者接在\\ 一個空格之前,才會有效。\\而這樣就並不起作用。 | + | |
- | 這是一些有換行標記的文字。\\ 請注意: | + | ===== Links ===== |
- | 兩個倒斜線只在Enter之前\\ | + | |
- | 或者接在\\ 一個空格之前,才會有效。\\而這樣就並不起作用。 | + | |
- | 您應該只在真正需要使用強制斷行的地方才用強制斷行。 | + | DokuWiki supports multiple ways of creating links. |
- | DokuWiki 支援以下基本語法,並且可以 **__//'' | + | ==== External ==== |
- | |說明^原始寫法^輸出效果^ | + | External links are recognized automagically: |
- | ^粗體|%%**粗體**%%|**粗體**| | + | |
- | ^斜體|%%//斜體//%%|// | + | |
- | ^底線|%%__底線__%%|__底線__| | + | |
- | ^定距字體,或稱「等寬」字體((monospaced font))|%%'' | + | |
- | ^下標字|%%H<sub>2</ | + | |
- | ^上標字|%%y = x< | + | |
- | ^刪除線|%%< | + | |
- | ===== 連結 ===== | + | DokuWiki supports multiple ways of creating links. External links are recognized |
+ | automagically: | ||
+ | link text as well: [[http:// | ||
+ | addresses like this one: < | ||
- | DokuWiki 可使用多種型態的連結,以下介紹各式連結用法: | + | ==== Internal ==== |
- | ==== 外部連結 ==== | + | Internal links are created by using square brackets. You can either just give a [[pagename]] or use an additional [[pagename|link text]]. |
- | 若使用標準 URL Scheme (如 http://www.google.com),或只是 FQDN (如 www.google.com)都會被自動判斷為外部連結。 | + | Internal links are created by using square brackets. You can either just give |
- | 此外,可以透過設定連結名稱(Linknames) 來設定連結的顯示,比如:[[http:// | + | |
- | 或者 email也可以用 < | + | |
- | 若使用標準 URL Scheme (如 http:// | + | [[doku> |
- | 或只是 FQDN (如 www.google.com)都會被自動判斷為外部連結。 | + | |
- | 此外,可以透過設定連結名稱(Linknames) 來設定連結的顯示, | + | |
- | 比如:[[http:// | + | |
- | 或者 email也可以用 < | + | |
- | ==== 內部連結 ==== | + | You can use [[some: |
- | 內部連結是用兩組中括號包裹要連結的頁面名稱來產生。 | + | You can use [[some:namespaces]] by using a colon in the pagename. |
- | 可以直接用 | + | |
- | 頁面名稱會被自動轉換成小寫英文字,並且不支援特殊符號。 | + | |
- | (中文頁面名稱雖然支援,但在某些部份並不完善,仍建議盡量使用英文頁面名稱 --- //[[reder.[email protected]|Reder]] 2008/06/05 04:58//) | + | |
- | 內部連結是用兩組中括號包裹要連結的頁面名稱來產生。 | + | For details about namespaces see [[doku> |
- | 可以直接用 | + | |
- | 頁面名稱會被自動轉換成小寫英文字,並且不支援特殊符號。 | + | |
- | (中文頁面名稱雖然支援,但在某些部份並不完善,仍建議盡量使用英文頁面名稱) | + | |
+ | Linking to a specific section is possible, too. Just add the section name behind a hash character as known from HTML. This links to [[syntax# | ||
- | 也可以加上冒號「: | + | This links to [[syntax# |
- | 也可以加上冒號「:」(colon)用來做 [[namespaces]] (分類名稱) 的區分而互相連結。 | + | Notes: |
- | 若想深入瞭解分類名稱(namespaces,或稱命名空間)空間請見 | + | * Links to [[syntax|existing pages]] are shown in a different style from [[nonexisting]] ones. |
+ | * DokuWiki does not use [[wp> | ||
+ | * When a section' | ||
- | 您也可以直接連結某個頁面的某章節段落。就像 HTML 一樣,只要在該頁後面加上 #某章節 就可以囉。比如: | + | ==== Interwiki ==== |
- | 這會連到 | + | DokuWiki supports |
- | | + | |
+ | For example this is a link to Wikipedia' | ||
- | 請注意: | + | ==== Windows Shares ==== |
- | * 連到 | + | Windows shares like [[\\server\share|this]] are recognized, too. Please note that these only make sense in a homogeneous user group like a corporate |
- | * 符合 | + | |
- | - 駝峰文字(CamelCase)簡言之就是「幾個英文單字之間緊接著而沒有空格」所組成的詞彙,但每個單字的首字大寫,狀如駝峰([[dict> | + | |
- | - 如果在[[: | + | |
- | * 若章節所在的頁面標題改變了,那麼其連結也會跟着改變。因此請別過度依賴章節連結功能。 | + | |
- | * 此外可參考 [[: | + | |
- | ==== Wiki間的互連 ==== | + | |
- | DokuWiki支援[[doku> | + | Windows Shares like [[\\server\share|this]] are recognized, too. |
- | DokuWiki支援[[doku> | + | |
- | 要連接到英文維基百科的 Wiki 頁,輸入[[wp> | + | |
- | 此外還可運用: | + | Notes: |
- | ^原始寫法^出現的結果^說明^ | + | * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default |
- | |%%[[%%google> | + | * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http://kb.mozillazine.org/ |
- | |%%[[%%wp> | + | <?php |
- | |%%[[Meatball> | + | /** |
- | |%%[[phpfn> | + | * Customization of the english language file |
- | |%%[[JspWiki> | + | * Copy only the strings that needs to be modified |
- | |%%[[FreeBSDman>uname]]%%|[[FreeBSDman> | + | */ |
- | |%%[[man>passwd]]%%|[[man> | + | $lang[' |
- | |%%[[rfc> | + | </code> |
- | |%%[[amazon> | + | |
- | |%%[[dict> | + | |
- | |%%[[imdb> | + | |
- | |%%[[GoogleGroups> | + | |
- | |%%[[bug>4]]%%|[[bug>4]] | 察看 DOKUWIKI 編號 4 的 bug 回報| | + | |
- | 備註:此外,還有多種變化,請自行參見下列有關 | + | |
- | InterWiki 可透過 '' | + | ==== Image Links ==== |
- | ^捷徑名稱{NAME}^網址{URL}^ | + | You can also use an image to link to another internal or external page by combining the syntax for links and [[# |
- | |wp |http:// | + | |
- | |wpzh |http:// | + | |
- | |wpjp |http:// | + | |
- | |wpde |http:// | + | |
- | 若不想用預設的圖示,那麼可在 '' | + | [[http:// |
- | 而這些圖檔必須是 16x16 像素(pixels) 的 PNG 或 GIF 格式。 | + | |
- | ==== 網路芳鄰分享的連結 ==== | + | [[http:// |
- | MS Windows 主機使用 SMB((Server Message Block))協定,或稱為 CIFS((CommonInternet File System))的協定,可讓 MS Windows 主機可以將另一 MS Windows 主機目錄檔案當成是本機上的目錄檔案一般地使用,即所謂的網路芳鄰分享。而這個協定亦可以用於 Internet ,即位於不同網段的 Windows 主機也可使用此協定進行目錄檔案的分享(假如傳送過程中未有其他的網路設備阻擋時)。而其他 OS 像是 FreeBSD, Linux 也有相關 Samba 軟體來使用這項功能。 | + | Please note: The image formatting is the only formatting syntax accepted in link names. |
- | 網芳資源可用 | + | The whole [[# |
- | 網芳資源可用 [[\\server\share|這樣子]] 來進行連結。 | + | ===== Footnotes ===== |
- | 千萬要注意: | + | You can add footnotes ((This is a footnote)) by using double parentheses. |
- | | + | |
- | * 請注意相關安全問題:鑒於 SMB 協定具有相當的便利性,但設定不夠完善的 Windows 主機(如密碼設定不夠安全或是未設定密碼)常讓外界使用者經此網路芳鄰分享,洩漏區域網路內相關檔案或系統上的機密資訊,甚至讓網路駭客完全控制該部主機。譬如 2001 年中的 Nimda 病毒就是經由網路芳鄰的方式散佈病毒至另一台保護不週的 Windows 主機上,以致造成感染病毒的速度加快。所以經由開放網路芳鄰分享於外界使用者,來增加與其他單位(如所屬機關、外部辦公室或駐外機構)的聯繫方便,同時亦可能形成安全上的漏洞,尤其是對保護不週的 Windows 主機而言。 | + | |
- | * Mozilla和Firefox的使用者,可採用[[http:// | + | |
- | $lang[' | + | ===== Sectioning ===== |
- | ==== 圖片連結 ==== | + | You can use up to five different levels of headlines to structure your content. If you have more than three headlines, a table of contents is generated automatically -- this can be disabled by including the string ''< |
- | 也可透過使用圖片來連到wiki內部的頁面,或者其他的 URL ,比如: | + | ==== Headline Level 3 ==== |
+ | === Headline Level 4 === | ||
+ | == Headline Level 5 == | ||
- | | + | |
+ | === Headline Level 4 === | ||
+ | == Headline Level 5 == | ||
- | [[http:// | + | By using four or more dashes, you can make a horizontal line: |
- | 注意:在%%[[%%網址%%|%%連結名稱%%]]%%的「連結名稱」處,若用「%%{{%%%%}}%%」的話,則只能輸入圖檔名稱。 | + | ---- |
- | DokuWiki支援完整的圖像和連結語法,包括圖像大小調整、內部和外部的圖像與連結,以及wiki內連結。 | + | ===== Media Files ===== |
- | ===== 註解 ===== | + | You can include external and internal [[doku> |
- | 您可以任意增加註解 ((這是示範註解)) ,怎麼用呢? | + | Real size: |
- | 把要註解的文字用兩組括號類似包水餃一樣包起來就好囉。 | + | |
- | 而註解的編號管理,請別擔心,DokuWiki 會自動幫您弄好。:-) | + | |
- | 您可以任意增加註解 ((這是示範註解)) ,怎麼用呢? | + | Resize to given width: |
- | 把要註解的文字用兩組括號類似包水餃一樣包起來就好囉。 | + | |
- | ===== 目錄的層次結構 ===== | + | Resize to given width and height((when the aspect ratio of the given width and height doesn' |
- | 一個層次分明的內容,加上有條不絮的說明文字,似乎總是最能令人消化吸收的。 | + | |
- | 我們可以透過設定最多至五種不同層次的標題,來完成目錄表的自動建構。 | + | Resized external image: {{https:// |
- | 若該頁內有至少三個層次的標題,那麼 DOKUWIKI 就會自動產生相對應的目錄表(table of contents, TOC)。 | + | |
- | 不過若不想要「目錄表」的話,那麼只要在文章開頭打入%%~~NOTOC~~%%即可。 | + | |
- | 標題是在左右各以等號「=」標示, | + | Real size: {{wiki: |
- | 從「%%==%%」到「%%======%%」,每多一個等號,則分別代表更高層次的標題。 | + | |
+ | Resize to given width and height: {{wiki: | ||
+ | Resized external image: {{https:// | ||
- | 「%%======%%」有六個等號,是「第一級標題層次」, | ||
- | 而本節目前是「%%===== 目錄的節次結構 =====%%」,也就是「第二級標題層次」 | ||
+ | By using left or right whitespaces you can choose the alignment. | ||
- | ==== 第三級標題層次 ==== | + | {{ wiki: |
- | === 第四級標題層次 === | + | |
- | == 第五級標題層次 == | + | |
- | ==== 第三級標題層次 ==== | + | {{wiki: |
- | === 第四級標題層次 === | + | |
- | == 第五級標題層次 == | + | |
- | 而連續四個短折號「-」(dash)所組成的 %%----%% 即可產生水平線。 | + | {{ wiki: |
- | 舉例: | + | |
- | ↓ | + | |
- | ---- | + | |
- | ===== 各種貼圖方式 ===== | + | {{ wiki: |
+ | {{wiki: | ||
+ | {{ wiki: | ||
- | === 貼圖語法 === | + | Of course, you can add a title (displayed as a tooltip by most browsers), too. |
- | 可以用兩組重疊的 %%{{}}%% 花括號來貼圖或檔案,詳情請見 [[doku> | + | |
- | 也可以在編輯時用工具列的按鈕來完成。 | + | |
- | 此外,還可指定圖檔的顯示大小。 | + | {{ wiki: |
- | 實際大小: | + | |
- | 縮放為自訂的寬度(50 pixel): {{wiki: | + | For linking an image to another page see [[#Image Links]] above. |
- | 縮放為自訂的大小(200x50)((若指定的長寬比與圖片本身不一致,在調整圖片大小前,它將被裁剪到新的比例)): | + | ==== Supported Media Formats ==== |
- | 縮放以URL連結的影像(100x100): | + | DokuWiki can embed the following media formats directly. |
- | 實際大小: | + | | Image | '' |
- | 縮放為自訂的寬度(50 pixel): {{wiki: | + | | Video | '' |
- | | + | | Audio | '' |
- | | + | | Flash | '' |
- | === 圖檔位置的搭配變化 === | + | If you specify a filename that is not a supported media format, then it will be displayed as a link instead. |
- | 也可運用 %%{{圖檔檔名}}%% 在括號與檔名之間插入空白的變化,來指定要放左、右或中間。 | + | |
- | == 圖檔變化說明舉例 1 == | + | By adding ''? |
- | {{ wiki: | + | |
- | {{ wiki: | + | {{wiki: |
- | 這張會出現在右邊,注意到了嗎? | + | |
- | 檔名跟左邊的括號隔了一個空白唷~ | + | |
- | 這代表靠右放 | + | |
- | 換言之, | + | |
- | 很簡單就可以把圖片靠右放置,對吧? | + | |
- | == 圖檔變化說明舉例 2 == | + | {{wiki: |
- | {{wiki: | + | |
- | {{wiki: | + | ==== Fallback Formats ==== |
- | 這張會出現在左邊,注意到了嗎? | + | |
- | 檔名跟右邊的括號隔了一個空白唷~ | + | |
- | 這代表靠左放 | + | |
- | 換言之, | + | |
- | 很簡單就可以把圖片靠左放置,對吧? | + | |
- | == 圖檔變化說明舉例 3 == | + | Unfortunately not all browsers understand all video and audio formats. To mitigate the problem, you can upload your file in different formats for maximum browser compatibility. |
- | {{ wiki: | + | |
- | {{ wiki:dokuwiki-128.png }} | + | For example consider this embedded mp4 video: |
- | 這張會出現在中間,注意到了嗎? | + | |
- | 檔名跟左右兩邊的括號都隔了一個空白唷~ | + | |
- | 這代表往中間放 | + | |
- | 換言之, | + | |
- | 很簡單就可以把圖片居中放置,對吧? | + | |
- | === 幫圖片加上說明 === | + | {{video.mp4|A funny video}} |
- | 當然還可在圖片上加上「說明文字(title)」(在多數的瀏覽器上,滑鼠移到該圖上則會顯示)。 | + | |
- | {{ wiki: | + | When you upload a '' |
- | {{ wiki: | + | Additionally DokuWiki supports a " |
- | 若您所指定的檔案(無論是內部連結或外部URL)並不是圖檔('' | + | ===== Lists ===== |
- | ===== 項目表 | + | |
- | DokuWiki 可使用項目表有兩種型態:數字及符號表。 | + | Dokuwiki supports ordered and unordered lists. To create a list item, indent your text by two spaces and use a '' |
- | 要建立項目表的話,在該行前面先空出兩格,然後加上 | + | |
- | 或者改用 | + | |
- | *這是項目表 | + | * This is a list |
- | * 然而 | + | * The second item |
- | * 也可以用不同層次的項目表來表達 | + | * You may have different levels |
- | * 其他 | + | * Another item |
- | - 這也一樣是項目表,不過前面會加上編號 | + | - The same list but ordered |
- | - 第二項 | + | - Another item |
- | - 只要在 '' | + | - Just use indention for deeper levels |
- | - 第三項 | + | - That's it |
- | + | ||
- | - 空行,則會結束列表,重新起算編號。 | + | |
< | < | ||
- | *這是項目表 | + | * This is a list |
- | * 然而 | + | * The second item |
- | * 也可以用不同層次的項目表來表達 | + | * You may have different levels |
- | * 其他 | + | * Another item |
- | + | ||
- | | + | |
- | - 第二項 | + | |
- | - 只要在 '' | + | |
- | - 第三項 | + | |
- | - 空行,則會結束列表,重新起算編號。 | + | - The same list but ordered |
+ | - Another item | ||
+ | - Just use indention for deeper levels | ||
+ | - That's it | ||
</ | </ | ||
- | ===== 文本轉換 ===== | ||
- | DokuWiki可以將預定義的字符或者字符串轉換成圖片、其他文本或HTML。 | + | Also take a look at the [[doku> |
- | 文本到圖片的轉換,主要用作表情符號。文本到HTML的轉換,多用於顯示符號替換,但也可以配置為使用其他HTML。 | + | ===== Text Conversions ===== |
- | ==== 表情符號 ==== | + | DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML. |
- | DokuWiki 支援 [[wp> | + | The text to image conversion is mainly done for smileys. |
- | 並且可以用 '' | + | |
- | 以下是目前 DokuWiki 所內建的表情符號表。 | + | |
- | ^原始寫法^表情符號^ | + | ==== Text to Image Conversions ==== |
- | |%%8-)%%|8-)| | + | |
- | |%%8-O%%|8-O| | + | |
- | |%%: | + | |
- | |%%: | + | |
- | |%%=)%%|=)| | + | |
- | |%%: | + | |
- | |%%: | + | |
- | |%%: | + | |
- | |%%: | + | |
- | |%%: | + | |
- | |%%: | + | |
- | |%%: | + | |
- | |%%: | + | |
- | |%%; | + | |
- | |%%:?: | + | |
- | |%%: | + | |
- | |%%LOL%%|LOL| | + | |
- | |%%FIXME%%|FIXME| | + | |
- | |%%DELETEME%%|DELETEME| | + | |
- | 好用嗎?多介紹一個:「%%^_^%%」,它是很熟悉的笑臉:^_^。 | + | |
- | ==== 顯示符號 ==== | + | DokuWiki converts commonly used [[wp> |
- | ^原始寫法^輸出的顯示符號(或結果)^ | + | * 8-) %% 8-) |
- | |%%->%%|->| | + | * 8-O %% 8-O |
- | |%%<-%%|<-| | + | * :-( %% :-( |
- | |%%<->%%|<->| | + | * :-) %% : |
- | |%%=>%%|=>| | + | * =) |
- | |%%<=%%|<=| | + | * :-/ %% : |
- | |%%<=>%%|<=>| | + | * :-\ %% : |
- | |%%>>%%|>>| | + | * :-? %% : |
- | |%%<<%%|<<| | + | * :-D %% :-D %% |
- | |%%--%%|--| | + | * :-P %% :-P %% |
- | |%%---%%|---| | + | * :-O %% :-O %% |
- | |%%640x480%%|640x480| | + | * :-X %% :-X |
- | |%%(c)%%|(c)| | + | * :-| %% :-| %% |
- | |%%(tm)%%|(tm)| | + | * ;-) %% ;-) %% |
- | |%%(r)%%|(r)| | + | * ^_^ %% |
- | |%%"He thought ' | + | * m( |
+ | * :?: %% :?: | ||
+ | * :!: %% : | ||
+ | * LOL %% | ||
+ | * FIXME %% FIXME %% | ||
+ | * DELETEME %% DELETEME | ||
- | 注意: 若您不想要這項功能的話,可以在[[config|設定選項]]中關閉。 | + | ==== Text to HTML Conversions ==== |
- | 您可以到[[doku> | + | Typography: |
- | 然而,上述例子中,有三個符號並非來自模式文件。它們是:乘號(640×480)、單引號( ' | + | -> <- <-> => <= <=> >> << -- --- 640x480 |
+ | "He thought ' | ||
- | ===== 層次標示 ===== | + | < |
+ | -> <- < | ||
+ | "He thought ' | ||
+ | </ | ||
- | 有時候(特別是討論時)您想把某些文字(尤為各次的回覆)標示作不同的層次,您可以使用下列的語法: | + | The same can be done to produce any kind of HTML, it just needs to be added to the [[doku> |
- | 我想我們應該這麼做 | + | There are three exceptions which do not come from that pattern file: multiplication entity (640x480), ' |
- | + | ||
- | | + | |
- | + | ||
- | >> 嗯,我想我們應該。 | + | |
- | + | ||
- | > 真的嗎? | + | |
- | + | ||
- | >> 當然! | + | |
- | + | ||
- | >>> | + | |
- | 我想我們應該這麼做 | + | ===== Quoting ===== |
- | > 不,我們不該。 | + | Some times you want to mark some text to show it's a reply or comment. You can use the following syntax: |
- | >> 嗯,我想我們應該。 | + | <code> |
+ | I think we should do it | ||
- | > 真的嗎? | + | > No we shouldn' |
- | >> | + | >> |
- | >>> 那就做吧! | + | > Really? |
- | ===== 表格 ===== | + | >> Yes! |
- | DokuWiki建立表格的方式很簡單: | + | >>> |
+ | </ | ||
- | ^ 標題1 | + | I think we should do it |
- | | (1,1) | (1,2) | (1,3) | | + | |
- | | (2,1) | 水平合併示範(注意兩條豎線)|| | + | |
- | | (3,1) | (3,2) | (3,3) | | + | |
- | 以「< | + | > No we shouldn' |
- | ^ 標題1 | + | >> Well, I say we should |
- | | (1,1) | (1,2) | (1,3) | | + | |
- | | (2,1) | 水平合併示範(注意兩條豎線)|| | + | |
- | | (3,1) | (3,2) | (3,3) | | + | |
- | 要水平合併兩格或多格,只要把後方的設置為空即可,如上面所示。請確保每行都有相同數量的分隔符。 | + | > Really? |
- | 標題也可用於「垂直欄位」上: | + | >> Yes! |
- | | ^ 標題1 | + | >>> |
- | ^ 標題3 | + | |
- | ^ 標題4 | + | |
- | ^ 標題5 | + | |
- | 方法就是直接在「標題3、4、5」前面加上「< | + | ===== Tables ===== |
- | | ^ 標題1 | + | DokuWiki supports a simple syntax to create tables. |
- | ^ 標題3 | + | |
- | ^ 標題4 | + | |
- | ^ 標題5 | + | |
- | 您也可以垂直合併兩格或多格。只要在下面的格內輸入「< | + | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ |
+ | | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | ||
+ | | Row 2 Col 1 | some colspan (note the double pipe) || | ||
+ | | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | ||
- | ^ 標題1 ^ 標題2 | + | Table rows have to start and end with a '' |
- | |(1,1)| 這次示範垂直合併 | + | |
- | |(2,1)| ::: | + | |
- | |(3,1)| ::: | + | |
- | 除跨行合併語法「< | + | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ |
+ | | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | ||
+ | | Row 2 Col 1 | some colspan (note the double pipe) || | ||
+ | | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | ||
- | ^ 標題1 ^ 標題2 | + | To connect cells horizontally, just make the next cell completely empty as shown above. Be sure to have always the same amount of cell separators! |
- | |(1,1)| 這次示範垂直合併 | + | |
- | |(2,1)| ::: | + | |
- | |(3,1)| ::: | + | |
- | 您還可以對齊表格的文字。只要在文本的相反方向添加至少兩個半型空格:如果要靠右對齊,在左邊添加兩個半型空格;反之,則在右邊添加。在兩邊均添加空格,即可以居中對齊。 | + | Vertical tableheaders are possible, too. |
- | ^ 對齊了的表格 | + | | |
- | | | + | ^ Heading 3 | Row 1 Col 2 | Row 1 Col 3 | |
- | |靠左對齊 | + | ^ Heading 4 |
+ | ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | ||
+ | |||
+ | As you can see, it's the cell separator before a cell which decides about the formatting: | ||
+ | |||
+ | | ||
+ | ^ Heading 3 | Row 1 Col 2 | Row 1 Col 3 | | ||
+ | ^ Heading 4 | no colspan this time | | | ||
+ | ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | | ||
+ | |||
+ | You can have rowspans (vertically connected cells) by adding '' | ||
+ | |||
+ | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | ||
+ | | Row 1 Col 1 | this cell spans vertically | Row 1 Col 3 | | ||
+ | | Row 2 Col 1 | ::: | Row 2 Col 3 | | ||
+ | | Row 3 Col 1 | ::: | Row 2 Col 3 | | ||
+ | |||
+ | Apart from the rowspan syntax those cells should not contain anything else. | ||
+ | |||
+ | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | ||
+ | | Row 1 Col 1 | this cell spans vertically | Row 1 Col 3 | | ||
+ | | Row 2 Col 1 | ::: | Row 2 Col 3 | | ||
+ | | Row 3 Col 1 | ::: | Row 2 Col 3 | | ||
+ | |||
+ | You can align the table contents, too. Just add at least two whitespaces at the opposite end of your text: Add two spaces on the left to align right, two spaces on the right to align left and two spaces at least at both ends for centered text. | ||
+ | |||
+ | ^ Table with alignment | ||
+ | | | ||
+ | |left | right| | ||
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
- | 下面是源文件中的樣子: | + | This is how it looks in the source: |
- | ^ 對齊了的表格 | + | ^ Table with alignment |
- | | | + | | right| |
- | |靠左對齊 | + | |left |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
- | 注意:不支援垂直對齊。 | + | Note: Vertical alignment is not supported. |
- | ===== 無格式化 | + | ===== No Formatting |
- | 若有一段文字,您不要它作格式化處理,要顯示作原來的樣子,請用「%%<nowiki></ | + | If you need to display text exactly like it is typed (without any formatting), |
- | < | + | < |
+ | This is some text which contains addresses like this: http:// | ||
+ | </nowiki> | ||
+ | The same is true for %%//__this__ text// with a smiley ;-)%%. | ||
- | < | + | < |
- | 以及**加上格式的文字**,但它沒有給格式化。 | + | This is some text which contains addresses like this: http:// |
- | | + | |
+ | The same is true for %%//__this__ text// with a smiley ;-)%%. | ||
- | ===== 代碼區塊 | + | ===== Code Blocks |
- | 在文字每一行的前方加上兩個半型空格,可使該段文字以「文字方塊」方式顯示出來。在文字方塊裏,所有文字都會無格式化。您也可以用 「%%<code></ | + | You can include code blocks into your documents by either indenting them by at least two spaces (like used for the previous examples) or by using the tags '' |
- | | + | |
- | 即使有**甚麼格式**標示了,它都不會[[格式化]]。 | + | |
< | < | ||
- | 這是沒有格式化的代碼,所有空格都保留下來。就像 | + | This is preformatted code all spaces are preserved: like <-this |
</ | </ | ||
< | < | ||
- | 這段也非常相似,但 | + | This is pretty much the same, but you could use it to show that you quoted a file. |
- | 您可以用它來表明 | + | |
- | | + | |
</ | </ | ||
- | 這些區塊由下面的源碼產生出來: | + | Those blocks were created by this source: |
- | | + | |
- | 即使有**甚麼格式**標示了,它都不會[[格式化]]。 | + | |
< | < | ||
- | | + | |
</ | </ | ||
< | < | ||
- | | + | |
- | 您可以用它來表明 | + | |
- | | + | |
</ | </ | ||
- | ===== 語法的高亮顯示 ===== | + | ==== Syntax Highlighting |
- | DokuWiki可把原始碼語法以高亮模式顯示,使它更易閱讀。它使用GeSHi通用語法高亮器,只要是GeSHi支援的,DokuWiki也支援。用法就類似前例的「%%< | + | [[wiki:DokuWiki]] can highlight sourcecode, which makes it easier to read. It uses the [[http:// |
<code java> | <code java> | ||
- | + | /** | |
- | /** | + | |
* The HelloWorldApp class implements an application that | * The HelloWorldApp class implements an application that | ||
* simply displays "Hello World!" | * simply displays "Hello World!" | ||
*/ | */ | ||
- | |||
class HelloWorldApp { | class HelloWorldApp { | ||
- | |||
public static void main(String[] args) { | public static void main(String[] args) { | ||
System.out.println(" | System.out.println(" | ||
行 496: | 行 418: | ||
</ | </ | ||
- | 目前支援的語言有: | + | The following language strings are currently recognized: |
+ | |||
+ | There are additional [[doku> | ||
- | ==== 可下載的代碼區塊 | + | ==== Downloadable Code Blocks |
- | 若您使用上述的「%%< | + | When you use the '' |
< | < | ||
行 512: | 行 436: | ||
</ | </ | ||
- | 若您不想把語法高亮顯示出,但想方便瀏覽者下載,您可以用破折號「-」作語言代碼。例如:「%%<code - myfile.foo> | + | If you don't want any highlighting but want a downloadable file, specify a dash ('' |
+ | ===== RSS/ATOM Feed Aggregation ===== | ||
+ | [[DokuWiki]] can integrate data from external XML feeds. For parsing the XML feeds, [[http:// | ||
- | ===== 在內容中嵌入 | + | ^ Parameter |
+ | | any number | will be used as maximum number items to show, defaults to 8 | | ||
+ | | reverse | ||
+ | | author | ||
+ | | date | show item dates | | ||
+ | | description| show the item description. All HTML tags will be stripped | | ||
+ | | nosort | ||
+ | | //n//[dhm] | refresh period, where d=days, h=hours, m=minutes. (e.g. 12h = 12 hours). | | ||
- | 可以在文件裏透過加入 '' | + | The refresh period defaults to 4 hours. Any value below 10 minutes will be treated as 10 minutes. [[wiki:DokuWiki]] will generally try to supply a cached version of a page, obviously this is inappropriate when the page contains dynamic external content. The parameter tells [[wiki: |
- | < | + | By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the '' |
- | 這是一段用 <font color=" | + | |
- | </ | + | |
- | < | + | **Example: |
- | < | + | |
- | 這是一段用 <font color=" | + | |
- | </ | + | |
- | </ | + | |
- | <php> | + | {{rss>http://slashdot.org/index.rss 5 author date 1h }} |
- | echo '由 PHP 所產生的 Logo:'; | + | |
- | echo '< | + | |
- | ' . php_logo_guid() . '" | + | |
- | | + | |
- | </ | + | |
- | <code> | + | {{rss>http://slashdot.org/index.rss 5 author date 1h }} |
- | < | + | |
- | echo '由 PHP 所產生的 Logo:'; | + | |
- | echo '< | + | |
- | ' . php_logo_guid() . '" | + | |
- | | + | |
- | </php> | + | |
- | </code> | + | |
+ | ===== Control Macros ===== | ||
- | **請特別注意**: | + | Some syntax influences how DokuWiki |
- | + | ||
- | **譯者建議**: | + | |
- | --- 譯者:// | + | |
- | + | ||
- | ===== RSS/ATOM Feed聚合 ===== | + | |
- | + | ||
- | DokuWiki能從外部XML feed中聚合數據。為分析這些XML feed,DokuWiki使用了[[http:// | + | |
- | + | ||
- | ^ 參數 | + | |
- | | any number | 最多顯示多少項內容;預設值是8。 | | + | |
- | | reverse | + | |
- | | author | + | |
- | | date | 顯示條目數據。 | | + | |
- | | description| 顯示條目的描述;如果[[doku> | + | |
- | | //n//[dhm] | 刷新周期,其中,d=日數,h=小時數,m=分。例如,12h=12小時。 | | + | |
- | + | ||
- | 預設的刷新周期是4小時。小於10分鐘者亦視為10分鐘。DokuWiki通常會提供頁面的暫存版,但這做法不適用於包含動態外部內容的頁面。上面的參數則告訴DokuWiki:若對上一次渲染時間已經過了// | + | |
- | + | ||
- | **範例: | + | |
- | + | ||
- | {{rss> | + | |
- | + | ||
- | {{rss> | + | |
- | ===== 控制巨集 ===== | + | ^ Macro ^ Description | |
+ | | %%~~NOTOC~~%% | ||
+ | | %%~~NOCACHE~~%% | DokuWiki caches all output by default. Sometimes this might not be wanted (eg. when the %%< | ||
- | 有些語法會影響DokuWiki對頁面的渲染,而自身不輸出任何內容。可用的控制巨集如下: | + | ===== Syntax Plugins ===== |
- | ^ 巨集 | + | DokuWiki's syntax can be extended by [[doku>plugins|Plugins]]. How the installed plugins are used is described on their appropriate description pages. The following syntax plugins are available in this particular |
- | | %%~~NOTOC~~%% | + | |
- | | %%~~NOCACHE~~%% | DokuWiki預設會緩存所有的輸出。有時您並不希望這樣(例如您使用了上述的%%< | + | |
- | ===== 語法附加元件 ===== | + | ~~INFO: |
- | 運用[[doku> |
wiki/syntax.1358795922.txt.gz · 上一次變更: 2024/04/04 20:43 -0500 Thu. (13 個月前) (外部編輯)