Jump to content

User:Anchor Link Bot

From Wikipedia, the free encyclopedia

If you are wondering what this bot is doing/supposed to be doing, please read the comment Zundark made, which describes it quite clearly below:

Editors who change the title of the section (or remove the section entirely) will see the comment. And they are the only ones who need to see it, because it's only their edits that will break the link to the section, and it's only they who need to go to the linking article and fix or remove the link. "What links here" doesn't serve this function - nobody's going to wade through hundreds of linking articles to see if their changed section title has broken any links. --Zundark 18:36, 2 July 2007 (UTC)

A longer and more vebose explanation can be found below. Also consider reading WP:MOS#Section_management for more details.

The C source is public domain. If anyone is interested, tell me on my talk page and I'll update and post a link here. (Latest revision as of June 26 can be found here)

Longer explanation

[edit]

Headings in Wikipedia articles (also known as section titles) serve an additional function: they can be used as 'targets' for links, like this: User:Anchor Link Bot#Longer explanation. Such links take readers straight to a specific section of the article, instead of to the top of the article — similar to the way named anchors work in HTML.

Links that contain this heading information present a problem: If the heading name is changed, the link pointing to it will no longer work as intended. The link will still bring the reader to the article page, but not to a specific section.

This bot aims to prevent the problem by looking for internal links that contain this header information. When it finds such links, it adds an HTML comment to that heading. The idea is that an editor who changes such a heading can easily find and fix the relevant 'targeted' links. Ordinary readers will never see these comments; they are only visible while editing the article.

Even better, if/when the bot has gone over our existing article base, we can be fairly sure that headings without tags can safely be changed, deleted, etc, allowing us to be a little bit more bold about restructuring articles.