Skip to content
enterprisey edited this page Jan 16, 2021 · 4 revisions

Note: This guide has been superseded by Wikipedia:WikiProject Articles for creation/Helper script/Contributing but may still contain helpful information.

Note: This guide is written for newcomers to the open source world, but it does assume basic knowledge of the workings of Wikipedia. The Getting Started guide to Wikipedia may be a useful resource for those new to the encyclopedia.

You want to contribute to the Articles for Creation Helper Script? Awesome, we're excited to have your support! Since AFCH is open source, anyone can contribute – we welcome all constructive changes, large and small.

Prerequisites

In order to contribute to AFCH, you'll need to have a few things set up first:

  1. Your own GitHub account (create it!). No worries, it's 100% free and can be used to contribute to hundreds of thousands of open source projects from around the globe.
  2. git installed and configured on your computer. Here's a handy guide.

If you wish to be able to test your code (which, of course, one should definitely do) you will also need:

  1. node installed on your machine. Download it here.
  2. gruntjs installed as well. How-to.

Additionally, we highly recommend creating an account on the English Wikipedia so that you can test and use the helper script. Once you have an account, you can install the helper script (see How to install AFCH on the English Wikipedia).

Fork the repository from GitHub

afch-rewrite is a typical git repository hosted on GitHub, which means that you can fork it, make changes, and finally submit pull requests with said changes.

If you need help getting set up with git or GitHub, check out the GitHub Help Center, and don't hesitate to get in touch if you still have questions.

Testing your changes

Well, that's great and all, but how on earth do you actually test your changes? No worries, we have you covered.

Assuming that you have a Wikipedia account, you can set up your own personal copy of the helper script in your userspace. This way, you can make changes, upload them to Wikipedia, and then instantly test them out... without affecting other users.

  • From the main afch-rewrite directory in your terminal, run the following command, replacing YOUR_WIKIPEDIA_USERNAME with your username, and YOUR_WIKIPEDIA_PASSWORD with... drumroll... your password.
  • python scripts/upload.py enwiki User:YOUR_WIKIPEDIA_USERNAME/afch-rewrite YOUR_WIKIPEDIA_USERNAME YOUR_WIKIPEDIA_PASSWORD
  • You just uploaded your own personal copy of the helper script to Wikipedia. The root file can be found at the page "User:YOUR_WIKIPEDIA_USERNAME/afch-rewrite.js" on Wikipedia.
  • In order to configure your account to load and use this script, you'll need to edit the page "User:YOUR_WIKIPEDIA_USERNAME/common.js" and add the following line:
  • importScript('User:YOUR_WIKIPEDIA_USERNAME/afch-rewrite.js');

And you're set! You now have an exact clone of AFCH as it is on your computer running on Wikipedia. You'll probably want to disable the default AFCH that you installed previously, so that you don't have multiple versions running at once – that can get confusing quickly.

So, now that you have AFCH installed, where and how can you test your changes? There is a dedicated page set up for testing the helper script, Wikipedia talk:Articles for creation/sandbox. Launch your custom AFCH as normal, and proceed to test away!

Every time you make a change that you want to test on Wikipedia, re-upload the script by running the upload.py script as before.

Submitting your changes for review

Have you made a change to the tool that you're ready to submit for review? Awesome, you should make a pull request to the main afch-rewrite repository with your changes (see Creating a Pull Request).

Need clarification? Still have some questions?

Please don't hesitate to ask. You can always leave a comment on an issue, or ping us on IRC in the #wikipedia-en-afc channel. Looking forward to your contributions!