mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-21 20:10:44 +00:00
fixes idx properly (#22280)
This commit is contained in:
@@ -591,16 +591,11 @@ proc readIndexDir*(dir: string):
|
||||
if path.endsWith(IndexExt):
|
||||
var (fileEntries, title) = parseIdxFile(path)
|
||||
# Depending on type add this to the list of symbols or table of APIs.
|
||||
if title.kind in {ieNimTitle, ieIdxRole}:
|
||||
|
||||
if title.kind == ieNimTitle:
|
||||
for i in 0 ..< fileEntries.len:
|
||||
if title.kind == ieIdxRole:
|
||||
# Don't add to symbols TOC entries (they start with a whitespace).
|
||||
let toc = fileEntries[i].linkTitle
|
||||
if toc.len > 0 and toc[0] == ' ':
|
||||
continue
|
||||
else:
|
||||
if fileEntries[i].kind != ieNim:
|
||||
continue
|
||||
if fileEntries[i].kind != ieNim:
|
||||
continue
|
||||
# Ok, non TOC entry, add it.
|
||||
setLen(result.symbols, L + 1)
|
||||
result.symbols[L] = fileEntries[i]
|
||||
@@ -618,6 +613,14 @@ proc readIndexDir*(dir: string):
|
||||
title.aux = "doc_toc_" & $result.docs.len
|
||||
result.docs[title] = fileEntries
|
||||
|
||||
for i in 0 ..< fileEntries.len:
|
||||
if fileEntries[i].kind != ieIdxRole:
|
||||
continue
|
||||
|
||||
setLen(result.symbols, L + 1)
|
||||
result.symbols[L] = fileEntries[i]
|
||||
inc L
|
||||
|
||||
proc mergeIndexes*(dir: string): string =
|
||||
## Merges all index files in `dir` and returns the generated index as HTML.
|
||||
##
|
||||
|
||||
@@ -121,7 +121,7 @@ proc parseIdxFile*(path: string):
|
||||
result.fileEntries[f].linkDesc = cols[4].unquoteIndexColumn
|
||||
result.fileEntries[f].line = parseInt(cols[5])
|
||||
|
||||
if result.fileEntries[f].kind in {ieNimTitle, ieMarkupTitle, ieIdxRole}:
|
||||
if result.fileEntries[f].kind in {ieNimTitle, ieMarkupTitle}:
|
||||
result.title = result.fileEntries[f]
|
||||
inc f
|
||||
|
||||
|
||||
Reference in New Issue
Block a user