Skip to content

Commit 61908de

Browse files
committed
buildindex and keep testresults in rootdir
1 parent 7d7e116 commit 61908de

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

.github/scripts/docs.nims

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env nim
22

3-
# TODO(noah): build the index AFTER doc generation
4-
# ^ @see https://nim-lang.github.io/Nim/docgen.html#related-options-buildindex-command
5-
63
import std / [os, strformat]
74

85
import
@@ -54,6 +51,14 @@ proc createSourceDocs: (string, int) =
5451
except OSError:
5552
("failed to create documentation", 1)
5653

54+
proc createSourceDocsIndex: (string, int) =
55+
echo "create user-serachable index HTML"
56+
try:
57+
fmt"buildIndex -o:{rootDir/docsDir}/theindex.html {rootDir / docsDir}".selfExec
58+
("user-searchable index HTML created", 0)
59+
except OSError:
60+
("failed to user-searchable index", 1)
61+
5762
proc createTestResults: (string, int) = createTestResultsHtml()
5863

5964
proc createDependencyGraphs: (string, int) =
@@ -70,7 +75,7 @@ proc mvFilesToHtmlDocsDir: (string, int) =
7075
for output in @[
7176
rootDir / "src/bookofnim.dot",
7277
rootDir / "src/bookofnim.png",
73-
rootDir / "testresults.html" # TODO think this broke viewing testresults in github pages
78+
# rootDir / "testresults.html" # TODO(noah) think this broke viewing testresults in github pages
7479
]: output.mvFile rootDir / docsDir / output.extractFilename
7580
("documentation moved to htmldocs dir", 0)
7681
except CatchableError:
@@ -81,6 +86,7 @@ when isMainModule:
8186
installDeps,
8287
deletePrevdocs,
8388
createSourceDocs,
89+
createSourceDocsIndex,
8490
createDependencyGraphs,
8591
createTestResults,
8692
mvFilesToHtmlDocsDir # must occur last

src/bookofnim.nim

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
links
2020
-----
21-
- [latest test results](https://noahehall.github.io/nim/htmldocs/testresults.html)
21+
- [latest test results](https://noahehall.github.io/nim/testresults.html)
2222
- use nims devel branch until the online documentation for v2 is ready
2323
- [docs](https://github.com/nim-lang/Nim/tree/devel/doc)
2424
- [system](https://github.com/nim-lang/Nim/blob/devel/lib/system.nim)

src/bookofnim/deepdives/osIo.nim

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ links
6767
- other
6868
- [nitch source code](https://github.com/unxsh/nitch)
6969
- [peter: handling files in nim](https://peterme.net/handling-files-in-nim.html)
70+
- [consuming data from thousands of small files](https://forum.nim-lang.org/t/10146)
7071
- high impact
7172
- [basic os utils](https://nim-lang.github.io/Nim/os.html)
7273
- [distro detection & os pkg manager](https://nim-lang.github.io/Nim/distros.html)

src/bookofnim/helloworld/modules/exceptionHandlingDocs.nim

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
- tracebacks:
2828
- each line in the stack track is a call to a procedure
2929
30-
3130
- drnim
3231
- requires koch to be setup
3332

testresults.html

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)