aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2018-05-04 16:10:03 -0500
committerGanesh Viswanathan <dev@genotrance.com>2018-05-04 16:10:03 -0500
commit335e3ac28a8696b954d4ee508c9b072995a8eace (patch)
tree23153ba64424f0d51e06c3d0afdf866cbaa5dc26
parent6d0abefe8a3c3bb060941cd664fc66dc3cefbd21 (diff)
downloadnimgen-335e3ac28a8696b954d4ee508c9b072995a8eace.tar.gz
nimgen-335e3ac28a8696b954d4ee508c9b072995a8eace.zip
Generate documentation
-rw-r--r--.gitignore3
-rw-r--r--tests/nimgentest.nims53
2 files changed, 45 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index f722c38..3f2ed5c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
nimcache
nimgen
+web
*.exe
-*.swp \ No newline at end of file
+*.swp
diff --git a/tests/nimgentest.nims b/tests/nimgentest.nims
index 1a9d652..41d64e9 100644
--- a/tests/nimgentest.nims
+++ b/tests/nimgentest.nims
@@ -2,17 +2,50 @@ import distros
import ospaths
import strutils
+var full = false
var comps = @["libsvm", "nimbass", "nimbigwig", "nimfuzz", "nimrax", "nimssl", "nimssh2"]
if detectOs(Windows):
- comps.add("nimkerberos")
+ comps.add("nimkerberos")
+
+if paramCount() > 2:
+ for i in 3 .. paramCount():
+ if paramStr(i) == "--full":
+ full = true
+ elif paramStr(i).len() > 10 and "--comps=" in paramStr(i)[0 ..< 8]:
+ comps = paramStr(i)[8 .. ^1].split(",")
for comp in comps:
- if dirExists(".."/comp):
- exec "nimble uninstall -y " & comp, "", ""
- withDir(".."/comp):
- rmDir(comp)
- exec "nimble install -y"
- exec "nimble test"
-
- exec "nimble install -y"
- exec "nimble test"
+ if not dirExists(".."/comp):
+ withDir(".."):
+ exec "git clone --depth=1 https://github.com/genotrance/" & comp
+
+ exec "nimble uninstall -y " & comp, "", ""
+ withDir(".."/comp):
+ exec "git pull"
+
+ if full:
+ rmDir(comp)
+
+ exec "nimble install -y"
+ exec "nimble test"
+
+ exec "nimble install -y"
+ exec "nimble test"
+
+ if dirExists("web"/comp):
+ rmDir("web"/comp)
+
+ mkDir("web"/comp)
+ for file in listFiles(".."/comp/comp) & listFiles(".."/comp):
+ if file.splitFile().ext == ".nim":
+ cpFile(file, "web"/comp/extractFilename(file))
+
+ cpFile("web"/"nimdoc.cfg", "web"/comp/"nimdoc.cfg")
+ withDir("web"/comp):
+ for file in listFiles("."):
+ if file.splitFile().ext == ".nim":
+ exec "nim doc --git.url:. --index:on -o:" & file.changeFileExt("html") & " " & file
+ exec "pygmentize -f html -O full,linenos=1,anchorlinenos=True,lineanchors=L,style=vs -o " & file & ".html " & file
+
+ exec "nim buildIndex -o:index.html ."
+ rmFile("web"/comp/"nimdoc.cfg")