While in HTML the purpose of anchors is mostly for jumping to a position in the text, in PmWiki they serve an internal purpose, too: Each anchor also creates a section, because sections are defined as the part of the page between their start anchor and the next anchor. A section name is defined as the name of its start anchor.
Usage scenarios for sections include:
RetrieveAuthSection()
function.
Rules for valid section names are by definition the same as for anchors (described in Links#anchors), but in practice there are some additional limitations:
(:include:)
command and RetrieveAuthSection()
can use it as an end anchor but not as a start anchor.
You can try some experiments on the Test.ExoticSectionNames? page or even just its preview.
Beware of subtle differences:
(:include:)
command, it reads from the beginning of the line that has the anchor and will include the [[#anchor]]
markup, which results in an HTML anchor being generated.
RetrieveAuthSection()
will start reading text from exactly after the mid-line start anchor.
RetrieveAuthSection()
behaves the same as the (:include:)
command, about which Include Other Pages warns: It will stop reading at the beginning of the line that has the end anchor, so the last thing included will be the end of line character from the line before the end marker.
(:include:)
command, end the line before the end anchor with a line joiner (backslash).
This page may have a more recent version on pmwiki.org: PmWiki:PageSections, and a talk page: PmWiki:PageSections-Talk.