summary refs log tree commit diff stats
path: root/lib/packages/docutils/rstgen.nim
diff options
context:
space:
mode:
authorDustin Lacewell <dlacewell@gmail.com>2015-01-12 10:53:02 -0800
committerDustin Lacewell <dlacewell@gmail.com>2015-01-12 10:53:02 -0800
commitff941fd489e7340a2138550756572b01774f11ef (patch)
tree4c4ce46d67ec1b0d2eb8516d10ac7cddebf48648 /lib/packages/docutils/rstgen.nim
parent8bdb7fa408b20bc45c15d2ffb02b6a618863d329 (diff)
downloadNim-ff941fd489e7340a2138550756572b01774f11ef.tar.gz
Add named anchor links to procs in the documentation index
Diffstat (limited to 'lib/packages/docutils/rstgen.nim')
-rw-r--r--lib/packages/docutils/rstgen.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim
index 09373ac9e..811ca1c6e 100644
--- a/lib/packages/docutils/rstgen.nim
+++ b/lib/packages/docutils/rstgen.nim
@@ -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