fix #6583, fix #14376, index+search now generated for all projects, many bug fixes with nim doc (#14324)

* refs #6583 fix nim doc output
* changelog
* change default for outDir when unspecified
* cleanups
* --project implies --index
This commit is contained in:
Timothee Cour
2020-05-25 04:25:40 -07:00
committed by GitHub
parent cbfe9325c5
commit 58282547f6
22 changed files with 294 additions and 161 deletions

View File

@@ -30,8 +30,16 @@ Generate HTML documentation for a whole project:
::
# delete any htmldocs/*.idx file before starting
nim doc --project --index:on --git.url:<url> --git.commit:<tag> <main_filename>.nim
nim buildIndex -o:htmldocs/theindex.html htmldocs
nim doc --project --index:on --git.url:<url> --git.commit:<tag> --outdir:htmldocs <main_filename>.nim
# this will generate html files, a theindex.html index, css and js under `htmldocs`
# See also `--docroot` to specify a relative root.
# to get search (dochacks.js) to work locally, you need a server otherwise
# CORS will prevent opening file:// urls; this works:
python3 -m http.server 7029 --directory htmldocs
# When --outdir is omitted it defaults to $projectPath/htmldocs,
or `$nimcache/htmldocs` with `--usenimcache` which avoids clobbering your sources;
and likewise without `--project`.
Adding `-r` will open in a browser directly.
Documentation Comments