Extension: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.0 or higher |
| PHP | 5.3 or above |
| Database changes | No |
| Licence | GNU General Public License 2.0 or later |
| Download | |
| Example | SMW 1.8 release page |
| Translate the Gitweb extension if it is available at translatewiki.net | |
The Gitweb extension adds the #gitweb parser function that allows embedding files from a gitweb instance.
Requirements
Gitweb requires:
- PHP 5.3 or above
- MediaWiki 1.16 or later
Download
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
Once you have downloaded the code, place the Gitweb directory within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file:
# Gitweb
require_once( "$IP/extensions/Gitweb/Gitweb.php" );
Usage
The #gitweb parser function takes 2 arguments, the first being the file name, the second being 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
| 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
This is a copy of the release notes file on Git, which might be more up to date than this page.
Internationalization
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.
