mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
doc2 support for nimweb; fixed graphics.withEvents
This commit is contained in:
@@ -219,8 +219,8 @@ proc checkRaisesSpec(spec, real: PNode) =
|
||||
for r in items(real):
|
||||
block search:
|
||||
for s in 0 .. <spec.len:
|
||||
# r supertype of s?
|
||||
if inheritanceDiff(r.excType, spec[s].typ) <= 0:
|
||||
# s supertype of r?
|
||||
if inheritanceDiff(spec[s].typ, r.excType) <= 0:
|
||||
used.incl(s)
|
||||
break search
|
||||
# XXX call graph analysis would be nice here!
|
||||
|
||||
@@ -487,7 +487,8 @@ proc fillSurface*(sur: PSurface, color: TColor) =
|
||||
if sdl.FillRect(sur.s, nil, sur.createSdlColor(color)) == -1:
|
||||
raiseEGraphics()
|
||||
|
||||
template withEvents*(surf: PSurface, event: expr, actions: stmt): stmt =
|
||||
template withEvents*(surf: PSurface, event: expr, actions: stmt): stmt {.
|
||||
immediate.} =
|
||||
## Simple template which creates an event loop. ``Event`` is the name of the
|
||||
## variable containing the TEvent object.
|
||||
while True:
|
||||
|
||||
@@ -14,7 +14,7 @@ type
|
||||
TKeyValPair = tuple[key, val: string]
|
||||
TConfigData = object of TObject
|
||||
tabs, links: seq[TKeyValPair]
|
||||
doc, srcdoc, webdoc, pdf: seq[string]
|
||||
doc, srcdoc, srcdoc2, webdoc, pdf: seq[string]
|
||||
authors, projectName, projectTitle, logo, infile, outdir, ticker: string
|
||||
vars: PStringTable
|
||||
nimrodArgs: string
|
||||
@@ -24,6 +24,7 @@ proc initConfigData(c: var TConfigData) =
|
||||
c.links = @[]
|
||||
c.doc = @[]
|
||||
c.srcdoc = @[]
|
||||
c.srcdoc2 = @[]
|
||||
c.webdoc = @[]
|
||||
c.pdf = @[]
|
||||
c.infile = ""
|
||||
@@ -139,6 +140,7 @@ proc parseIniFile(c: var TConfigData) =
|
||||
of "doc": addFiles(c.doc, "doc", ".txt", split(v, {';'}))
|
||||
of "pdf": addFiles(c.pdf, "doc", ".txt", split(v, {';'}))
|
||||
of "srcdoc": addFiles(c.srcdoc, "lib", ".nim", split(v, {';'}))
|
||||
of "srcdoc2": addFiles(c.srcdoc2, "lib", ".nim", split(v, {';'}))
|
||||
of "webdoc": addFiles(c.webdoc, "lib", ".nim", split(v, {';'}))
|
||||
else: quit(errorStr(p, "unknown variable: " & k.key))
|
||||
else: nil
|
||||
@@ -167,6 +169,9 @@ proc buildDoc(c: var TConfigData, destPath: string) =
|
||||
for d in items(c.srcdoc):
|
||||
Exec("nimrod doc $# -o:$# --index:on $#" %
|
||||
[c.nimrodArgs, destPath / changeFileExt(splitFile(d).name, "html"), d])
|
||||
for d in items(c.srcdoc2):
|
||||
Exec("nimrod doc2 $# -o:$# --index:on $#" %
|
||||
[c.nimrodArgs, destPath / changeFileExt(splitFile(d).name, "html"), d])
|
||||
Exec("nimrod buildIndex -o:$1/theindex.html $1" % [destPath])
|
||||
|
||||
proc buildPdfDoc(c: var TConfigData, destPath: string) =
|
||||
|
||||
@@ -25,8 +25,9 @@ file: ticker
|
||||
doc: "endb;intern;apis;lib;manual;tut1;tut2;nimrodc;overview;filters;trmacros"
|
||||
doc: "tools;c2nim;niminst;nimgrep;gc;estp"
|
||||
pdf: "manual;lib;tut1;tut2;nimrodc;c2nim;niminst;gc"
|
||||
srcdoc2: "impure/graphics;wrappers/sdl"
|
||||
srcdoc: "core/macros;pure/marshal;core/typeinfo;core/unsigned"
|
||||
srcdoc: "impure/graphics;impure/re;pure/sockets"
|
||||
srcdoc: "impure/re;pure/sockets"
|
||||
srcdoc: "system.nim;system/threads.nim;system/channels.nim"
|
||||
srcdoc: "pure/os;pure/strutils;pure/math;pure/matchers;pure/algorithm"
|
||||
srcdoc: "pure/complex;pure/times;pure/osproc;pure/pegs;pure/dynlib"
|
||||
@@ -59,7 +60,7 @@ webdoc: "wrappers/cairo"
|
||||
webdoc: "wrappers/gtk"
|
||||
webdoc: "wrappers/libsvm.nim;wrappers/mongo.nim"
|
||||
webdoc: "windows"
|
||||
webdoc: "wrappers/x11;wrappers/opengl;wrappers/sdl;wrappers/lua"
|
||||
webdoc: "wrappers/x11;wrappers/opengl;wrappers/lua"
|
||||
webdoc: "wrappers/readline/readline;wrappers/readline/history"
|
||||
webdoc: "wrappers/readline/rltypedefs"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user