Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucamauri/pagetogithub
MediaWiki extension to automatically transfer code from wiki to GitHub
https://github.com/lucamauri/pagetogithub
github mediawiki mediawiki-extension php
Last synced: 14 days ago
JSON representation
MediaWiki extension to automatically transfer code from wiki to GitHub
- Host: GitHub
- URL: https://github.com/lucamauri/pagetogithub
- Owner: lucamauri
- License: gpl-3.0
- Created: 2020-02-04T22:55:43.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-02-18T16:07:52.000Z (11 months ago)
- Last Synced: 2024-11-16T17:42:41.045Z (about 2 months ago)
- Topics: github, mediawiki, mediawiki-extension, php
- Language: PHP
- Homepage:
- Size: 43.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
[![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)
[![Latest Unstable Version](https://poser.pugx.org/lucamauri/page-to-github/v/unstable)](https://packagist.org/packages/lucamauri/page-to-github)
[![License](https://poser.pugx.org/lucamauri/page-to-github/license)](https://packagist.org/packages/lucamauri/page-to-github)
[![Monthly Downloads](https://poser.pugx.org/lucamauri/page-to-github/d/monthly)](https://packagist.org/packages/lucamauri/page-to-github)
[![Daily Downloads](https://poser.pugx.org/lucamauri/page-to-github/d/daily)](https://packagist.org/packages/lucamauri/page-to-github)
[![composer.lock](https://poser.pugx.org/lucamauri/page-to-github/composerlock)](https://packagist.org/packages/lucamauri/page-to-github)
[![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")## Badges
[![GPLv3 License](https://img.shields.io/badge/License-GPLv3-008033?logo=gpl)](https://opensource.org/licenses/)
[![Built with Visual Studio Code](https://img.shields.io/badge/Built_with-VS_Code-007ACC?logo=visualstudiocode)](https://code.visualstudio.com)
[![Discuss on StackOverflow](https://img.shields.io/badge/Discuss_on-Stack_Overflow-fe7a16?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/pagetogithub?tab=Active)# 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
## Requirements
## Install
Easiest way to install the extension is using _Composer_: it will automatically resolve all the dependencies and install them as well.
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": "~2.0"
},
"extra": {
"merge-plugin": {
"include": [
]
}
},
"config": {
}
}
```and, in a command prompt, run Composer in the root of your mediawiki installation:
```shell
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:
```
$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.
### \$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`:
```
$wgShowExceptionDetails = true;
$wgDebugLogGroups['PageToGitHub'] = "/var/log/mediawiki/PageToGitHub-{$wgDBname}.log";
```## Documentation
## License
[GNU General Public License, version 3](https://www.gnu.org/licenses/old-licenses/gpl-3.0.en.html)
## Maintainers
[Luca Mauri](https://github.com/lucamauri)
## Contributors
[Luca Mauri](https://github.com/lucamauri)