compiler/nimpaths

  Source   Edit

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 factor pending https://github.com/timotheecour/Nim/issues/616, see also $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
docHackJs = "$nimr/tools/dochack/dochack.js"
  Source   Edit
docHackJsFname = "dochack.js"
  Source   Edit
docHackNim = "$nimr/tools/dochack/dochack.nim"
  Source   Edit
dotdotMangle = "_._"
refs #13223   Source   Edit
htmldocsDirname = "htmldocs"
  Source   Edit
nimdocOutCss = "nimdoc.out.css"
  Source   Edit
theindexFname = "theindex.html"
  Source   Edit

Procs

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
proc interp(path: string; nimr: string): string {....raises: [ValueError], tags: [].}
  Source   Edit