DokuWiki

It's better when it's simple

User Tools

Site Tools


interwiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
interwiki [2020-06-14 11:36] gerardnicointerwiki [2024-01-20 20:34] (current) – usemod.com expired 212.159.76.45
Line 1: Line 1:
 ====== InterWiki Links ====== ====== InterWiki Links ======
  
-The original idea of InterWiki was to have one large distributed [[wp>Wiki]] over the whole Internet. Today its more of an easy way to link from one wiki to another by having some simple link syntax to accomplish so.+The original idea of InterWiki was to have one large distributed [[wp>Wiki]] over the whole Internet. Today it'more of an easy way to link from one wiki to another by having some simple link syntax to accomplish so.
  
-In [[DokuWiki]] this is done by prefixing Wiki [[pagenames]] with a shortcut separated by a ''>'' character.+In [[DokuWiki]] this is done by prefixing Wiki [[pagenames]] with a shortcut separated by a **''>''** character.
  
 Examples: Examples:
-| %%[[wp>InterWiki]]%%    | [[wp>InterWiki]]    | links to the English language Wikipedia                                                                                                                                                                     +^  Shortcut  ^  Example  ^  Description 
-| %%[[phpfn>random]]%%    | [[phpfn>random]]    | links to a function in the PHP manual                                                                                                                                                                       +''%%[[amazon>Wikis]]%%''     | [[amazon>Wikis]]    | Affiliation link to Amazon. (.de and .uk available too)  
-| %%[[google>Wiki]]%%     | [[google>Wiki]]     | links to a Google search                                                                                                                                                                                    +''%%[[callto>0123456789]]%%''  | [[callto>0123456789]]  | Callto link to open phone app.  | 
-| %%[[doku>interwiki]]%%  | [[doku>interwiki]]  | links to the DokuWiki wiki                                                                                                                                                                                  +| ''%%[[doku>interwiki]]%%''   | [[doku>interwiki]]  | links to the DokuWiki wiki  
-| %%[[skype>echo123]]%%   | [[skype>echo123]]   | Links that opens Skype, ready to call Skype Test Call (echo123)                                                                                                                                             +''%%[[go>pie]]%%''           | [[go>pie]]          | Go lucky with first hit on Google 
-| %%[[this>feed.php]]%%   | [[this>feed.php]]   | links to your wiki's URL. The example links to the local [[syndication|XML feed]]. ''%%[[this>]]%%'' is a special case and the only interwiki link which **cannot be configured** through any config file.  |+| ''%%[[google>Wiki]]%%''      | [[google>Wiki]]     | links to a Google search  
 +''%%[[paypal>id_here]]%%''   | [[paypal>id_here]]  | links to PayPal 
 +| ''%%[[phpfn>random]]%%''     | [[phpfn>random]]    | links to a function in the PHP manual  
 +''%%[[rfc>9311]]%%''         | [[rfc>9311]]        | links to https://www.rfc-editor.org/rfc/rfc9311 
 +| ''%%[[skype>echo123]]%%''    | [[skype>echo123]]   | Links that opens Skype, ready to call Skype Test Call (echo123)  
 +''%%[[tel>123-456-7890]]%%''  | [[tel>123-456-7890]]  | Open phone app to call. More general then callto. 
 +| ''%%[[this>feed.php]]%%''    | [[this>feed.php]]   | links to your wiki's URL. The example links to the local [[syndication|XML feed]]. ''%%[[this>]]%%'' is a special case and the only interwiki link which **cannot be configured** through any config file.  | 
 +| ''%%[[user>username]]%%''    | [[user>username]]   | Links default to '':user:username'', on dokuwiki.org modified to its forum user profiles. 
 +| ''%%[[man>cp]]%%''           | [[man>cp]]          | links to http://man.cx/ 
 +| ''%%[[wp>InterWiki]]%%''     | [[wp>InterWiki]]    | links to the English language Wikipedia 
 +| ''%%[[wpfr>InterWiki]]%%''   | [[wpfr>InterWiki]]  | links to the French language Wikipedia. Also available: ''wpde'', ''wpes'', ''wpjp'',  ''wppl'', ''wpru'', ''wpmeta''.  |
  
-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.+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?media=video.ogg|{{image.png?300}}]]   [[this>lib/exe/fetch.php?media=video.ogg|{{image.png?300}}]]
  
