reFill (formerly Reflinks) is a tool for Wikipedia that adds information (page title, work/website, author and publication date, etc.) to bare references semi-automatically. This is a rewrite of the closed-source original tool by Dispenser. A live version is running on WMF Labs, and there is also an experimental version, automatically pulled from the latest commit.
For backwards compatibility, the source code of the tool still refers to itself as "Reflinks". This is intentional.
Setting up your reFill instance is fairly simple. You will need Composer to install the dependencies. First, clone this repo with:
git clone --recursive https://github.com/zhaofengli/refill.git
The complete source code of reFill will be cloned in the
cd into it, and:
php composer.phar install
This will fetch the required libraries for you. That's it, you now have a working copy of reFill! Fire up a server in
web and start hacking!
After setting up reFill, you may wish to add your local wiki for testing. To do so, create
config/config.php and insert:
<?php $config['wikis']['mywiki'] = array( "identifiers" => array( // A list of wikis of this type "wmflike", "baremw", ), "api" => "http://localhost/%id%/api.php", "indexphp" => "http://localhost/%id%/index.php", );
baremw should appear on the main page, pointing at
For some simple customizations, use:
// Default edit summary for the generated edit // Use %numfixed% to show how many references are fixed, and %numskipped% for skipped. $config['summary'] = "Filled in %numfixed% bare reference(s) with reFill";
You can also add a banner to notify users about updates, as well as to extend the default footer. Implement global functions
rlFooter() which return the HTML code of the banner/footer.
There are more configuations available, please check out
src/config.default.php for details.
Making it local
By default, the tool uses the wDiff library from Cacycle's user page on English Wikipedia.
For easy offline development, you may want to download a copy of the script from the above link and store it in
scripts/diff.js. This file is ignored by git.
Beware though, you won't get updates of wDiff automatically in this way.
To enable the local version, insert this into
$config['wdiff'] = "scripts/diff.js";
The program includes an incomplete set of unit tests under
tests, which can be run with PHPUnit. Please help cover untested code by adding new tests.
Tool Labs-specific configurations
The Tool Labs version uses its own set of configurations, which reside on zhaofengli/refill-labsconf. You can
citoid.php in the repo from your
config.php to replicate the Tool Labs configurations on your local instance.
Patches are always welcome! To contribute, simply create a fork of the repo, make your changes and submit a pull request. Thank you for your contributions!
Localisation of the tool is powered by Intuition and handled on translatewiki.net. To start translating the tool, please register at translatewiki.net and request to become a Translator. You can also submit your translations manually via GitHub pull requests or even on-wiki.
reFill is licensed under the BSD 2-Clause License. See
LICENSE for details.
The Bootstrap theme used is Yeti.
You may want to run
composer licenses to list the licenses of all Composer dependencies.