User:Nathan Larson/Red-green-blue project

The red-green-blue project is a project to make wikilinks appear different colors depending on the pointed-to page's existence on the local wiki and on Wikipedia.

Purpose
This tool will be useful for having articles whose wikilinks reference articles that may have been deleted from Wikipedia, or not yet added there. It is anticipated that there might only be two major wikis to fulfill most encyclopedic needs; namely this wiki and Wikipedia.

Specifications
This project involves making wikilinks appear differently, for instance as follows:
 * Red link – page exists neither on this wiki, nor on Wikipedia
 * Orange link – blanked page exists on this wiki; no page with this title exists on Wikipedia
 * Yellow link – page does not exist on this wiki; blanked page exists on Wikipedia
 * Green link – page does not exist on this wiki, but it exists on Wikipedia
 * Blue link – page exists on this wiki, but it does not exist on Wikipedia
 * Purple link – page exists on both this wiki and Wikipedia

(The current scheme, of course, is a blue link if the page exists on this wiki and a red link if it does not.)

Other colors may be used as well to indicate that a page used to exist, but was deleted; etc. This is not as high a priority, however.

Customization

 * Legible and differentiable colors should be set as defaults, and it should be possible to modify the defaults, and for each user to modify the color scheme in their user preferences.
 * It should be possible to configure the system so that wikilink color will reveal page existence on more than one other external wiki in addition to the local wiki; or based on two or more external wikis without regard to the local wiki; or based on only one external wiki without regard to the local wiki.

Behavior of a clicked wikilink
The behavior of a clicked wikilink can vary based on user preferences. Obviously, an orange or blue clicked wikilink will go to the corresponding page on this wiki; and a green clicked wikilink will go to the corresponding page on Wikipedia. A red clicked wikilink, presumably, will default to create a new article on this wiki; although the user might specify that it could default to create a new article on Wikipedia, or that it could ask the user where he wants to create a new article.

Any number of possibilities exist for purple clicked wikilinks, e.g.:
 * Visit the corresponding page on Wikipedia
 * Visit the corresponding page on this wiki
 * Ask the user whether he wants to visit the corresponding page on Wikipedia or on this wiki
 * Visit the longer of the two pages (presumably the longer page has more developed content)

Implementation
A list of all pages on an external wiki will likely need to be established and maintained in current status. In parsing the wikilinks in a page, the name will be checked against the list of pages on the local wiki and against the list of pages on the external wiki. The color will be set accordingly.