-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnimitheme.nimble
46 lines (33 loc) · 1009 Bytes
/
nimitheme.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
import std/os
# Package
version = "0.4.0"
author = "niko"
description = "Make nimib look beautiful with nimitheme"
license = "MIT"
srcDir = "src"
# Tasks
task readme, "Build readme for nimitheme":
exec "nim r -d:readme docsrc/index.nim"
task index, "Build index.html for nimitheme":
exec "nim r docsrc/index.nim"
task ri, "Build both index.html and readme for nimitheme":
readmeTask()
indexTask()
task docs, "Build theme docs for nimitheme":
var theme: string
block:
if commandLineParams()[^1] in ["docs", "*"]:
selfExec"r docsrc/compile_all.nim"
break
else:
theme = "docsrc/themes/" & commandLineParams()[^1]
exec "nim r docsrc/index.nim"
if dirExists(theme):
for file in walkDirRec(theme):
if file.extractFilename() notin ["gendoc.nim"] and file.splitFile().ext == ".nim":
exec "nim r " & file
else:
exec "nim r " & theme
# Dependencies
requires "nim >= 1.4.0"
requires "nimib"