Download the PHP package jeroen-de-dauw/mediawiki-github without Composer

On this page you can find all versions of the php package jeroen-de-dauw/mediawiki-github. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mediawiki-github

GitHub extension for MediaWiki

If you need only markdown rendering, please use the External Content extension instead.

Simple MediaWiki extension for embedding content of files hosted in GitHub git repositories. It supports markdown rendering, syntax highlighting and caching.

Build status: Build Status Code Coverage Scrutinizer Quality Score

On Packagist: Latest Stable Version Latest Stable Version

Professional support and custom development is available via Professional.Wiki.

Requirements

Installation

The recommended way to install the GitHub extension is with Composer using MediaWiki 1.22 built-in support for Composer.

In your MediaWiki root directory, you can execute these two commands:

COMPOSER=composer.local.json composer require --no-update jeroen/mediawiki-github "~1.4"
composer update jeroen/mediawiki-github --no-dev -o

For more details on extension installation via Composer, see the documentation on MediaWiki.org.

Verify installation success

Go to Special:Version and see if GitHub is listed there. If it is, you successfully installed it!

Configuration

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:

To restrict from which repositories files can be fetched, use the egGitHubRepositoryWhitelist setting. If this list is empty, which it is by default, users can fetch files from whatever wiki they specify. This means they can include potentially harmful content. The extension should escape harmful content; this setting adds an extra layer of security.

To allow only files from a single repo:

To allow files from multiple repos:

Syntax highlighting

If you want code syntax highlighting you need to have the SyntaxHighlight extension enabled and configured.

Caching

The file contents gets cached in memory during the PHP request. The main MediaWiki cache is used as secondary cache, with a default TTL of 600 seconds. You can use the $egGitHubCacheTime setting to change the TTL:

You can modify which caching method is used. The supported methods are

The default is 'full'. You can change this setting as follows:

Network

You can modify the GitHub raw content URL used to fetch the files. The default is https://rawcdn.githack.com, due to https://raw.githubusercontent.com not working on all systems. You can change this setting as follows:

You can modify which method is used to fetch the file. The supported methods are

The default is 'mediawiki'. You can change this setting as follows:

Usage

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}}.

For syntax highlighting, this extension uses the same attributes as the SyntaxHighlight extension: lang, line, start, highlight, inline. Theses can be specified in any order using the attribute names.

{{#github:FileName|user/repo|branchName|lang=bash|line=1|start=1|highlight=1,5,4|inline=0}}

The lang parameter can be specified as the fourth positional argument.

{{#github:FileName|user/repo|branchName|bash}}

The defaults are line=0, start=1, and inline=0 when this functionality is activated.

Release notes

1.6.0 (2020-02-21)

1.5.0 (2019-04-09)

1.4.2 (2017-09-28)

1.4.1 (2017-07-01)

1.4.0 (2017-06-30)

1.3.0 (2017-06-09)

1.2.0 (2017-04-17)

1.1.1 (2016-11-06)

1.1.0 (2016-07-11)

1.0.3 (2016-07-10)

1.0.2 (2015-01-20)

1.0.1 (2015-01-19)

1.0.0 (2015-01-19)

New features

Compatibility changes

Enhancements

0.1.0 (2013-07-15)

Running the tests

To use MediaWiki vagrant, see this gist which includes the steps needed to install PHP7 and run the MediaWiki test runner with PHPUnit 6+.

To run code style checks and the tests that do not rely on MediaWiki, execute this in the base directory:

composer ci

Author

The GitHub extension was created and is maintained by Jeroen De Dauw.

Links


All versions of mediawiki-github with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
jeroen/simple-cache Version ~2.0
jeroen/file-fetcher Version ~6.0
jeroen/file-fetcher-cache Version ~1.0
mediawiki/parser-hooks Version ~1.5
michelf/php-markdown Version ~1.7
ezyang/htmlpurifier Version ~4.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jeroen-de-dauw/mediawiki-github contains the following files

Loading the files please wait ....