Extension:Gitweb
Gitweb 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+ |
PHP | 5.3+ |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | |
Translate the Gitweb extension if it is available at translatewiki.net | |
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]
Gitweb requires:
- PHP 5.3 or above
- MediaWiki 1.16 or later
Download[edit]
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]
- Download and place the file(s) in a directory called
Gitweb
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/Gitweb/Gitweb.php";
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage[edit]
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]
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]
This is a copy of the release notes file on Git, which might be more up to date than this page.
Internationalization[edit]
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.