summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/installer.ini5
-rw-r--r--doc/overview.rst (renamed from doc/overview.txt)0
-rw-r--r--finish.nim2
-rw-r--r--koch.nim1
-rw-r--r--tools/nimweb.nim21
5 files changed, 21 insertions, 8 deletions
diff --git a/compiler/installer.ini b/compiler/installer.ini
index 40050a2f7..90cf81cf0 100644
--- a/compiler/installer.ini
+++ b/compiler/installer.ini
@@ -41,8 +41,8 @@ Files: "config/nimdoc.tex.cfg"
 ; Files: "doc/*.cfg"
 ; Files: "doc/*.pdf"
 ; Files: "doc/*.ini"
-Files: "doc/overview.html"
-Start: "doc/overview.html"
+Files: "doc/html/overview.html"
+Start: "doc/html/overview.html"
 
 
 [Other]
@@ -63,6 +63,7 @@ Files: "icons/koch_icon.o"
 
 Files: "compiler"
 Files: "doc"
+Files: "doc/html"
 Files: "tools"
 Files: "web/website.ini"
 Files: "web/ticker.html"
diff --git a/doc/overview.txt b/doc/overview.rst
index 5b41752ae..5b41752ae 100644
--- a/doc/overview.txt
+++ b/doc/overview.rst
diff --git a/finish.nim b/finish.nim
index 18216cfb2..91421d669 100644
--- a/finish.nim
+++ b/finish.nim
@@ -72,7 +72,7 @@ when defined(windows):
       createShortcut(getCurrentDir() / "start.bat", dest / "Nim",
                      getCurrentDir() / r"icons\nim.ico")
       if fileExists("doc/overview.html"):
-        createShortcut(getCurrentDir() / "doc" / "overview.html",
+        createShortcut(getCurrentDir() / "doc" / "html" / "overview.html",
                        dest / "Overview")
       if dirExists(r"dist\aporia-0.4.0"):
         createShortcut(getCurrentDir() / r"dist\aporia-0.4.0\bin\aporia.exe",
diff --git a/koch.nim b/koch.nim
index 74855a6b9..bd7be9416 100644
--- a/koch.nim
+++ b/koch.nim
@@ -369,6 +369,7 @@ of cmdArgument:
   of "boot": boot(op.cmdLineRest)
   of "clean": clean(op.cmdLineRest)
   of "web": web(op.cmdLineRest)
+  of "docs": web("--onlyDocs " & op.cmdLineRest)
   of "json2": web("--json2 " & op.cmdLineRest)
   of "website": website(op.cmdLineRest & " --googleAnalytics:UA-48159761-1")
   of "web0":
diff --git a/tools/nimweb.nim b/tools/nimweb.nim
index c3bba3f0a..9a21a0fb5 100644
--- a/tools/nimweb.nim
+++ b/tools/nimweb.nim
@@ -29,7 +29,7 @@ type
   TRssItem = object
     year, month, day, title, url, content: string
   TAction = enum
-    actAll, actOnlyWebsite, actPdf, actJson2
+    actAll, actOnlyWebsite, actPdf, actJson2, actOnlyDocs
 
   Sponsor = object
     logo: string
@@ -72,7 +72,7 @@ include "website.tmpl"
 # ------------------------- configuration file -------------------------------
 
 const
-  version = "0.7"
+  version = "0.8"
   usage = "nimweb - Nim Website Generator Version " & version & """
 
   (c) 2015 Andreas Rumpf
@@ -85,6 +85,8 @@ Options:
   -v, --version       shows the version
   --website           only build the website, not the full documentation
   --pdf               build the PDF version of the documentation
+  --json2             build JSON of the documentation
+  --onlyDocs          build only the documentation
 Compile_options:
   will be passed to the Nim compiler
 """
@@ -157,6 +159,7 @@ proc parseCmdLine(c: var TConfigData) =
       of "website": action = actOnlyWebsite
       of "pdf": action = actPdf
       of "json2": action = actJson2
+      of "onlydocs": action = actOnlyDocs
       of "googleanalytics":
         c.gaId = val
         c.nimArgs.add("--doc.googleAnalytics:" & val & " ")
@@ -315,6 +318,7 @@ proc buildDoc(c: var TConfigData, destPath: string) =
   exec(findNim() & " buildIndex -o:$1/theindex.html $1" % [destPath])
 
 proc buildPdfDoc(c: var TConfigData, destPath: string) =
+  createDir(destPath)
   if os.execShellCmd("pdflatex -version") != 0:
     echo "pdflatex not found; no PDF documentation generated"
   else:
@@ -507,8 +511,14 @@ proc main(c: var TConfigData) =
   buildAddDoc(c, docup)
   buildDocSamples(c, docup)
   buildDoc(c, docup)
-  buildDocSamples(c, "doc")
-  buildDoc(c, "doc")
+  createDir("doc/html")
+  buildDocSamples(c, "doc/html")
+  buildDoc(c, "doc/html")
+
+proc onlyDocs(c: var TConfigData) =
+  createDir("doc/html")
+  buildDocSamples(c, "doc/html")
+  buildDoc(c, "doc/html")
 
 proc json2(c: var TConfigData) =
   const destPath = "web/json2"
@@ -529,6 +539,7 @@ parseCmdLine(c)
 parseIniFile(c)
 case action
 of actOnlyWebsite: buildWebsite(c)
-of actPdf: buildPdfDoc(c, "doc")
+of actPdf: buildPdfDoc(c, "doc/pdf")
+of actOnlyDocs: onlyDocs(c)
 of actAll: main(c)
 of actJson2: json2(c)