From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png

Release status: stable

Implementation Parser function
Description Allows to embed files from a gitweb instance
Author(s) Jeroen De Dauwtalk
Latest version 0.1 (2012-08-12)
MediaWiki 1.16.0 or higher
PHP 5.3 or above
Database changes No
License GNU General Public License 2.0 or later
Example SMW 1.8 release page
Hooks used

Translate the Gitweb extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The Gitweb extension adds a {{#gitweb:}} parser function that allows you to embed files from a gitweb instance. It requests the file over HTTP and caches the response.

Requirements[edit | edit source]

Gitweb requires:

  • PHP 5.3 or above
  • MediaWiki 1.16 or later

Download[edit | edit source]

You can obtain the latest version of this extension, as well as its tags and branches, using git:

git clone git://github.com/JeroenDeDauw/Gitweb.git

Alternatively you can get one of the release packages. You can also get a snapshot of the latest code, but beware, this might be unstable.

Installation[edit | edit source]

  • Download and place the file(s) in a directory called Gitweb in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/Gitweb/Gitweb.php";
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage[edit | edit source]

The #gitweb parser function takes two arguments: the file name, and the repository name. Both are optional and default to their corresponding settings (see below).

Example 0: {{#gitweb:}}

Example 1: {{#gitweb:documentation/some-file}}

Example 2: {{#gitweb:README|mediawiki/extensions/SemanticMediaWiki}}

Settings[edit | edit source]

Name Type Default Description
$egGitwebFile string 'README' Default value for the file parameter.
$egGitwebRepo string 'mediawiki/core' Default value for the repo parameter.
$egGitwebRoot string 'https://gerrit.wikimedia.org/r/gitweb' Location of the gitweb instance.
$egGitwebCacheTtl unsigned integer 60 Time to live of the cache, in seconds.

Version[edit | edit source]

This is a copy of the release notes file on Git, which might be more up to date than this page.

Internationalization[edit | edit source]

Gitweb is fully internationalized. Translation of Gitweb messages is done through translatewiki.net. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.

External links[edit | edit source]