Add named anchor links to procs in the documentation index

This commit is contained in:
Dustin Lacewell
2015-01-12 10:53:02 -08:00
parent 8bdb7fa408
commit ff941fd489

View File

@@ -417,8 +417,10 @@ proc generateSymbolIndex(symbols: seq[TIndexEntry]): string =
result = ""
var i = 0
while i < symbols.len:
result.addf("<dt><span>$1:</span></dt><ul class=\"simple\"><dd>\n",
[symbols[i].keyword])
let keyword= symbols[i].keyword
let cleaned_keyword = keyword[1..keyword.high - 1]
result.addf("<dt><a name=\"$2\" href=\"#$2\"><span>$1:</span></a></dt><ul class=\"simple\"><dd>\n",
[symbols[i].keyword, cleaned_keyword])
var j = i
while j < symbols.len and symbols[i].keyword == symbols[j].keyword:
let