{"id":18817800,"url":"https://github.com/lucamauri/pagetogithub","last_synced_at":"2026-05-09T06:37:06.792Z","repository":{"id":62519746,"uuid":"238323866","full_name":"lucamauri/PageToGitHub","owner":"lucamauri","description":"MediaWiki extension to automatically transfer code from wiki to GitHub","archived":false,"fork":false,"pushed_at":"2024-02-18T16:07:52.000Z","size":45,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T02:27:52.496Z","etag":null,"topics":["github","mediawiki","mediawiki-extension","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucamauri.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-04T22:55:43.000Z","updated_at":"2022-12-28T16:20:37.000Z","dependencies_parsed_at":"2024-11-08T00:23:37.649Z","dependency_job_id":null,"html_url":"https://github.com/lucamauri/PageToGitHub","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucamauri%2FPageToGitHub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucamauri%2FPageToGitHub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucamauri%2FPageToGitHub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucamauri%2FPageToGitHub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucamauri","download_url":"https://codeload.github.com/lucamauri/PageToGitHub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239753733,"owners_count":19691162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","mediawiki","mediawiki-extension","php"],"created_at":"2024-11-08T00:13:28.953Z","updated_at":"2026-05-09T06:37:06.762Z","avatar_url":"https://github.com/lucamauri.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![StyleCI](https://github.styleci.io/repos/238323866/shield?branch=master)](https://github.styleci.io/repos/238323866)\n[![Latest Stable Version](https://poser.pugx.org/lucamauri/page-to-github/v/stable)](https://packagist.org/packages/lucamauri/page-to-github)\n[![Total Downloads](https://poser.pugx.org/lucamauri/page-to-github/downloads)](https://packagist.org/packages/lucamauri/page-to-github)\n[![Latest Unstable Version](https://poser.pugx.org/lucamauri/page-to-github/v/unstable)](https://packagist.org/packages/lucamauri/page-to-github)\n[![License](https://poser.pugx.org/lucamauri/page-to-github/license)](https://packagist.org/packages/lucamauri/page-to-github)\n[![Monthly Downloads](https://poser.pugx.org/lucamauri/page-to-github/d/monthly)](https://packagist.org/packages/lucamauri/page-to-github)\n[![Daily Downloads](https://poser.pugx.org/lucamauri/page-to-github/d/daily)](https://packagist.org/packages/lucamauri/page-to-github)\n[![composer.lock](https://poser.pugx.org/lucamauri/page-to-github/composerlock)](https://packagist.org/packages/lucamauri/page-to-github)\n[![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\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/lucamauri/PageToGitHub.svg)](http://isitmaintained.com/project/lucamauri/PageToGitHub \"Percentage of issues still open\")\n\n## Badges\n\n[![GPL-2.0-or-later License](https://img.shields.io/badge/License-GPL--2.0--or--later-008033?logo=gpl)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)\n[![Built with Visual Studio Code](https://img.shields.io/badge/Built_with-VS_Code-007ACC?logo=visualstudiocode)](https://code.visualstudio.com)\n[![Discuss on StackOverflow](https://img.shields.io/badge/Discuss_on-Stack_Overflow-fe7a16?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/pagetogithub?tab=Active)\n\n# PageToGitHub\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/9/9e/PageToGitHub.svg\" width=\"256\" align=\"left\" /\u003e\n\nPageToGitHub (P2G) is a MediaWiki extension that automatically uploads page content to a GitHub repository on every page save. It listens for the `PageSaveComplete` hook and can be scoped to a specific namespace and an optional keyword that must be present in the page body.\n\nIt was originally conceived and written by [Luca Mauri](https://github.com/lucamauri) for use in [WikiTrek](https://github.com/WikiTrek) and is released as open source in case it is useful to others.\n\n## Features\n\n- Automatically uploads wikitext content to a GitHub repository on page save\n- Configurable namespace filter: only pages in the specified namespace are synced\n- Optional keyword filter: only pages containing a specific string are synced\n- Optional filename prefix: the keyword can be prepended to the uploaded filename\n- Minor edits can be excluded from syncing\n- Upload and commit messages use the wiki's i18n system\n- Special page (`Special:PageToGitHub`) shows the current configuration\n\n## Requirements\n\n- PHP 8.1 or later\n- MediaWiki 1.42 or later\n- A GitHub personal access token with repository write permissions\n- [Composer](https://getcomposer.org/) for dependency management\n\n## Install\n\nThe easiest way to install the extension is using _Composer_: it will automatically resolve and install all dependencies.\n\nAdd the following to `composer.local.json` at the root of your MediaWiki installation (create the file if it does not exist):\n\n```json\n{\n    \"require\": {\n        \"lucamauri/page-to-github\": \"~2.1\"\n    },\n    \"extra\": {\n        \"merge-plugin\": {\n            \"include\": []\n        }\n    },\n    \"config\": {}\n}\n```\n\nThen run Composer from the root of your MediaWiki installation:\n\n```shell\ncomposer install --no-dev\n```\n\nAdd the following line near the rest of the extension loading calls in `LocalSettings.php`:\n\n```php\nwfLoadExtension( 'PageToGitHub' );\n```\n\nThen add the configuration parameters described in the _Configuration_ section below.\n\n## Configuration\n\nAdd the following to `LocalSettings.php`:\n\n```php\n$wgP2GAuthToken    = 'your-github-personal-access-token';\n$wgP2GIgnoreMinor  = true;\n$wgP2GNameSpace    = 'Module';\n$wgP2GOwner        = 'github-username-or-organisation';\n$wgP2GRepo         = 'repository-name';\n$wgP2GKeyword      = '';      // optional\n$wgP2GAddKeyword   = false;   // optional\n```\n\n### `$wgP2GAuthToken`\n\nThe GitHub personal access token used to authenticate API calls. Generate one in your GitHub account under _Settings_ \u003e _Developer settings_ \u003e _Personal access tokens_. The token must have repository write permissions.\n\n### `$wgP2GIgnoreMinor`\n\nWhen set to `true` (the default), page saves flagged as minor edits are not synced to GitHub.\n\n### `$wgP2GNameSpace`\n\nOnly pages belonging to this namespace are synced. Set to the namespace label as a string, e.g. `'Module'`.\n\n### `$wgP2GOwner`\n\nThe GitHub username or organisation that owns the target repository.\n\n### `$wgP2GRepo`\n\nThe name of the GitHub repository where files are uploaded.\n\n### `$wgP2GKeyword`\n\nAn optional keyword string. When set, only pages whose content contains this string are synced. Leave empty (the default) to sync all pages in the configured namespace.\n\n### `$wgP2GAddKeyword`\n\nWhen set to `true` and `$wgP2GKeyword` is non-empty, the keyword is prepended to the uploaded filename, e.g. a page named `Foo` with keyword `bar` is uploaded as `bar-Foo.lua`. Defaults to `false`.\n\n## Troubleshooting\n\nTo read detailed log messages, intercept the [log group](https://www.mediawiki.org/wiki/Manual:$wgDebugLogGroups) named `PageToGitHub` by adding the following to `LocalSettings.php`:\n\n```php\n$wgShowExceptionDetails = true;\n$wgDebugLogGroups['PageToGitHub'] = \"/var/log/mediawiki/PageToGitHub-{$wgDBname}.log\";\n```\n\n## Changelog\n\nSee the [GitHub releases page](https://github.com/lucamauri/PageToGitHub/releases) for the full changelog.\n\n## License\n\nThis extension is released under the [GNU General Public License 2.0 or later](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).\n\n## Maintainers\n\n[Luca Mauri](https://github.com/lucamauri)\n\n## Contributors\n\n[Luca Mauri](https://github.com/lucamauri)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucamauri%2Fpagetogithub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucamauri%2Fpagetogithub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucamauri%2Fpagetogithub/lists"}