Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jan 15, 2020
1 parent e952dad commit f4e8e42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 8 additions & 10 deletions compiler/docgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1069,19 +1069,17 @@ proc writeOutput*(d: PDoc, useWarning = false) =
else:
template outfile: untyped = d.destFile
#let outfile = getOutFile2(d.conf, shortenDir(d.conf, filename), outExt, "htmldocs")
let dir = outfile.`$`.parentDir
createDir(dir)
createDir(outfile.splitFile.dir)
d.conf.outFile = outfile.extractFilename.RelativeFile
if not writeRope(content, outfile):
rawMessage(d.conf, if useWarning: warnCannotOpenFile else: errCannotOpenFile,
outfile.string)
else:
if not d.wroteCss:
let cssSource = $d.conf.getPrefixDir() / "doc" / "nimdoc.css"
let cssDest = $d.conf.outDir / "nimdoc.out.css"
# renamed to make it easier to use with gitignore in user's repos
copyFile(cssSource, cssDest)
d.wroteCss = true
d.conf.outFile = outfile.extractFilename.RelativeFile
elif not d.wroteCss:
let cssSource = $d.conf.getPrefixDir() / "doc" / "nimdoc.css"
let cssDest = $d.conf.outDir / "nimdoc.out.css"
# renamed to make it easier to use with gitignore in user's repos
copyFile(cssSource, cssDest)
d.wroteCss = true

proc writeOutputJson*(d: PDoc, useWarning = false) =
runAllExamples(d)
Expand Down
4 changes: 1 addition & 3 deletions compiler/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,9 @@ proc mainCommand*(graph: ModuleGraph) =
let key = lineinfos.WarningsToStr[ord(a) - ord(warnMin)]
warnings[key] = %(a in conf.notes)

let prefixDir = conf.getPrefixDir()

var dumpdata = %[
(key: "version", val: %VersionAsString),
(key: "prefixdir", val: %prefixDir.string),
(key: "prefixdir", val: %conf.getPrefixDir().string),
(key: "project_path", val: %conf.projectFull.string),
(key: "defined_symbols", val: definedSymbols),
(key: "lib_paths", val: %libpaths),
Expand Down

0 comments on commit f4e8e42

Please sign in to comment.