Table of Contents
DokuWiki InterWiki Shortcuts
Return to DokuWiki configuration, DokuWiki customization, DokuWiki topics
See also https://github.com/cosmocode/dokuwiki-plugin-interwikipaste and https://www.dokuwiki.org/plugin:interwikipaste
interwiki.conf - interwiki.local.conf - interwiki - interwiki shortcut links
InterWiki Links
The original idea of InterWiki was to have one large distributed Wiki over the whole Internet. Today its more of an easy way to hyperlink from one wiki to another by having some simple Hyperlink syntax to accomplish so.
In DokuWiki this is done by prefixing Wiki pagenames with a shortcut separated by a > character.
Examples: ]] | %%[[wp>InterWiki ]] | [[ [[wp>InterWiki]] ]] | [[ links to the English language Wikipedia ]] | [[ ]] | [[ random ]] | [[ [[phpfn>random]] ]] | [[ links to a function in the PHP manual ]] | [[ ]] | [[ Wiki ]] | [[ [[google>Wiki]] ]] | [[ links to a Google search ]] | [[ ]] | [[ interwiki ]] | [[ [[doku>interwiki]] ]] | [[ links to the DokuWiki wiki ]] | [[ ]] | [[ echo123 ]] | [[ [[skype>echo123]] ]] | [[ Links that opens Skype, ready to call Skype Test Call (echo123) ]] | [[ ]] | [[ feed.php ]] | [[ [[this>feed.php]] ]] | [[ links to your wiki's URL. The example links to the local [[syndication]] | [[XML feed]]. ''%% is a special case and the only interwiki link which **cannot be configured** through any config file. ]] | Here's an example of how to access an arbitrary file in dokuwiki's data/media directory by clicking on an image. It's useful for videos and pdf files. [[this>lib/exe/fetch.php | {{image.png
Since DokuWiki release_2017-02-19e_frusterick_manners | Release 2017-02-19b “Frusterick Manners”, interwiki substitution for external images is available.
{{ phpfn>images/php.gif?96}}
{{ phpfn>images/php.gif?96}}
Configuring InterWiki Shortcuts
InterWiki shortcuts are defined in two files:
- the https://github.com/splitbrain/dokuwiki/blob/master/conf/interwiki.conf | <dokuwiki_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 <dokuwiki_conf>/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.
https://github.com/splitbrain/dokuwiki/tree/master/conf
The interwiki shortcut has to be in lowercase and follow the pagename rules.
The format of the interwiki config file is:
- conf/interwiki.local.conf
<shortcut> <url to wiki>
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 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) | dokuwiki_interwiki_shortcuts | {NAME} | wikiname without any encoding | dokuwiki_interwiki_shortcuts | {SCHEME} | scheme part if a URL was given as wikiname | dokuwiki_interwiki_shortcuts | {HOST} | host part if a URL was given as wikiname | dokuwiki_interwiki_shortcuts | {PORT} | port part if a URL was given as wikiname | dokuwiki_interwiki_shortcuts | {PATH} | path part if a URL was given as wikiname | dokuwiki_interwiki_shortcuts | {QUERY} | query part if a URL was given as wikiname | The last 5 parameters are useful when creating interwikilinks to cachesystems. For example cached links with the old, not longer working, [[wp>Coral Content Distribution Network could be used by a coral shortcut, defined using a couple of placeholders:
- conf/interwiki.local.conf
coral http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY}
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:
- conf/interwiki.local.conf
ubuntu https://wiki.ubuntu.com/{NAME}
and now create your link to it like this:
[[ubuntu>LaptopTestingTeam/ToshibaPortegeM700]] | [[Ubuntu on Toshiba Portege M700 Tablet]]
If the wikiname will already include encoded characters (ex: %26 for &) use {PATH} in your interwiki.local.conf definition.
Inter(n)wiki links
To refer to certain namespaces within you own wiki:1)
- conf/interwiki.local.conf
<shortcut> <dokuwiki_root>:ns:..:
For example: enlib doku.php?id=:en:lib: would address pages in the namespace :en:lib:pagename if using the link syntax enlib>pagename.
Configuring InterWiki Shortcut Icons
Interwiki icons should have a size of 16×16 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 <dokuwiki_data>/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 disabling link icons.
Tip
Hashtag (Fragment)
If you are using the name of your interwiki in the fragment part of your URL, you need to escape it.
Example:
* Configuration
- conf/interwiki.local.conf
postconf http://www.postfix.org/postconf.5.html\#{NAME}
* Usage
[[postconf>smtpd_tls_received_header]]
See also
* [[tips:interwiki_shortcuts]] | [[Additional InterWiki Shortcuts]] * [[config]] | [[Configuring DokuWiki]]
Fair Use Sources
Cloud Monk is Retired (for now). Buddha with you. Copyright | © 2024 Losang Jinpa or Fair Use. Disclaimers. REPLACE with: navbar_footer