mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 04:14:19 +00:00
'nim doc': fixes index generation regression
This commit is contained in:
@@ -863,8 +863,12 @@ proc genOutFile(d: PDoc): Rope =
|
||||
|
||||
proc generateIndex*(d: PDoc) =
|
||||
if optGenIndex in d.conf.globalOptions:
|
||||
let dest = getOutFile2(d.conf, relativeTo(AbsoluteFile d.filename, d.conf.projectPath),
|
||||
IndexExt, RelativeDir"index")
|
||||
let dir = if d.conf.outFile.isEmpty: d.conf.projectPath / RelativeDir"htmldocs"
|
||||
elif optWholeProject in d.conf.globalOptions: AbsoluteDir(d.conf.outFile)
|
||||
else: AbsoluteDir(d.conf.outFile.string.splitFile.dir)
|
||||
createDir(dir)
|
||||
let dest = dir / changeFileExt(relativeTo(AbsoluteFile d.filename,
|
||||
d.conf.projectPath), IndexExt)
|
||||
writeIndexFile(d[], dest.string)
|
||||
|
||||
proc writeOutput*(d: PDoc, useWarning = false) =
|
||||
|
||||
@@ -191,7 +191,7 @@ when true:
|
||||
proc `==`*(x, y: RelativeDir): bool = eqImpl(x.string, y.string)
|
||||
|
||||
proc `/`*(base: AbsoluteDir; f: RelativeFile): AbsoluteFile =
|
||||
assert isAbsolute(base.string)
|
||||
#assert isAbsolute(base.string)
|
||||
assert(not isAbsolute(f.string))
|
||||
result = AbsoluteFile newStringOfCap(base.string.len + f.string.len)
|
||||
var state = 0
|
||||
@@ -199,7 +199,7 @@ when true:
|
||||
canon(f.string, result.string, state)
|
||||
|
||||
proc `/`*(base: AbsoluteDir; f: RelativeDir): AbsoluteDir =
|
||||
assert isAbsolute(base.string)
|
||||
#assert isAbsolute(base.string)
|
||||
assert(not isAbsolute(f.string))
|
||||
result = AbsoluteDir newStringOfCap(base.string.len + f.string.len)
|
||||
var state = 0
|
||||
|
||||
Reference in New Issue
Block a user