summary refs log tree commit diff stats
path: root/tools/nimweb.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-12-19 13:44:56 +0100
committerAraq <rumpf_a@web.de>2014-12-19 13:44:56 +0100
commit76c3b314dcd0e67fae8bd9b113753480267dfdae (patch)
tree01f3a0d8eed5b7a8de1f9f18e35cb7cbd7541e80 /tools/nimweb.nim
parentd4230e052d1229ba8128e3630a84f7decfd09d75 (diff)
downloadNim-76c3b314dcd0e67fae8bd9b113753480267dfdae.tar.gz
implemented 'koch pdf'
Diffstat (limited to 'tools/nimweb.nim')
-rw-r--r--tools/nimweb.nim19
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/nimweb.nim b/tools/nimweb.nim
index c4dc8226d..fa4f15995 100644
--- a/tools/nimweb.nim
+++ b/tools/nimweb.nim
@@ -24,8 +24,10 @@ type
     numProcessors: int # Set by parallelBuild:n, only works for values > 0.
   TRssItem = object
     year, month, day, title: string
+  TAction = enum
+    actAll, actOnlyWebsite, actPdf
 
-var onlyWebsite: bool
+var action: TAction
 
 proc initConfigData(c: var TConfigData) =
   c.tabs = @[]
@@ -70,6 +72,7 @@ Options:
   -h, --help          shows this help
   -v, --version       shows the version
   --website           only build the website, not the full documentation
+  --pdf               build the PDF version of the documentation
 Compile_options:
   will be passed to the Nim compiler
 """
@@ -137,8 +140,8 @@ proc parseCmdLine(c: var TConfigData) =
         var idx = val.find('=')
         if idx < 0: quit("invalid command line")
         c.vars[substr(val, 0, idx-1)] = substr(val, idx+1)
-      of "website":
-        onlyWebsite = true
+      of "website": action = actOnlyWebsite
+      of "pdf": action = actPdf
       else: quit(usage)
     of cmdEnd: break
   if c.infile.len == 0: quit(usage)
@@ -434,14 +437,12 @@ proc main(c: var TConfigData) =
   buildDoc(c, "web/upload")
   buildDocSamples(c, "doc")
   buildDoc(c, "doc")
-  #buildPdfDoc(c, "doc")
 
 var c: TConfigData
 initConfigData(c)
 parseCmdLine(c)
 parseIniFile(c)
-if onlyWebsite:
-  buildWebsite(c)
-  #buildPdfDoc(c, "doc")
-else:
-  main(c)
+case action
+of actOnlyWebsite: buildWebsite(c)
+of actPdf: buildPdfDoc(c, "doc")
+of actAll: main(c)