Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link colours #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Link colours #3

wants to merge 2 commits into from

Conversation

Seb35
Copy link

@Seb35 Seb35 commented Sep 2, 2014

This adds the feature about the colour of the links – red or blue – at the time of the Memento.

It has been quickly tested on one example (so more testing is probably needed), and more work is needed for the details (see @fixme: green and blue italics colours, and deleted-then-recreated links, and check the parser cache status about the link colours).

I will understand if you prefer not to merge now, to check the parser cache status and wait more testing. In any case, I will try to continue to work on this feature. As a side note, I plan to incoporate the work I did on my extension BackwardsTimeTravel into Memento https://www.mediawiki.org/wiki/Extension:BackwardsTimeTravel#Deprecation.

Seb35 added 2 commits August 29, 2014 19:49
If the Memento date is before the creation of a page or
a template, the links will be red.
@shawnmjones
Copy link
Contributor

I'm very intrigued by this functionality, and would like to understand the reasoning behind it.

Is the idea that nonexistent pages (by default red links) will be red rather than blue, seeing as they hadn't been created at the time of the Memento?

@Seb35
Copy link
Author

Seb35 commented Sep 3, 2014

Yes, it’s this reasoning.

For example, on a page "Example":

  • T1: page Example is created with "[[Link]] {{Template:Template}}", where the pages Link and Template:Template don’t exist
  • T2: page Link is created (whatever its content)
  • T3: page Template:Template is created (whatever its content)

With this patch:

  • if the Memento of page Example is between T1 and T2, the link to page Link will be red (currently it is blue, because the page Link exists at present time),
  • if the Memento of page Example is between T1 and T3, the transclusion of Template:Template will not be done and a red link will be displayed instead (currently the first version of the template is displayed) ; the $skip parameter is set to true to avoid transcluding the template, and the first case will change the colour to red.

This patch/feature requires more DB accesses (check the existence of each pages), so perhaps a tuning parameter could/should be added to let sysadmins control the load. (The $skip feature doesn’t need additional resources, probably even a bit less.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants