forked from can-lehmann/owlkettle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
owlkettle.nimble
50 lines (39 loc) · 1.47 KB
/
owlkettle.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
48
49
50
version = "2.2.0"
author = "Can Joshua Lehmann"
description = "A declarative user interface framework based on GTK"
license = "MIT"
requires "nim >= 1.6.0"
import std/strutils
proc findExamples(path: string): seq[string] =
for file in listFiles(path):
if file.endsWith(".nim"):
result.add(file)
for dir in listDirs(path):
result.add(findExamples(dir))
task examples, "Build examples":
withDir "examples":
for file in findExamples("."):
echo "INFO: Compile " & file
exec "nim c --hints:off --verbosity:0 " & file
echo "INFO: OK"
echo "================================================================================"
task genDocs, "Generate owlkettle wigets.md file from widgets.nim":
exec "make -C docs"
task setupBook, "Compiles the nimibook CLI-binary used for generating the docs":
exec "nimble install -y nimib@#head nimibook@#head [email protected]"
exec "nim c -d:release --mm:refc nbook.nim"
task genBook, "Generate the owlkettle nimibook book docs":
exec "nimble setupBook"
echo "BOOK-CLI-GENERATED"
exec "nimble genDocs"
echo "WIDGETS-DOCS-GENERATED"
exec "./nbook --mm:refc init"
echo "INITIALIZED NIMIBOOK"
try:
exec "./nbook build --mm:refc --define:owlkettleNimiDocs "
echo "BUILT NIMIBOOK"
except CatchableError:
discard
## Needed as the nimibook will serve the copied images, while the raw md files
## in the repository will serve the originals
exec "cp -r ./docs/assets ./compiledBook/docs"