summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndrey Makarov <ph.makarov@gmail.com>2022-04-21 22:06:09 +0300
committerGitHub <noreply@github.com>2022-04-21 15:06:09 -0400
commitbb839029d5065bcd8367661802bf04e1e7eebb58 (patch)
tree73bdbd71348b31d233fb5ec9a1f0d11f0d73fac8 /compiler
parentdc4cc2dca53e3772efb3654a4ddbbe8350d1db43 (diff)
downloadNim-bb839029d5065bcd8367661802bf04e1e7eebb58.tar.gz
Move common Latex code into class nimdoc.cls (#19734)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/docgen.nim6
-rw-r--r--compiler/nimpaths.nim2
2 files changed, 7 insertions, 1 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index aad3b9409..ecf98d0b6 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -1576,7 +1576,11 @@ proc writeOutput*(d: PDoc, useWarning = false, groupedToc = false) =
         outfile.string)
     if not d.wroteSupportFiles: # nimdoc.css + dochack.js
       let nimr = $d.conf.getPrefixDir()
-      copyFile(docCss.interp(nimr = nimr), $d.conf.outDir / nimdocOutCss)
+      case d.target
+      of outHtml:
+        copyFile(docCss.interp(nimr = nimr), $d.conf.outDir / nimdocOutCss)
+      of outLatex:
+        copyFile(docCls.interp(nimr = nimr), $d.conf.outDir / nimdocOutCls)
       if optGenIndex in d.conf.globalOptions:
         let docHackJs2 = getDocHacksJs(nimr, nim = getAppFilename())
         copyFile(docHackJs2, $d.conf.outDir / docHackJs2.lastPathPart)
diff --git a/compiler/nimpaths.nim b/compiler/nimpaths.nim
index 216071c5c..c6e188289 100644
--- a/compiler/nimpaths.nim
+++ b/compiler/nimpaths.nim
@@ -25,11 +25,13 @@ when defined(nimPreviewSlimSystem):
 
 const
   docCss* = "$nimr/doc/nimdoc.css"
+  docCls* = "$nimr/doc/nimdoc.cls"
   docHackNim* = "$nimr/tools/dochack/dochack.nim"
   docHackJs* = docHackNim.changeFileExt("js")
   docHackJsFname* = docHackJs.lastPathPart
   theindexFname* = "theindex.html"
   nimdocOutCss* = "nimdoc.out.css"
+  nimdocOutCls* = "nimdoc.cls"
     # `out` to make it easier to use with gitignore in user's repos
   htmldocsDirname* = "htmldocs"
   dotdotMangle* = "_._"  ## refs #13223