nimpaths

Represents absolute paths, but using a symbolic variables (eg $nimr) which can be resolved at runtime; this avoids hardcoding at compile time absolute paths so that the project root can be relocated.

xxx consider some refactoring with $nim/testament/lib/stdtest/specialpaths.nim; specialpaths is simpler because it doesn't need variables to be relocatable at runtime (eg for use in testament)

interpolation variables:
$nimr: such that $nimr/lib/system.nim exists (avoids confusion with $nim binary)
in compiler, it's obtainable via getPrefixDir(); for other tools (eg koch),
this could be getCurrentDir() or getAppFilename().parentDir.parentDir, depending on use case

Unstable API

Consts

docCss = "$nimr/doc/nimdoc.css"
Source Edit
docHackNim = "$nimr/tools/dochack/dochack.nim"
Source Edit
docHackJs = "$nimr/tools/dochack/dochack.js"
Source Edit
docHackJsFname = "dochack.js"
Source Edit
theindexFname = "theindex.html"
Source Edit
nimdocOutCss = "nimdoc.out.css"
Source Edit
htmldocsDirname = "htmldocs"
Source Edit
dotdotMangle = "_._"
refs #13223 Source Edit

Procs

proc interp(path: string; nimr: string): string {...}{.raises: [ValueError], tags: [].}
Source Edit
proc getDocHacksJs(nimr: string; nim = getCurrentCompilerExe();
                   forceRebuild = false): string {...}{.raises: [ValueError],
    tags: [ReadDirEffect, ExecIOEffect].}
return absolute path to dochack.js, rebuilding if it doesn't exist or if forceRebuild. Source Edit

© 2006–2021 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/compiler/nimpaths.html