Currently, when the Table of Contents is created the links are built in the table of contents but no anchor is created on the titles.
This pull requests contains an optional feature that allows us to create an anchor with the following format:
<a name="SLUG-GENERATED-BY-THE-PLUGIN"></a>
The anchor is enclosed in the fence-text so it can be updated if the g:vmt_auto_update_on_save option is enabled. So it can be deleted and updated in the same manner as the Table of Contents.
To activate the new anchor creation options we do it by setting the variable:
g:vmt_insert_anchors = 1
Developer notes:
To implement this new feature we modify the return value of the folllowing
function:
function! s:GetHeadingLines()
Now we return an array containing a touple(represented by an array) with
the following content:
["heading", lineNum]
The lineNum represents the position of this heading, so we can later
decide to insert the anchor before the title.
The anchor option supports auto update when enabled.
Currently, when the Table of Contents is created the links are built in the table of contents but no anchor is created on the titles.
This pull requests contains an optional feature that allows us to create an anchor with the following format:
The anchor is enclosed in the
fence-text
so it can be updated if theg:vmt_auto_update_on_save
option is enabled. So it can be deleted and updated in the same manner as the Table of Contents.To activate the new anchor creation options we do it by setting the variable:
Developer notes:
To implement this new feature we modify the return value of the folllowing function:
function! s:GetHeadingLines()
Now we return an array containing a touple(represented by an array) with the following content:
["heading", lineNum]
The lineNum represents the position of this heading, so we can later decide to insert the anchor before the title.
The anchor option supports auto update when enabled.