-Since DokuWiki [[changes#release_2017-02-19e_frusterick_manners|Release 2017-02-19b “Frusterick Manners”]], interwiki substitution for external images is available.+Interwiki substitution for external images is also available.
  
- {{ phpfn>images/php.gif?96}}+{{ phpfn>images/php.gif?96}}
  
   {{ phpfn>images/php.gif?96}}   {{ phpfn>images/php.gif?96}}
Line 26: Line 36:
  
 InterWiki shortcuts are defined in two files: 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+  * Default included links are in ''[[https://github.com/dokuwiki/dokuwiki/blob/master/conf/interwiki.conf|<dokuwiki_conf>/interwiki.conf]]'' file. (more can be found in [[https://usemod.org/intermap.txt]]). Modifications of this file are overwritten on a wiki upgrade
-  * 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.+  * Local modifications in ''<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
 + 
 +Alternatively, instead of editing the ''*.conf'' files directly, you can install and use the [[plugin:confmanager|{{https://raw.githubusercontent.com/cosmocode/confmanager/master/admin.svg?16}}]][[plugin:confmanager|Configuration File Manager]].
  
 The interwiki shortcut has to be in lowercase and follow the [[pagename]] rules. The interwiki shortcut has to be in lowercase and follow the [[pagename]] rules.
Line 33: Line 45:
 The format of the interwiki config file is: The format of the interwiki config file is:
  
-  <shortcut>      <url to wiki>+<code - conf/interwiki.local.conf> 
 +<shortcut>   <url to wiki
 +</code> 
 + 
 +Modify existing interwiki links, by reusing the shortcut:<code - conf/interwiki.local.conf> 
 +wp           https://fr.wikipedia.org/wiki/{NAME} 
 +</code> 
 +Or disable by mentioning no link<code - conf/interwiki.local.conf> 
 +wpmeta 
 +paypal   # or use a comment to explain why it is disabled 
 +</code>
  
 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: 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:
Line 47: Line 69:
  
 The last 5 parameters are useful when creating interwikilinks to cachesystems.  The last 5 parameters are useful when creating interwikilinks to cachesystems. 
 +
 +For configuration changes to take effect on the pages, the [[devel:caching|cache must be purged]].
 +
 +==== Examples ====
  
 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: 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:
  
-<code>coral http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY}</code>+<code - conf/interwiki.local.conf> 
 +coral http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY} 
 +</code>
  
 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: 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:
  
-<code>ubuntu https://wiki.ubuntu.com/{NAME}</code>+<code - conf/interwiki.local.conf> 
 +ubuntu   https://wiki.ubuntu.com/{NAME} 
 +</code>
  
 and now create your link to it like this: and now create your link to it like this:
Line 64: Line 94:
 ==== Inter(n)wiki links ==== ==== Inter(n)wiki links ====
  
-To refer to certain namespaces within you own wiki:((Note: the link would always appeare like if page already exist. No preprove.))+To refer to certain namespaces within you own wiki:((Note: the link would always appear as if the page already exists. No 'preprove'.))
  
-<code><shortcut>      <dokuwiki_root>:ns:..:</code>+<code - conf/interwiki.local.conf> 
 +<shortcut>      <dokuwiki_root>:ns:..: 
 +</code> 
 + 
 +For example: <code - conf/interwiki.local.conf> 
 +enlib     doku.php?id=:en:lib: 
 +</code> would address pages in the namespace '':en:lib:pagename'' if using the link syntax ''%%[[enlib>pagename]]%%''.
  
-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 ===== ===== Configuring InterWiki Shortcut Icons =====
  
Line 84: Line 119:
 If you want to disable all or some kind of link icons, refer to [[tips:disabling link icons]]. If you want to disable all or some kind of link icons, refer to [[tips:disabling link icons]].
  
-===== Tip ===== +===== Using the number sign/hash (#), not as comment ===== 
-==== Hastag (Fragment==== +Because it is reserved to mark a comment line, a hash (''#''needs to be escaped by a backslash (''\#''). 
-If you are using the name of your interwiki in the fragment part of your URL, you need to escape it.+ 
 +e.g. if you are using the name of your interwiki in the fragment part of your URL, you need to escape it.
  
 Example: Example:
-  * Configuration +  * Configuration<file conf/interwiki.local.conf>
-<file apache conf/interwiki.local.conf>+
 postconf  http://www.postfix.org/postconf.5.html\#{NAME} postconf  http://www.postfix.org/postconf.5.html\#{NAME}
 </file> </file>
-  * Usage +  * Usage<code>
-<code>+
 [[postconf>smtpd_tls_received_header]] [[postconf>smtpd_tls_received_header]]
 </code> </code>
  
- +===== See also =====
-=====See also=====+
  
   * [[tips:interwiki_shortcuts|Additional InterWiki Shortcuts]]   * [[tips:interwiki_shortcuts|Additional InterWiki Shortcuts]]
 +  * You can install and use the [[plugin:confmanager|{{https://raw.githubusercontent.com/cosmocode/confmanager/master/admin.svg?16}}]][[plugin:confmanager|Configuration File Manager]] for editing via admin interface of the wiki
   * [[config|Configuring DokuWiki]]   * [[config|Configuring DokuWiki]]
 +
interwiki.1592127389.txt.gz · Last modified: 2020-06-14 11:36 by gerardnico

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki