//currently translating// FIXME ====== InterWiki 連結 ====== InterWiki 一開始的想法是我們可以在整個網路上擁有一個巨大且分散的 [[wp>Wiki]] ,但現在則大多表示利用一些簡單的連結語法連結到其他 Wiki 的方式。 在 [[DokuWiki]] 中,我們在要連結的 Wiki 縮寫和要連結的[[pagenames|頁面名稱]]中加上 ''>'' 符號,便可達到快速連結的效果。 一些範例: | %%[[wp>InterWiki]]%% | [[wp>InterWiki]] | 連結到英文的維基百科 | | %%[[phpfn>random]]%% | [[phpfn>random]] | 連結到php使用手冊中對於random函式的描述 | | %%[[google>Wiki]]%% | [[google>Wiki]] | 連結到Google搜尋 | | %%[[doku>interwiki]]%% | [[doku>interwiki]] | 連結到DokuWiki中的頁面 | | %%[[this>feed.php]]%% | [[this>feed.php]] | 連結到你wiki中的URL. 這個例子連結到本地的[[syndication|XML feed]]。''%%[[>this]]%%''作為一個特殊例子,它是唯一一個**沒辦法**用設定檔案來進行設定的InterWiki連結 | 這一個例子展示了如何藉由點擊圖片來存取dokuwiki中data/media資料夾裡的中介存取檔案。這對於存取影片和PDF檔案特別有幫助。 [[this>lib/exe/fetch.php?media=video.ogg|{{image.png?300}}]] ===== Configuring InterWiki Shortcuts ===== InterWiki shortcuts are defined in two files: * the ''[[https://github.com/splitbrain/dokuwiki/blob/master/conf/interwiki.conf|/interwiki.conf]]'' file.\\ This is the default file, it contains a few predefined useful shortcuts (more can be found in [[http://usemod.com/intermap.txt]]). It is possible to modify this file, however this could result in your changes being overwritten when upgrading DokuWiki. * the ''/interwiki.local.conf'' file.\\ This is the file to add your own interwiki links. This will prevent the links from being overwritten on an update. The interwiki shortcut has to be in lowercase and follow the [[pagename]] rules. The format of the interwiki config file is: The shortcut is the one you will be able to use in the link later. In the URL you can use some placeholders to be more flexible in linking. If no placeholder is given the [[phpfn>rawurlencode|URL-encoded]] wikiname will be appended to the URL. These placeholders are available: ^ Placeholder ^ Replaced by ^ | {URL} | URL-encoded wikiname (the part which is appended to the URL in interwiki.local.conf) | | {NAME} | wikiname without any encoding | | {SCHEME} | scheme part if an URL was given as wikiname | | {HOST} | host part if an URL was given as wikiname | | {PORT} | port part if an URL was given as wikiname | | {PATH} | path part if an URL was given as wikiname | | {QUERY} | query part if an URL was given as wikiname | The last 5 parameters are useful when creating interwikilinks to cachesystems. Refer to the ''coral'' shortcut in the distributed ''interwiki.conf''. Examples of these placeholders can found in the ''/interwiki.conf'' file. For example, [[https://wiki.ubuntu.com/|Ubuntu's wiki]] uses namespaces and pagenames like this "LaptopTestingTeam/ToshibaPortegeM700" and without using {NAME} as a placeholder in your interwiki.local.conf file, you'll get a Not Found error on their wiki, because it'll interpret the forward slash as a %2F ; so what you can do is add this line to your interwiki.local.conf: ubuntu https://wiki.ubuntu.com/{NAME} and now create your link to it like this: [[ubuntu>LaptopTestingTeam/ToshibaPortegeM700|Ubuntu Linux on Toshiba Portege M700 Tablet]] ===== Configuring InterWiki Shortcut Icons ===== Interwiki icons should have a size of 16x16 pixels, be in PNG or GIF format, and be named after the shortcut. * ''/lib/images/interwiki''\\ The directory to place the image files in. You should also purge [[caching|cached]] PNG and GIF images as well as the CSS Files if you have the default image instead of the one you uploaded. rm -rf /data/cache/*/*.{gif,png,css} It may actually be enough to invalidate the CSS caching by re-saving in the config manager ('re-saving' means pressing the save button of config manager without any changes of config options). If you want to disable all or some kind of link icons, refer to [[tips:disabling link icons]]. =====See also===== * [[config|Configuring DokuWiki]]