User:Barre/MediaWiki/Extensions

From KitwarePublic
< User:Barre‎ | MediaWiki
Revision as of 00:05, 17 February 2005 by Barre (talk | contribs) (Extensions stuff)
Jump to navigationJump to search

Extensions

MediaWiki, the software that runs this Wiki site, allows developers to write their own extensions to the Wiki markup. An extension defines an HTML/XML-style tag which can be used in the Wiki editor like any other markup. If you want to write your own extensions, check those resources.

So here it goes...

kw_include_file

This extension allows you to dynamically include the contents of a remote file in your page. It is typically used to include source code and prevent duplication between a source tree and a web page. For safety reasons, access to the local filesystem is denied and translations are performed to (hopefully) prevent people from including malicious HTML/JavaScript code. The following example include the extension code itself through CVSWeb:

<kw_include_file>http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/scripts/media-wiki-extensions/kwIncludeFile.php?content-type=text%2Fplain&root=kwGridWeb</kw_include_file>

...is rendered as: <kw_include_file>http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/scripts/media-wiki-extensions/kwIncludeFile.php?content-type=text%2Fplain&root=kwGridWeb</kw_include_file>

kw_article_time_stamp

This extension allows you to dynamically include the time stamp of a Wiki article, i.e. its last modification date. Note that the built-in page-caching feature may lead to incorrect results (so I've heard). The source code can be browsed here. The following example includes the time stamp of the current page and the Welcome page:

* [[kwGrid:Editing_Help]]: <kw_article_time_stamp>kwGrid:Editing Help</kw_article_time_stamp>
* [[kwGrid:Welcome]]: <kw_article_time_stamp>kwGrid:Welcome</kw_article_time_stamp>

...is rendered as:

  • kwGrid:Editing_Help: <kw_article_time_stamp>kwGrid:Editing Help</kw_article_time_stamp>
  • kwGrid:Welcome: <kw_article_time_stamp>kwGrid:Welcome</kw_article_time_stamp>

Resources