summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorSergey Avseyev <sergey.avseyev@gmail.com>2018-09-28 16:08:43 +0300
committerSergey Avseyev <sergey.avseyev@gmail.com>2018-09-29 23:24:57 +0300
commitc1f677a7c96071a20d93a37f05e29f32e9eaf368 (patch)
tree478caa2a0a2d78849c6b62f56429e5a184cd28cd /compiler
parent57d0ff385c7ed7bee98b7a14785d2ce7e660c3b8 (diff)
downloadNim-c1f677a7c96071a20d93a37f05e29f32e9eaf368.tar.gz
fix extension passing for rst2tex command
Diffstat (limited to 'compiler')
-rw-r--r--compiler/docgen.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 664f45c79..952e63888 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -112,7 +112,7 @@ proc getOutFile2(conf: ConfigRef; filename: RelativeFile,
   else:
     result = getOutFile(conf, filename, ext)
 
-proc newDocumentor*(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef): PDoc =
+proc newDocumentor*(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef, outExt: string = HtmlExt): PDoc =
   declareClosures()
   new(result)
   result.conf = conf
@@ -146,7 +146,7 @@ proc newDocumentor*(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef):
                warnUser, "only 'rst2html' supports the ':test:' attribute")
   result.emitted = initIntSet()
   result.destFile = getOutFile2(conf, relativeTo(filename, conf.projectPath),
-                                HtmlExt, RelativeDir"htmldocs", false)
+                                outExt, RelativeDir"htmldocs", false)
   result.thisDir = result.destFile.splitFile.dir
 
 proc dispA(conf: ConfigRef; dest: var Rope, xml, tex: string, args: openArray[Rope]) =
@@ -960,7 +960,7 @@ proc commandDoc*(cache: IdentCache, conf: ConfigRef) =
 proc commandRstAux(cache: IdentCache, conf: ConfigRef;
                    filename: AbsoluteFile, outExt: string) =
   var filen = addFileExt(filename, "txt")
-  var d = newDocumentor(filen, cache, conf)
+  var d = newDocumentor(filen, cache, conf, outExt)
   d.onTestSnippet = proc (d: var RstGenerator; filename, cmd: string;
                           status: int; content: string) =
     var outp: AbsoluteFile