Extension:Git2Pages
<translate> This extension is currently not actively maintained!</translate> <translate> Although it may still work, any bug reports or feature requests will more than likely be ignored.</translate> <translate> If you are interested in taking on the task of developing and maintaining this extension, [[<tvar name=request>Special:MyLanguage/Gerrit/Privilege policy#Requesting Gerrit privileges</tvar>|you can request repository ownership]].</translate> <translate> As a courtesy, you may want to contact the author.</translate> <translate> You should also remove this template and list yourself as maintaining the extension in the page's <tvar name=extension>{{Extension }}</tvar> infobox.</translate> |
Git2Pages Release status: unmaintained |
|
---|---|
Implementation | Parser extension , Tag , Database |
Description | Allow wiki pages to include code from a git repository. |
Author(s) | Teresa Cho (original author) Dereckson (maintenance) Contributions by others |
Latest version | 1.1.1 (2015-10-08) |
MediaWiki | >= 1.31.0 |
PHP | 5.3+ |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | |
|
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Translate the Git2Pages extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
The Git2Pages extension implements a parser tag so you can transclude snippets of files in a git repository into wiki pages.
To do so it executes git
commands to clone a repository locally and then reads files from disk.
Usage
{{#snippet:repository=MYREPO|filename=MYFILE|branch=MYBRANCH
|startline=STARTLINE|endline=ENDLINE}}
The parameters are:
repository
- The URL of the git repository. REQUIREDfilename
- The filename whose data is going to be displayed. REQUIREDbranch
- The branch to look for the file. OPTIONAL (Default = master)startline
- The start of where the snippet will be pulled. OPTIONAL (Default = Start of file)endline
- The end of where the snippet will be pulled. OPTIONAL (Default = End of file)
Requirements
This extension uses wfShellExec()
to run shell commands that probably require the bash shell.
Installation
- <translate> [[<tvar name=2>Special:ExtensionDistributor/Git2Pages</tvar>|Download]] and move the extracted <tvar name=name>
Git2Pages
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Git2Pages - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'Git2Pages' );
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
See also
- Extension:External Content created in 2021 and still maintained as of 2023
- Git-remote-mediawiki which is actively maintained <translate> {{<tvar name=1>#if: y</tvar>|as of|As of}} <tvar name=2>2014</tvar></translate>
- Pages with script errors
- Pages with broken file links
- Unmaintained extensions
- Extensions without an image
- Parser extensions
- Tag extensions
- Database extensions
- Extensions without a compatibility policy
- GPL licensed extensions
- Extensions in Wikimedia version control
- ParserFirstCallInit extensions
- All extensions
- Pages containing potentially dated statements
- Git