Template:Anchor

From OniGalore
Jump to navigation Jump to search

If you enclose text on a page as a parameter to this template, e.g. {{Anchor|some_anchor_name}}, it creates an invisible HTML span id while still displaying that text on the page as before. This span id can be used as a "jump point" by making a link in any article such as [[Some_article#some_anchor_name]]; upon clicking it, you will be taken directly to the text that you enclosed in {{Anchor|}}.

This is similar to the functionality of the "==Header Name=="-type wiki code that marks section headers, except that it does not display as text and it will not be included in the automatically-generated Table of Contents (TOC) like "=="-type headers will be. For a sample usage of the Anchor template, see the wiki markup for History of the Oni community, which marks the article with year tags so that intrawiki links can jump the user to that year in history by using, for instance, [[History of the Oni Community#2001]].

The original goal in introducing this template was to create a custom TOC based on this invisible section markup that could be used to document raw BSL; however, no simple solution to the issue of how to create a TOC from span ids has been found yet.