From 4c8c12cc95e1860a996ce432c39f88e617038005 Mon Sep 17 00:00:00 2001 From: Luca Mauri Date: Wed, 13 May 2020 01:24:29 +0200 Subject: [PATCH 1/4] JSON file example updated --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4e5880f..fe83f93 100644 --- a/README.md +++ b/README.md @@ -34,17 +34,22 @@ In order to install dependencies needed by the extension, add the composer confi ```JSON { - "extra": { - "merge-plugin": { - "include": [ - "extensions/PageToGitHub/composer.json" - ] - } - } + "require": { + "lucamauri/page-to-github": "~1.0" + }, + "extra": { + "merge-plugin": { + "include": [ + ] + } + }, + "config": { + } } + ``` -and run Composer in a console from the root of your mediawiki installation: +and, in a command prompt, run Composer in the root of your mediawiki installation: ``` composer install --no-dev From 1321c597a817ac540227713cd693b4a633254546 Mon Sep 17 00:00:00 2001 From: Luca Mauri Date: Sat, 30 May 2020 16:06:22 +0200 Subject: [PATCH 2/4] Update README.md --- README.md | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index fe83f93..6764981 100644 --- a/README.md +++ b/README.md @@ -19,34 +19,24 @@ It was originally conceived and written by [Luca Mauri](https://github.com/lucam ## Requirements ## Install +Easiest way to install the extension is using _Composer_: it will automatically resolve all the dependencies and install them as well. -Download extension from GitHub and place the uncompressed files in a directory called `PageToGitHub` in the `extensions/` folder of your MediaWiki installation. - -Add the following code at the bottom of the site's `LocalSettings.php`: - -```PHP -wfLoadExtension('PageToGitHub'); -``` - -Below this line, add the configuration parameters as explained below in _Configuration_ section. - -In order to install dependencies needed by the extension, add the composer configuration to the `composer.local.json` at the root of your mediawiki installation, or create the file if it does not exist yet: +Add the `require` configuration as in the following example to the `composer.local.json` at the root of your mediawiki installation, or create the file if it does not exist yet: ```JSON { - "require": { - "lucamauri/page-to-github": "~1.0" - }, - "extra": { - "merge-plugin": { - "include": [ - ] - } - }, - "config": { - } + "require": { + "lucamauri/page-to-github": "~1.0" + }, + "extra": { + "merge-plugin": { + "include": [ + ] + } + }, + "config": { + } } - ``` and, in a command prompt, run Composer in the root of your mediawiki installation: @@ -55,6 +45,14 @@ and, in a command prompt, run Composer in the root of your mediawiki installatio composer install --no-dev ``` +Add the following code near the rest of the extensions loading in the site's `LocalSettings.php`: + +```PHP +wfLoadExtension('PageToGitHub'); +``` + +Below this line, add the configuration parameters as explained below in _Configuration_ section. + ## Configuration In the `LocalSettigs.php` file add: From 1e2fbb2a6954f60a6def536c146da1b9a4d9dfdc Mon Sep 17 00:00:00 2001 From: Luca Mauri Date: Sun, 7 Jun 2020 16:36:59 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6764981..0847aa2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# PageToGitHub - [![StyleCI](https://github.styleci.io/repos/238323866/shield?branch=master)](https://github.styleci.io/repos/238323866) [![Latest Stable Version](https://poser.pugx.org/lucamauri/page-to-github/v/stable)](https://packagist.org/packages/lucamauri/page-to-github) [![Total Downloads](https://poser.pugx.org/lucamauri/page-to-github/downloads)](https://packagist.org/packages/lucamauri/page-to-github) @@ -11,7 +9,9 @@ [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/lucamauri/PageToGitHub.svg)](http://isitmaintained.com/project/lucamauri/PageToGitHub "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/lucamauri/PageToGitHub.svg)](http://isitmaintained.com/project/lucamauri/PageToGitHub "Percentage of issues still open") -PageToGitHub, P2G in short, is a MediaWiki extension to automatically transfer code from a MediaWiki wiki to GitHub. +# PageToGitHub + +PageToGitHub, P2G in short, is a MediaWiki extension to automatically transfer code from a MediaWiki wiki to GitHub. It was originally conceived and written by [Luca Mauri](https://github.com/lucamauri) for use in [Wikitrek](https://github.com/WikiTrek): it is released as open source here in case it can be useful to anybody else. ## Features From e9dc6a179d3d3a66278b64110221fd9d87ac2c95 Mon Sep 17 00:00:00 2001 From: Luca Mauri Date: Wed, 17 Jun 2020 00:23:06 +0200 Subject: [PATCH 4/4] New instructions --- README.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0847aa2..7203bd2 100644 --- a/README.md +++ b/README.md @@ -61,37 +61,34 @@ In the `LocalSettigs.php` file add: $wgP2GAuthToken = 'GitHub-Token'; $wgP2GIgnoreMinor = true; $wgP2GKeyword = 'Keyword'; +$wgP2GAddKeyword = true; $wgP2GNameSpace = 'Module'; $wgP2GOwner = 'Project-Or-Person'; $wgP2GRepo = 'Name-Of-Your-Repository'; ``` ### \$wgP2GAuthToken - The GitHub token needed to authenticate and made modification the the repository. You can generate one in your GitHub account in _Settings_ > _Developer settings_ > _Personal access tokens_ ### \$wgP2GIgnoreMinor - If empty or set as `true` the revision is not pushed to GitHub if is marked as _Minor_ ### \$wgP2GKeyword - An optional keyword to check into the page. When present, P2G will _not_ upload pages if the keyword is not written in the page. If the parameter is omitted, P2G will upload all pages in the Namespace specified above. -### \$wgP2GNameSpace +### \$wgP2GAddKeyword +An optional boolean parameter: when set to `true` the word defined in _\$wgP2GKeyword_ is added before the name of the page to form the filename. +### \$wgP2GNameSpace P2G will upload pages only belonging to the namespace spedified in this variable ### \$wgP2GOwner - The Person or Organization owner of the repository ### \$wgP2GRepo - The name of the repository where the code must be uploaded ## Troubleshoot - To read detailed logging messages, you can intercept the [log group](https://www.mediawiki.org/wiki/Manual:$wgDebugLogGroups) named `PageToGitHub`: for instace with the following configuration into `LocalSetting.php`: ``` @@ -102,13 +99,10 @@ $wgDebugLogGroups['PageToGitHub'] = "/var/log/mediawiki/PageToGitHub-{$wgDBname} ## Documentation ## License - [GNU General Public License, version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) ## Maintainers - [Luca Mauri](https://github.com/lucamauri) ## Contributors - [Luca Mauri](https://github.com/lucamauri)