diff options
author | BinHong Lee <binhonglee@users.noreply.github.com> | 2020-01-05 10:24:30 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2020-01-05 19:24:29 +0100 |
commit | 2cfa8d838590d8e6a2df42591f6887a9817be74d (patch) | |
tree | ab52a824bfd1fe774a4139fd266176635d6de25f | |
parent | 9a5aaadda82c5e33d481097c9c15b9c8e54e34c5 (diff) | |
download | Nim-2cfa8d838590d8e6a2df42591f6887a9817be74d.tar.gz |
Allow `-o` option for `buildIndex` (#13037) [backport]
Addressing #12771 This is also included in the docgen documentation [here](https://nim-lang.org/docs/docgen.html) but its not respected as reported in the issue.
-rw-r--r-- | compiler/docgen.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim index f75c16d02..5eaaed120 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -1168,6 +1168,9 @@ proc commandBuildIndex*(cache: IdentCache, conf: ConfigRef) = ["Index".rope, nil, nil, rope(getDateStr()), rope(getClockStr()), content, nil, nil, nil]) # no analytics because context is not available - let filename = getOutFile(conf, RelativeFile"theindex", HtmlExt) + var outFile = RelativeFile"theindex" + if conf.outFile != RelativeFile"": + outFile = conf.outFile + let filename = getOutFile(conf, outFile, HtmlExt) if not writeRope(code, filename): rawMessage(conf, errCannotOpenFile, filename.string) |