forked from pietroppeter/nimibook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnimibook.nimble
47 lines (36 loc) · 1.22 KB
/
nimibook.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Package
version = "0.3.1"
author = "Pietro Peterlongo"
description = "A port of mdbook to nim"
license = "MIT"
srcDir = "src"
# Dependencies
requires "nim >= 1.4.0"
requires "nimib >= 0.3.7"
requires "jsony >= 1.1.5"
import os
task genbook, "build book":
selfExec(" r -d:release nbook.nim init")
selfExec(" r -d:release nbook.nim build")
task dumpbook, "dump book.json":
selfExec(" r -d:release nbook.nim dump")
task cleanbook, "remove all files created during build":
selfExec(" r -d:release nbook.nim clean ")
task srcpretty, "run nimpretty on nim files in src folder":
for file in walkDirRec("src"):
if file.endsWith(".nim"):
let cmd = "nimpretty --maxLineLen:160 " & file
echo "[executing] ", cmd
exec(cmd)
task test_example, "test commands with example book":
withDir("examplebook"):
let cmd = "nim r -d:release --verbosity:0 --hints:off examplebook "
exec cmd & "init"
exec cmd & "build"
exec cmd & "check"
task clean_example, "remove directories created for example book":
withDir("examplebook"):
let cmd = "nim r -d:release --verbosity:0 --hints:off examplebook "
exec cmd & "clean"
rmDir "examplebook/mybook"
rmDir "examplebook/mydocs"