added 'website' option to koch for convenience

This commit is contained in:
Araq
2014-12-13 00:39:32 +01:00
parent f45093893d
commit 3ee048eaad
4 changed files with 19 additions and 8 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -34,13 +34,13 @@ Nim's Community
Github
------
Nim's `source code <http://github.com/Araq/Nim>`_ is hosted on Github.
Together with the `wiki <http://github.com/Araq/Nim/wiki>`_ and
`issue tracker <http://github.com/Araq/Nim/issues>`_.
Nim's `source code <http://github.com/Araq/Nimrod>`_ is hosted on Github.
Together with the `wiki <http://github.com/Araq/Nimrod/wiki>`_ and
`issue tracker <http://github.com/Araq/Nimrod/issues>`_.
Github also hosts other projects relating to Nim. These projects are a part
of the `nim-lang organisation <http://github.com/nim-lang>`_.
This includes the `Babel package manager <http://github.com/nim-lang/babel>`_
This includes the `Nimble package manager <https://github.com/nim-lang/nimble>`_
and its `package repository <http://github.com/nim-lang/packages>`_.

View File

@@ -18,7 +18,7 @@ Learning Nim
Examples
--------
- | `Nim by Example <http://nimrod-by-example.github.io/>`_
- | `Nim by Example <http://nim-by-example.github.io/>`_
| Nim by Example is an excellent starting place for beginners.
- | `Nim on Rosetta Code <http://rosettacode.org/wiki/Category:Nimrod>`_