mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-23 07:45:23 +00:00
index generation for docgen knows about subdirectories; index knows about enum values; fixes import statement for runnableExamples
This commit is contained in:
@@ -7,9 +7,12 @@ var
|
||||
|
||||
proc test(dir: string; fixup = false) =
|
||||
putEnv("SOURCE_DATE_EPOCH", "100000")
|
||||
if execShellCmd("nim doc --project -o:$1/htmldocs $1/testproject.nim" % dir) != 0:
|
||||
if execShellCmd("nim doc --project --index:on -o:$1/htmldocs $1/testproject.nim" % dir) != 0:
|
||||
quit("FAILURE: nim doc failed")
|
||||
|
||||
if execShellCmd("nim buildIndex -o:$1/htmldocs/theindex.html $1/htmldocs" % [dir]) != 0:
|
||||
quit("FAILURE: nim buildIndex failed")
|
||||
|
||||
for expected in walkDirRec(dir / "expected/"):
|
||||
let produced = expected.replace("/expected/", "/htmldocs/")
|
||||
if not fileExists(produced):
|
||||
|
||||
1266
nimdoc/testproject/expected/theindex.html
Normal file
1266
nimdoc/testproject/expected/theindex.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,9 @@
|
||||
|
||||
type
|
||||
SomeType* = int
|
||||
SomeType* = enum
|
||||
enumValueA,
|
||||
enumValueB,
|
||||
enumValueC
|
||||
|
||||
proc someType*(): SomeType =
|
||||
## constructor.
|
||||
|
||||
@@ -3,8 +3,9 @@ import subdir / subdir_b / utils
|
||||
|
||||
## This is the top level module.
|
||||
runnableExamples:
|
||||
import subdir / subdir_b / utils
|
||||
doAssert bar(3, 4) == 7
|
||||
foo(1, 2)
|
||||
foo(enumValueA, enumValueB)
|
||||
|
||||
|
||||
template foo*(a, b: SomeType) =
|
||||
|
||||
Reference in New Issue
Block a user