added 'website' option to koch for convenience
This commit is contained in:
parent
f45093893d
commit
3ee048eaad
4 changed files with 19 additions and 8 deletions
8
koch.nim
8
koch.nim
|
|
@ -42,7 +42,8 @@ Possible Commands:
|
||||||
boot [options] bootstraps with given command line options
|
boot [options] bootstraps with given command line options
|
||||||
install [bindir] installs to given directory
|
install [bindir] installs to given directory
|
||||||
clean cleans Nimrod project; removes generated files
|
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
|
csource [options] builds the C sources for installation
|
||||||
zip builds the installation ZIP package
|
zip builds the installation ZIP package
|
||||||
nsis [options] builds the NSIS Setup installer (for Windows)
|
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=$#" %
|
exec("$# cc -r tools/nimweb.nim $# web/nim --putenv:nimversion=$#" %
|
||||||
[findNim(), args, VersionAsString])
|
[findNim(), args, VersionAsString])
|
||||||
|
|
||||||
|
proc website(args: string) =
|
||||||
|
exec("$# cc -r tools/nimweb.nim $# --website web/nim --putenv:nimversion=$#" %
|
||||||
|
[findNim(), args, VersionAsString])
|
||||||
|
|
||||||
# -------------- boot ---------------------------------------------------------
|
# -------------- boot ---------------------------------------------------------
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -345,6 +350,7 @@ of cmdArgument:
|
||||||
of "boot": boot(op.cmdLineRest)
|
of "boot": boot(op.cmdLineRest)
|
||||||
of "clean": clean(op.cmdLineRest)
|
of "clean": clean(op.cmdLineRest)
|
||||||
of "web": web(op.cmdLineRest)
|
of "web": web(op.cmdLineRest)
|
||||||
|
of "website": website(op.cmdLineRest)
|
||||||
of "csource", "csources": csource(op.cmdLineRest)
|
of "csource", "csources": csource(op.cmdLineRest)
|
||||||
of "zip": zip(op.cmdLineRest)
|
of "zip": zip(op.cmdLineRest)
|
||||||
of "nsis": nsis(op.cmdLineRest)
|
of "nsis": nsis(op.cmdLineRest)
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ type
|
||||||
TRssItem = object
|
TRssItem = object
|
||||||
year, month, day, title: string
|
year, month, day, title: string
|
||||||
|
|
||||||
|
var onlyWebsite: bool
|
||||||
|
|
||||||
proc initConfigData(c: var TConfigData) =
|
proc initConfigData(c: var TConfigData) =
|
||||||
c.tabs = @[]
|
c.tabs = @[]
|
||||||
c.links = @[]
|
c.links = @[]
|
||||||
|
|
@ -67,6 +69,7 @@ Options:
|
||||||
--var:name=value set the value of a variable
|
--var:name=value set the value of a variable
|
||||||
-h, --help shows this help
|
-h, --help shows this help
|
||||||
-v, --version shows the version
|
-v, --version shows the version
|
||||||
|
--website only build the website, not the full documentation
|
||||||
Compile_options:
|
Compile_options:
|
||||||
will be passed to the Nim compiler
|
will be passed to the Nim compiler
|
||||||
"""
|
"""
|
||||||
|
|
@ -134,6 +137,8 @@ proc parseCmdLine(c: var TConfigData) =
|
||||||
var idx = val.find('=')
|
var idx = val.find('=')
|
||||||
if idx < 0: quit("invalid command line")
|
if idx < 0: quit("invalid command line")
|
||||||
c.vars[substr(val, 0, idx-1)] = substr(val, idx+1)
|
c.vars[substr(val, 0, idx-1)] = substr(val, idx+1)
|
||||||
|
of "website":
|
||||||
|
onlyWebsite = true
|
||||||
else: quit(usage)
|
else: quit(usage)
|
||||||
of cmdEnd: break
|
of cmdEnd: break
|
||||||
if c.infile.len == 0: quit(usage)
|
if c.infile.len == 0: quit(usage)
|
||||||
|
|
@ -435,8 +440,8 @@ var c: TConfigData
|
||||||
initConfigData(c)
|
initConfigData(c)
|
||||||
parseCmdLine(c)
|
parseCmdLine(c)
|
||||||
parseIniFile(c)
|
parseIniFile(c)
|
||||||
when false:
|
if onlyWebsite:
|
||||||
#buildPdfDoc(c, "doc")
|
|
||||||
buildWebsite(c)
|
buildWebsite(c)
|
||||||
|
#buildPdfDoc(c, "doc")
|
||||||
else:
|
else:
|
||||||
main(c)
|
main(c)
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,13 @@ Nim's Community
|
||||||
Github
|
Github
|
||||||
------
|
------
|
||||||
|
|
||||||
Nim's `source code <http://github.com/Araq/Nim>`_ is hosted on Github.
|
Nim's `source code <http://github.com/Araq/Nimrod>`_ is hosted on Github.
|
||||||
Together with the `wiki <http://github.com/Araq/Nim/wiki>`_ and
|
Together with the `wiki <http://github.com/Araq/Nimrod/wiki>`_ and
|
||||||
`issue tracker <http://github.com/Araq/Nim/issues>`_.
|
`issue tracker <http://github.com/Araq/Nimrod/issues>`_.
|
||||||
|
|
||||||
Github also hosts other projects relating to Nim. These projects are a part
|
Github also hosts other projects relating to Nim. These projects are a part
|
||||||
of the `nim-lang organisation <http://github.com/nim-lang>`_.
|
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>`_.
|
and its `package repository <http://github.com/nim-lang/packages>`_.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ Learning Nim
|
||||||
Examples
|
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 by Example is an excellent starting place for beginners.
|
||||||
|
|
||||||
- | `Nim on Rosetta Code <http://rosettacode.org/wiki/Category:Nimrod>`_
|
- | `Nim on Rosetta Code <http://rosettacode.org/wiki/Category:Nimrod>`_
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue