diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim
index 8143b46d27..225b272594 100644
--- a/lib/packages/docutils/rstgen.nim
+++ b/lib/packages/docutils/rstgen.nim
@@ -484,12 +484,24 @@ proc generateDocumentationJumps(docs: TIndexedDocs): string =
result.add(chunks.join(", ") & ".
")
+proc generateModuleJumps(modules: seq[string]): string =
+ ## Returns a plain list of hyperlinks to the list of modules.
+ result = "Modules: "
+
+ var chunks: seq[string] = @[]
+ for name in modules:
+ chunks.add("" & name & "")
+
+ result.add(chunks.join(", ") & ".
")
+
proc readIndexDir(dir: string):
- tuple[symbols: seq[TIndexEntry], docs: TIndexedDocs] =
+ tuple[modules: seq[string], symbols: seq[TIndexEntry], docs: TIndexedDocs] =
## Walks `dir` reading ``.idx`` files converting them in TIndexEntry items.
##
- ## Returns the list of free symbol entries and the separate documentation
- ## indexes found. See the documentation of ``mergeIndexes`` for details.
+ ## Returns the list of found module names, the list of free symbol entries
+ ## and the different documentation indexes. The list of modules is sorted.
+ ## See the documentation of ``mergeIndexes`` for details.
+ result.modules = @[]
result.docs = initTable[TIndexEntry, seq[TIndexEntry]](32)
newSeq(result.symbols, 15_000)
setLen(result.symbols, 0)
@@ -530,11 +542,14 @@ proc readIndexDir(dir: string):
for i in 0 ..