From 3ee048eaad337fabeb21751530083ae6abab86bd Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 13 Dec 2014 00:39:32 +0100 Subject: [PATCH] added 'website' option to koch for convenience --- koch.nim | 8 +++++++- tools/nimweb.nim | 9 +++++++-- web/community.txt | 8 ++++---- web/learn.txt | 2 +- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/koch.nim b/koch.nim index 2de93bdead..2c7d49cf17 100644 --- a/koch.nim +++ b/koch.nim @@ -42,7 +42,8 @@ Possible Commands: boot [options] bootstraps with given command line options install [bindir] installs to given directory clean cleans Nimrod project; removes generated files - web [options] generates the website + web [options] generates the website and the full documentation + website [options] generates only the website csource [options] builds the C sources for installation zip builds the installation ZIP package nsis [options] builds the NSIS Setup installer (for Windows) @@ -124,6 +125,10 @@ proc web(args: string) = exec("$# cc -r tools/nimweb.nim $# web/nim --putenv:nimversion=$#" % [findNim(), args, VersionAsString]) +proc website(args: string) = + exec("$# cc -r tools/nimweb.nim $# --website web/nim --putenv:nimversion=$#" % + [findNim(), args, VersionAsString]) + # -------------- boot --------------------------------------------------------- const @@ -345,6 +350,7 @@ of cmdArgument: of "boot": boot(op.cmdLineRest) of "clean": clean(op.cmdLineRest) of "web": web(op.cmdLineRest) + of "website": website(op.cmdLineRest) of "csource", "csources": csource(op.cmdLineRest) of "zip": zip(op.cmdLineRest) of "nsis": nsis(op.cmdLineRest) diff --git a/tools/nimweb.nim b/tools/nimweb.nim index 23d1ef4d9f..c4dc8226dd 100644 --- a/tools/nimweb.nim +++ b/tools/nimweb.nim @@ -25,6 +25,8 @@ type TRssItem = object year, month, day, title: string +var onlyWebsite: bool + proc initConfigData(c: var TConfigData) = c.tabs = @[] c.links = @[] @@ -67,6 +69,7 @@ Options: --var:name=value set the value of a variable -h, --help shows this help -v, --version shows the version + --website only build the website, not the full documentation Compile_options: will be passed to the Nim compiler """ @@ -134,6 +137,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 else: quit(usage) of cmdEnd: break if c.infile.len == 0: quit(usage) @@ -435,8 +440,8 @@ var c: TConfigData initConfigData(c) parseCmdLine(c) parseIniFile(c) -when false: - #buildPdfDoc(c, "doc") +if onlyWebsite: buildWebsite(c) + #buildPdfDoc(c, "doc") else: main(c) diff --git a/web/community.txt b/web/community.txt index aad281a446..e035ca7e20 100644 --- a/web/community.txt +++ b/web/community.txt @@ -34,13 +34,13 @@ Nim's Community Github ------ - Nim's `source code `_ is hosted on Github. - Together with the `wiki `_ and - `issue tracker `_. + Nim's `source code `_ is hosted on Github. + Together with the `wiki `_ and + `issue tracker `_. Github also hosts other projects relating to Nim. These projects are a part of the `nim-lang organisation `_. - This includes the `Babel package manager `_ + This includes the `Nimble package manager `_ and its `package repository `_. diff --git a/web/learn.txt b/web/learn.txt index f0e5e57fac..25db150a41 100644 --- a/web/learn.txt +++ b/web/learn.txt @@ -18,7 +18,7 @@ Learning Nim Examples -------- - - | `Nim by Example `_ + - | `Nim by Example `_ | Nim by Example is an excellent starting place for beginners. - | `Nim on Rosetta Code `_