Simple MediaWiki extension that allows embedding the content of files hosted in GitHub git repositories.
The recommended way to install the GitHub extension is with Composer using MediaWiki 1.22 built-in support for Composer. MediaWiki versions prior to 1.22 can use Composer via the Extension Installer extension.
If you have MediaWiki 1.22 or later, go to the root directory of your MediaWiki installation, and go to step 2. You do not need to install any extensions to support composer.
For MediaWiki 1.21.x and earlier you need to install the Extension Installer extension.
Once you are done installing the Extension Installer, go to its directory so composer.phar is installed in the right place.
cd extensions/ExtensionInstaller
If you have previously installed Composer skip to step 3.
To install Composer:
wget http://getcomposer.org/composer.phar
Now using Composer, install Semantic MediaWiki.
If you do not have a composer.json file yet, copy the composer-example.json file to composer.json. If you are using the ExtensionInstaller, the file to copy will be named example.json, rather than composer-example.json. When this is done, run:
php composer.phar require jeroen-de-dauw/mediawiki-github "@dev"
Go to Special:Version and see if GitHub is listed there. If it is, you successfully installed it!
The default GitHub repo can be set using the $egGitHubDefaultRepo
setting. Assign to this setting
the name of the default repo in your LocalSettings file, after the inclusion of this extension e.g.
for Semantic MediaWiki as follows:
$egGitHubDefaultRepo = 'wikimedia/mediawiki-extensions-SemanticMediaWiki';
Add {{#github:FileName}} to your wiki page, where FileName is the name of the file you want to embed. This can include a path, for instance {{#github:docs/INSTALL.md}}.
You can also specify the repo name and the branch name: {{#github:FileName|user/repo|branchName}}
- Added support for markdown. Files ending on .md or .markdown are now rendered appropriately.
- The extension now needs to be installed via Composer.
- PSR-0 based autoloading is now used
- The ParserHooks library is now used for the github parser hook
- Additional tests have been added
- Initial release