====== XML Syndication ====== [[DokuWiki]]可以經由[[this>feed.php]],將部份資料轉換成XML feed,讓使用者得以用[[wp>Aggregator|newsreader]]訂閱。 此 XML Syndication 乃使用了Kai Blankehorn的[[http://www.bitfolge.de/rsscreator-en.html|Feed Creator Class]]做成。 ===== 選項設定 ===== 當feed.php在沒有附加參數的情況下被呼叫,它將使用這些參數來產生feed。這些選項也可以經由URL傳送時加上參數來完成。 ==== 鏈結(Links) ==== 產出的feed中,各item都會有一個鏈結,此選項設定這些鏈結指向何處: * **項目名稱:** [[config:rss_linkto]] * **URL 參數:** linkto * **預設值:** diff * **其他可使用的值:** ^ 值 ^ 鏈結目標 ^ | page | 當此feed產出時,該頁面的版本 | | current | 頁面當前的版本 | | rev | 顯示該頁面所有版本 | | diff | 顯示該頁面的版本差異 | ==== Feed內容(Feed Content) ==== 設定feed裏面每個item會顯示什麼內容。 * **項目名稱:** [[config:rss_content]] * **URL 參數:** content * **預設值:** abstract * **可用的值:** ^ 值 ^ 說明 ^ | abstract | 文章的第一段 | | diff | 文章更動之處(純文字表示) | | htmldiff | 文章更動之處(html表格) | | html | 完整的HTML頁面 | ==== Feed格式(Feed Format) ==== DokuWiki能夠以多種格式產生XML feed * **項目名稱:** [[config:rss_type]] * **URL 參數:** type * **預設值:** rss1 * **可用的值:** ^ 值 ^ 說明 ^ | rss | RSS 0.91 | | rss1 | RSS 1.0 | | rss2 | RSS 2.0 | | atom | ATOM 0.3 | | atom1 | ATOM 1.0 | ==== 清單模式(List Mode) ==== feed.php除了可以用來輸出清單以顯示最近修改的文章(預設值),也可以輸出其他內容。 * **項目名稱:** none * **URL 參數:** mode * **預設值:** recent * **可用的值:** ^ 值 ^ 說明 ^ | recent | 最近修改的文章 | | list | simply list all pages of a namespace (see below for selecting which one) | | search | list pages matching a certain search query given through an additional parameter ''q'' | ==== 命名空間遮罩(Namespace Filter) ==== 可以限制feed只能輸出指定的命名空間內的頁面。 * **項目名稱:** none * **URL 參數:** ns * **預設值:** * * **可用的值:**任何有效的命名空間名稱 ==== Itme數量(Item Limits) ==== 控制feed可以顯示多少個Item(頁面) * **項目名稱:** [[config:recent]] * **URL 參數:** num * **預設值:** 20 * **可用的值:**任何正整數 ==== 包含次要的更新(Including Minor Edits) ==== 系統預設次要的更新項目不會顯示在feed裏。可以利用URL參數來改變。 * **項目名稱:** none * **URL 參數:** minor * **預設值:** 0 * **可用的值:** 0 或 1 ==== 快取(Caching) ==== 為了減輕wiki系統負擔,XML feeds會有快取。此處的選項用以設定快取的更新週期。 * **項目名稱:** [[config:rss_update]] * **URL 參數:** none * **預設值:** 5*60(5分鐘) * **可用的值:** 時間(秒) ==== 編輯摘要(Summaries) ==== 通常頁面的[[summary|編輯摘要]]會顯示在各item的標題處,或許有時會覺得沒有必要如此。 * **選項名稱:** [[config:rss_show_summary]] * **URL 參數** none * **預值值:** 1 * **可用的值:** 0 或 1 ===== 範例 ===== * [[this>feed.php?type=rss2&num=5]] 會產生一個包含5個最近更新項目的 [[http://backend.userland.com/rss|RSS 2.0]] feed。 * [[this>feed.php?mode=list&type=atom&linkto=page&ns=wiki]] 會產一個列出命名空間為「wiki」之內所有頁面的[[http://intertwingly.net/wiki/pie/FrontPage|ATOM 0.3]] feed,所有的item都直接鏈結到頁面。 ==== URL參數與選項 ==== * General syntax for RSS links from your own installation : [[this>feed.php?URL_parameter1=Value_X&URL_parameter2=Value_X......&URL_parameterN=Value_X]] | **Name :**| [[syndication#Links]] | [[syndication#Feed Content]] | [[syndication#Feed Format]] | [[syndication#List Mode]] | [[syndication#List Mode]] | [[syndication#Namespace Filter]] | [[syndication#Item Limits]] | [[syndication#Including Minor Edits]] | ^//URL Parameter: //^ linkto= ^ &content= ^ &rss_type= ^ &mode= ^ &q= ^ &ns= ^ &num= ^ &minor= ^ ^//Default Value :// :| diff | abstract | rss1 | recent | Any name | * | 20 | 0 | ^//Value 2// :| current | diff | rss | list | | Any Name | any integer | 1 | ^//Value 3// :| rev | htmldiff | rss2 | search | - | - | - | - | ^//Value 4// :| page | html | atom | - | - | - | - | - | ^//Value 5// :| - | - | atom1 | - | - | - | - | - | ===== Feed 與 ACLs ===== 當ACL(權限控制清單)作用時,公開的feed裏將不會列出被限制閱讀的資料。 若你希望能列出被限制閱讀的資料,你必須在URL裏加入帳號與密碼,例如: %%''http://example.com/dokuwiki/feed.php?u=username&p=password''%%. :!: 這並不十分安裝,有可能會造成使用者憑證洩漏。When DokuWiki is running atop of ''mod_php'' passing login credentials via HTTP Basic Auth as supported by some newsreaders might work as well. ===== See also ===== * [[rss|RSS/ATOM Feed Aggregation]] for adding external feeds to your DokuWiki pages * The [[plugin:feed|feed plugin]] for more ways to export your [[plugin:blog]] posts via RSS * Tips on [[tips:blogging#feed_setup|feed setup]] when blogging with DokuWiki