mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
compiler/[main,docgen]: don't put generated doc in subfolder (#10754)
* compiler/[main,docgen]: don't put generated doc in subfolder
Fixes regression caused by ca4b971bc8.
foo.nim will now generates foo.html instead of foo/foo.html
* compiler/[main,docgen]: map -o to -outdir for project
This reinstantiate the old behavior of -o for project-wide docgen
This commit is contained in:
@@ -992,7 +992,9 @@ proc writeOutputJson*(d: PDoc, useWarning = false) =
|
||||
"\" for writing")
|
||||
|
||||
proc commandDoc*(cache: IdentCache, conf: ConfigRef) =
|
||||
conf.outDir = AbsoluteDir(conf.outDir / conf.outFile)
|
||||
if optWholeProject in conf.globalOptions:
|
||||
# Backward compatibility with previous versions
|
||||
conf.outDir = AbsoluteDir(conf.outDir / conf.outFile)
|
||||
var ast = parseFile(conf.projectMainIdx, cache, conf)
|
||||
if ast == nil: return
|
||||
var d = newDocumentor(conf.projectFull, cache, conf)
|
||||
|
||||
@@ -63,7 +63,9 @@ proc commandCheck(graph: ModuleGraph) =
|
||||
|
||||
when not defined(leanCompiler):
|
||||
proc commandDoc2(graph: ModuleGraph; json: bool) =
|
||||
graph.config.outDir = AbsoluteDir(graph.config.outDir / graph.config.outFile)
|
||||
if optWholeProject in graph.config.globalOptions:
|
||||
# Backward compatibility with previous versions
|
||||
graph.config.outDir = AbsoluteDir(graph.config.outDir / graph.config.outFile)
|
||||
graph.config.errorMax = high(int) # do not stop after first error
|
||||
semanticPasses(graph)
|
||||
if json: registerPass(graph, docgen2JsonPass)
|
||||
|
||||
Reference in New Issue
Block a user