3

We have an internal company wiki. The wiki engine being used is MediaWiki, the wiki engine that runs Wikipedia. Some of it contains IT stuff.

One of the things i want want to have are hyperlinks to the various virtual machines. An example of a command, as it needs to run, is:

vmrc://solo.avatopia.com:5901/Windows 2000 Server

My first thought was to convert the URL into a link:

[vmrc://solo.avatopia.com:5901/Windows 2000 Server]

But the content renders literally as above: with the square brackets and all. Testing with other URL protocols:

[http://solo.avatopia.com]
[ftp://solo.avatopia.com]
[ldap://solo.avatopia.com]
[vmrc://solo.avatopia.com]

Only the first two work, and are converted to hyperlinks. The other two remain as liternal text. How can i add URLs to MediaWiki powered documentation?


Original Question

We have an internal company wiki. The wiki engine being used is MediaWiki, the wiki engine that runs Wikipedia. Some of it contains IT stuff.

One of the things i want want to have are hyperlinks to the various virtual machines. An example of a command, as it needs to run, is:

\\solo\VMRC Client\vmrc.exe solo.avatopia.com:5901/Windows 2000 Server

If launching from a command prompt, you have to quote the spaces:

C:\>"\\solo\VMRC Client\vmrc.exe" solo.avatopia.com:5901/"Windows 2000 Server"

My first thought in converting the above for use on our wiki-site, is to simply HTML-ify it:

file://\\solo\VMRC Client\vmrc.exe solo.avatopia.com:5901/"Windows 2000 Server"

but MediaWiki only converts file://\solo\VMRC to a hyperlink, the remainder is text.

i've tried other random things, including enclosing the URL in square brackets.

What is the correct answer? i don't want to happen to randomly stumble on some format that happens to work today, and breaks in the future.

Nemo
  • 259
  • 1
  • 13
Ian Boyd
  • 5,131
  • 14
  • 57
  • 79

4 Answers4

9

The protocols (http, ftp, gopher, etc) which turn into links when surrounded by square brackets ([]) are defined in the $wgUrlProtocols array in your LocalSettings.php file. Here are the default protocols allowed.

$wgUrlProtocols = array(
    'http://',
    'https://',
    'ftp://',
    'irc://',
    'gopher://',
    'telnet://', // Well if we're going to support the above.. -ævar
    'nntp://', // @bug 3808 RFC 1738
    'worldwind://',
    'mailto:',
    'news:'
);

To fix your problem, add vmrc as a protocol. Add/replace the following in your LocalSettings.php file:

$wgUrlProtocols = array(
    'http://',
    'https://',
    'ftp://',
    'irc://',
    'gopher://',
    'telnet://', // Well if we're going to support the above.. -ævar
    'nntp://', // @bug 3808 RFC 1738
    'worldwind://',
    'mailto:',
    'news:',
    'vmrc://',
);

You can now create links using the square bracket syntax: (The URL comes first, separated from the link text by one space. Spaces are not allowed in the URL.) [vmrc://solo.avatopia.com:5901 Windows 2000 Server]

David
  • 206
  • 1
  • 4
0

Sample to add url in mediawiki

[http://www.example.com/ Example Site] --> Output will be 'Example Site'
http://www.example.com --> output will be 'http://www.example.com'
splattne
  • 28,348
  • 19
  • 97
  • 147
0

I use pmwiki, they have a command so that when you encapsulate the text with [@ @] that it is printed as quoted and not changed into the wiki code - does that work for MediaWiki?

Dave Drager
  • 8,315
  • 28
  • 45
  • It does not work on MediaWiki, but i want to be clear. Does that turn your text into a hyperlink? Or does it output the text as is, but is not a link? When i try it, i literally get the square brackets and the @ signs. – Ian Boyd Jun 02 '09 at 21:03
  • @ddrager In MediaWiki, use the tags to keep MediaWiki from parsing the text. – David Jun 03 '09 at 14:01
0

URLs are for pointing to resources not commands to be run.

You can link to a batch script (as mentioned above), or you can display the text in monospace, code form and let users copy & paste.

tumbleweed
  • 255
  • 1
  • 6