Page 1 of 2

Wiki Extensions

Posted: Fri Jan 30, 2009 11:35 am
by Mac_Fife
A couple of things I miss and think would be useful to add to the wiki are:
  • Cite - An extension that allows you to create footnotes in a document.
  • Parser Functions - Logical and conditional functions - very useful for conditional page transclusion (templates).

Re: Wiki Extensions

Posted: Fri Jan 30, 2009 5:30 pm
by Gehn, lord of ages
Mac_Fife wrote:Parser Functions - Logical and conditional functions - very useful for conditional page transclusion (templates).[/list]
Um, could you give an explanation on what this is for this poor clueless person?

Re: Wiki Extensions

Posted: Fri Jan 30, 2009 7:57 pm
by Mac_Fife
Gehn, lord of ages wrote:
Mac_Fife wrote:Parser Functions - Logical and conditional functions - very useful for conditional page transclusion (templates).[/list]
Um, could you give an explanation on what this is for this poor clueless person?
Err, OK, I'll try and give an example, but forgive me if it gets complicated - the point of it is that someone who knows what they're doing does the complicated bit and everyone else gets something that "just works" ;)

Sometimes you want a document to adapt it's content depending on how it's being used. That might sound a bit perverse, but bear with me :) . I'll use templates as an example (coz it's the way I best understand it).

First (for the benefit of anyone who doesn't know), the wiki allows a document to include the contents of a second document. This is handy for inserting things like common banners and avoids you adding in the entire wiki-text of the banner everytime. This process is called transclusion and the embedded document is usually referred to as a template. This is what you referred to in the Wiki Templates thread. To include a template within a document you just insert {{templatename}} in your main document. OK that's the easy bit.

Now to illustrate (in part) I've created three pages on the wiki, so you might want to look at the wiki-code of these:
Sandbox is a dummy article, to show the use of a template,
Template:Spoiler is the template, which shows a "Spoiler warning" banner,
Template:Spoiler/doc is the documentation on how to use the Spoiler template.

Now to explain (I hope ;) ): Sandbox starts with the line: {{spoiler}}
This calls up the Template:Spoiler page (the Template namespace is assumed by using {{...}} )

Now, if you look at the Spoiler page source you'll see that it has a bit in <div>...</div> tags which the actual template bit, followed by a bit in <noinclude>...</noinclude> tags. The <noinclude> tags tell the wiki not to show that stuff when the template gets included in another page. But it is used if the template page itself is viewed. In this case, it's calling another template, Template:Spoiler/doc, which contains the actual usage information for the Spoiler template. So why not just put the documentation directly into the Spoiler document? Well, you can - easily. But, it is often the case that you want to protect the template from edits but still allow others to amend or improve the documentation, and the best way to do that is by having the documentation transcluded into the template, as per my example.

And you could leave it there, but it's a bit "clunky": You have to remember to create the documentation page, make sure you've got the document names matching properly, etc., so wouldn't it be nice to semi-automate it so you don't screw up?
This is where it gets scary :)
So, instead of creating a unique link in every template to it's corresponding documentation page (e.g. {{templateA/doc}}, {{templateB/doc}}, etc.) you just simply call up one universal documentation page for all templates, e.g. {{documentation}}. And this is when you need the parser functions. In the generic Template:Documentation page you add code to evaluate the title of the page that it has been called into. You can then concatenate the "/doc" bit onto the end to give you name of the page where the documentation should be.

So the "end user" simply creates their template with the generic {{documentation}} call, which initially gives a "red link" to the uncreated documentation page, which can be followed then or later on to add the documentation details, and lo and behold all the related template and documentation page names stay consistent without the user ever needing to know how it all works 8-) .

I hope that makes sense to you ;)

Re: Wiki Extensions

Posted: Fri Jan 30, 2009 8:27 pm
by Gehn, lord of ages
Okay, I think I understand. Thanks. :D

Re: Wiki Extensions

Posted: Sun Feb 15, 2009 5:08 pm
by admin
Moved this thread from Suggestion to this new Wiki resource fourm.

Re: Wiki Extensions

Posted: Tue Jan 04, 2011 11:52 pm
by JWPlatt
The UsabilityInitiative extension has been added. It is notable that this is somewhat, but not entirely, beta for the current version of the wiki (1.16). It appears that it will be fully suported in 1.17.

Only the collapsible nav and editor toolbar options have been enabled. The collapsible nav works on the sidebar menus. The editor toolbar is juust what it sounds like - nice toolbars for the editor.

These are available only in the Vector skin, so that is now the default.

Please let us know of any difficulties.

Re: Wiki Extensions

Posted: Wed Feb 23, 2011 4:12 pm
by JWPlatt
The PHPBB/Users Integration extension, Auth_phpBB, was added a little while back to stop wiki spam.

For more information affecting logins from a few accounts, please see this thread:
viewtopic.php?f=24&t=466

Re: Wiki Extensions

Posted: Mon Apr 18, 2011 2:21 am
by JWPlatt
The SyntaxHighlight GeSHi extension has been added to support formatted code examples of many languages, adding color coding to the syntax.

For a full description of the extension, please see:
http://www.mediawiki.org/wiki/Extension ... ight_GeSHi

Re: Wiki Extensions

Posted: Mon Apr 18, 2011 9:56 am
by Mac_Fife
Thanks JW, I've used it already :D

Which, brings something else to mind that I've been thinking about: You can get a list of the installed extensions by looking up the wiki's Version page, but we could probably do with a wiki page to explain what each is for and how it benefits page authors. Saves having to go looking up each extension's description elsewhere, only to find it does nothing for you.

Re: Wiki Extensions

Posted: Mon Apr 18, 2011 1:02 pm
by JWPlatt
Perhaps a link out of this page: http://wiki.openuru.org/index.php?title=Help:Contents

But it is help by functionality, meaning there would be a new entry for maybe "Source Code Formatting." Citations, for example, are implemented by an extension already there (Cite), but not explained as such. It is instead explained as how to use wiki citations.