Updated Using nimscript for configuration (markdown)
This commit is contained in:
parent
82db924b99
commit
aeee691dcc
|
@ -1,4 +1,6 @@
|
|||
The [nimscript docs](https://nim-lang.org/docs/nimscript.html) describe the nimscript API, but I needed some help on how to use it. (Most of the following applies to nimble too, but let's concentrate on nimscript for now.)
|
||||
The [nimscript docs](https://nim-lang.org/docs/nimscript.html) describe the nimscript API, but I needed some help on how to use it. (Note: [these docs](https://nim-lang.org/docs/nims.html) are better.)
|
||||
|
||||
(Most of the following applies to nimble too, but let's concentrate on nimscript for now.)
|
||||
|
||||
### Example
|
||||
Suppose you have a scrDir like this:
|
||||
|
@ -37,5 +39,6 @@ Instead, run **nim** on `foo.nim` like this:
|
|||
|
||||
nim newtask foo
|
||||
nim mybuild -d:debug foo
|
||||
nim tasks foo # to see a list of available tasks
|
||||
|
||||
All the [standard `.cfg` files](https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files) are read *before* your nimscript. You can use `include` to avoid repeating code for each tool-specific `.nims` file. That's not quite as convenient as a global `nim.cfg` file, but it's more flexible.
|
||||
All the [standard `.cfg` files](https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files) are read *before* your nimscript. You can use `include` to avoid repeating code for each tool-specific `.nims` file. You can also use a directory-global `config.nims` nimscript, similar to `nim.cfg`.
|
Loading…
Reference in New Issue