summary refs log tree commit diff stats
path: root/tools/nimweb.nim
diff options
context:
space:
mode:
authorVarriount <Varriount@users.noreply.github.com>2015-01-05 21:28:43 -0500
committerVarriount <Varriount@users.noreply.github.com>2015-01-05 21:28:43 -0500
commit20da8c9400213a72cc99ffa4899e7a90cdd341bc (patch)
treec401b6427ceab95381c3f0dfcca858ef3a588524 /tools/nimweb.nim
parenta6194fb2bdeabd68d1930cd21ec2396c5d3c2a2e (diff)
parent8fd8843d5cd9d36aee914fbd862c03f114930f8b (diff)
downloadNim-20da8c9400213a72cc99ffa4899e7a90cdd341bc.tar.gz
Merge pull request #1779 from flaviut/ga-docs
Add google analytics to docs
Diffstat (limited to 'tools/nimweb.nim')
-rw-r--r--tools/nimweb.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/nimweb.nim b/tools/nimweb.nim
index 0596076b3..91aa17e7e 100644
--- a/tools/nimweb.nim
+++ b/tools/nimweb.nim
@@ -23,6 +23,7 @@ type
     gitCommit: string
     quotations: Table[string, tuple[quote, author: string]]
     numProcessors: int # Set by parallelBuild:n, only works for values > 0.
+    gaId: string  # google analytics ID, nil means analytics are disabled
   TRssItem = object
     year, month, day, title: string
   TAction = enum
@@ -144,7 +145,12 @@ proc parseCmdLine(c: var TConfigData) =
         c.vars[substr(val, 0, idx-1)] = substr(val, idx+1)
       of "website": action = actOnlyWebsite
       of "pdf": action = actPdf
-      else: quit(usage)
+      of "googleanalytics":
+        c.gaId = val
+        c.nimArgs.add("--doc.googleAnalytics:" & val & " ")
+      else:
+        echo("Invalid argument $1" % [key])
+        quit(usage)
     of cmdEnd: break
   if c.infile.len == 0: quit(usage)