-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrfmt.nimble
42 lines (33 loc) · 1.14 KB
/
strfmt.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
# Package
version = "0.11.0"
author = "Frank Fischer"
description = "A string formatting library inspired by Python's `format`"
license = "MIT"
# Dependencies
requires "nim >= 0.19.0"
import ospaths # for `/`
let
pkgName = "strfmt"
orgFile = "docs" / (pkgName & ".org")
rstFile = "docs" / (pkgName & ".rst")
rstFileAuto = "docs" / (pkgName & "_autogen.rst")
rstFileOrig = "docs" / (pkgName & "_orig.rst")
htmlFileNimDoc = pkgName & ".html"
htmlFileIndex = "docs" / "index.html"
# Cannot use "doc" as a task name as it's one of the inbuilt switches
# for nimble.
task docs, "Generate HTML docs using the Org file":
# https://github.com/jgm/pandoc/issues/4749
exec "pandoc " & orgFile & " -o " & rstFile
exec "nim doc " & pkgName
mvFile rstFile, rstFileAuto
mvFile htmlFileNimDoc, htmlFileIndex
task docsrst, "Generate HTML docs using the original rst file (not maintained)":
cpFile rstFileOrig, rstFile
exec "nim doc " & pkgName
rmFile rstFile
mvFile htmlFileNimDoc, htmlFileIndex
task test, "Runs the tests in " & pkgName & ".nim":
rmDir "nimcache"
exec "nim c -r " & pkgName
# https://nim-lang.org/docs/nimscript.html