-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared.nimble
32 lines (24 loc) · 932 Bytes
/
shared.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
# Package
version = "0.1.0"
author = "genotrance"
description = "Nim library for shared types"
license = "MIT"
skipDirs = @["tests"]
import strformat
const htmldocsDir = "build/htmldocs"
when (NimMajor, NimMinor, NimPatch) >= (0, 19, 9):
import os
proc getNimRootDir(): string =
fmt"{currentSourcePath}".parentDir.parentDir.parentDir
proc runNimDoc() =
exec &"nim doc --path:. -o:{htmldocsDir} --project --index:on shared/seq.nim"
exec &"nim doc --path:. -o:{htmldocsDir} --project --index:on shared/string.nim"
exec &"nim buildIndex -o:{htmldocsDir}/theindex.html {htmldocsDir}"
when declared(getNimRootDir):
exec &"nim js -o:{htmldocsDir}/dochack.js {getNimRootDir()}/tools/dochack/dochack.nim"
task docs, "Generate docs":
runNimDoc()
task docsPublish, "Generate and publish docs":
# Uses: pip install ghp-import
runNimDoc()
exec &"ghp-import --no-jekyll -fp {htmldocsDir}"