User:Cobaltcigs/SectionUrlIcons

Source code:

To activate, call this function some time after the page has loaded: SectionUrlIcons;

Once activated, two icons will appear after each section title:
 * ⚓ The first icon's url should be identical to the corresponding link in the table of contents, if a TOC is present. Loading that url at some future time will scroll to the specified section of the most recent page revision (assuming such a section still exists on the page).
 * ⌚ The second icon's url is the corresponding permalink containing the id of the page revision you are currently viewing. Loading that url in the future will scroll to the specified section of the page, but in the state in which you're viewing it right now. This should never fail (unless the revision is hidden/deleted/oversighted/memory-holed/whatever, or the section title somehow depends upon an unstable template).
 * If you are already viewing a permalink, the two urls will likely be the same.

The script makes no attempt to interact with your system clipboard for ethical reasons and the fact that some browsers won't allow it. So you have to copy the url yourself.

Optionally, you can supply parameters for css and an array of two icons when activating the script: var myCss = "font-size: 17.5px; text-decoration:underline; font-style: italic; border: 1px solid green; font-weight: normal;" var myIcons = ['☠', ''];

SectionUrlIcons(myCss, myIcons); The css rule defaults to. Adjust size to personal preference. I would recommend:
 * 1) Always use an absolute  . Omitting   or supplying relative size such as " " or " " will cause any textual icons to become proportionate to section heading's font-size, and thus different from each other.
 * 2) Keep   because text-based icons for  –  sections will otherwise inherit boldface and look like ass.

The icons default to unicode  and , but may be customized to something else if these metaphors seem unintuitive. I would recommend:
 * 1) Using images or other arbitrary html at your own risk because, though it should work in theory, I have not tested this at all.
 * 2) Escaping characters like   into , if (for some stupid reason) you want to use them in their literal form as icons.