Pygmentize only

This commit is contained in:
Ganesh Viswanathan 2018-11-04 16:19:54 -06:00
commit d6241b1da4

View file

@ -1,7 +1,7 @@
import distros, ospaths, strutils import distros, ospaths, strutils
var var
full = true pygonly = false
comps = @["libsvm", "nim7z", "nimarchive", "nimbass", "nimbigwig", comps = @["libsvm", "nim7z", "nimarchive", "nimbass", "nimbigwig",
"nimclipboard", "nimfuzz", "nimmonocypher", "nimclipboard", "nimfuzz", "nimmonocypher",
"nimnuklear", "nimpcre", "nimrax", "nimssl", "nimssh2", "nimnuklear", "nimpcre", "nimrax", "nimssl", "nimssh2",
@ -27,44 +27,47 @@ for comp in comps:
if paramCount() > 2: if paramCount() > 2:
for i in 3 .. paramCount(): for i in 3 .. paramCount():
if paramStr(i) == "--full": if paramStr(i) == "--pygonly":
full = true pygonly = true
elif paramStr(i).len() > 10 and "--comps=" in paramStr(i)[0 ..< 8]: elif paramStr(i).len() > 10 and "--comps=" in paramStr(i)[0 ..< 8]:
comps = paramStr(i)[8 .. ^1].split(",") comps = paramStr(i)[8 .. ^1].split(",")
for comp in comps: for comp in comps:
if not dirExists(".."/comp): if not pygonly:
withDir(".."): if not dirExists(".."/comp):
exec "git clone --depth=1 https://github.com/genotrance/" & comp withDir(".."):
exec "git clone --depth=1 https://github.com/genotrance/" & comp
exec "nimble uninstall -y " & comp, "", "" exec "nimble uninstall -y " & comp, "", ""
withDir(".."/comp): withDir(".."/comp):
exec "git pull" exec "git pull"
if full:
rmDir(comp) rmDir(comp)
exec "nimble install -y" exec "nimble install -y"
exec "nimble test" exec "nimble test"
exec "nimble install -y" exec "nimble install -y"
exec "nimble test" exec "nimble test"
when defined(windows): when defined(windows):
if dirExists("web"/comp): if not pygonly:
rmDir("web"/comp) if dirExists("web"/comp):
rmDir("web"/comp)
mkDir("web"/comp) mkDir("web"/comp)
for file in listFiles(".."/comp/comp) & listFiles(".."/comp): for file in listFiles(".."/comp/comp) & listFiles(".."/comp):
if file.splitFile().ext == ".nim": if file.splitFile().ext == ".nim":
cpFile(file, "web"/comp/extractFilename(file)) cpFile(file, "web"/comp/extractFilename(file))
cpFile("web"/"nimdoc.cfg", "web"/comp/"nimdoc.cfg") cpFile("web"/"nimdoc.cfg", "web"/comp/"nimdoc.cfg")
withDir("web"/comp): withDir("web"/comp):
for file in listFiles("."): for file in listFiles("."):
if file.splitFile().ext == ".nim": if file.splitFile().ext == ".nim":
exec "nim doc --git.url:. --index:on -o:" & file.changeFileExt("html") & " " & file if not pygonly:
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 "pygmentize -f html -O full,linenos=1,anchorlinenos=True,lineanchors=L,style=vs -o " & file & ".html " & file
exec "nim buildIndex -o:index.html ." if not pygonly:
exec "nim buildIndex -o:index.html ."
rmFile("web"/comp/"nimdoc.cfg") rmFile("web"/comp/"nimdoc.cfg")