Template:Seclink/doc

Usage
The latter three are optional, so you can just use  if you want it to always link to a section on the page it's on. Example:  produces.

Note that it will look weird when linking to pages that you're creating if you use the "show preview" button, but will appear fine when the page is published.