Extension:Gitweb

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
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
License GNU General Public License 2.0 or later
Download
Example SMW 1.8 release page
Hooks used
ParserFirstCallInit

Translate the Gitweb extension if possible

Check usage and version matrix; code metrics

The Gitweb extension adds the #gitweb parser function that allows embedding files from a gitweb instance.

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 it's tags and branches via 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]

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[edit | edit source]

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[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]