Wiki to Git (wiki2git)

Start time: 
Tuesday, 11 July, 2023

Wiki to Git (or wiki2git) is a tool that helps to download MediaWiki page history and push it to a Git repository. Essentially each edit becomes a commit. And having code outside of MediaWiki can help developing a Wikipedia gadget (or a user script).

Once you have a Git repository you can of course brag about your activity on GitHub 😉. But that's not all. You can then start using external tools to easily edit code and to analyze history of the gadget (so use tools like eslint and git blame). You can also test easier with things like Mocha/Chai. You can also use build tools like Browserify or Webpack for larger gadgets.

When you are done developing new stuff, you can use Wikiploy to deploy your gadget back to Wikipedia. Wikiploy will also help in deploying dev/test versions to your user space.

Technical highlights:

  1. Preservers authors and dates of the original page.
  2. You can download JS and CSS separately and the history will sort itself when you push your repo to GitHub.
  3. Supports saving history as JSON. This allows downloading histories of two page and merging them. Can be useful to merge history of a user script that was later copied to a gadget without preserving history.

Links

License:

Supported languages:

Technologies: