Making an anchor to another heading in the same file as the anchor is straightforward.
[The header of this page](#same-file-anchors-for-github)
Will show as The header of this page.
The heading should be downcased, spaces changed to hyphens, and removed anything not a letter, hyphen, or space. If this id is not unique, you add "-1", "-2", and so forth to the header.