walkDirRecFilter, update doc CI filter, compiler/index.nim for docs + various other fixes #14501
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
update doc CI filter to include the files mostly likely to require doc rebuild
unlike previous attempt (https://github.com/nim-lang/Nim/pull/13853/files), this is much more targeted, just the usual suspects that affect docs the most.
doc/nimdoc.css
; ok to just merge those 2 lists to avoid duplication (in this or a cleanup pr)?EDIT: CI fails on windows, which is a reason why this PR is needed (catch issues on code PRs that introduce problem, not later); I suspect it's because
nim doc --project compiler/nim
fails on windows... investigatingrefactor all workaround implementations of nativeToUnixPath into 1
(I still need to finish #13265)
added compiler/index.nim
because https://nim-lang.github.io/Nim/compiler/nim.html was very underwhelming
after this PR navigating to https://nim-lang.github.io/Nim/compiler/ will do something useful
removed template duplication in config/nimdoc.cfg
and made sure it all works; so there's only 1 template to update
added undocumented
./koch --docslocal:myhtmldocs
so you can build all the docs n 40s instead of 190s as follows:
./koch --nim:$nimb --docslocal:htmldocs2 --doccmd:skip --warnings:off --hints:off
which is useful during local development when you need to run this a few times
added lib/std/private/globs.nim
for internal use only only (ie for any module inside nim repo) for now, but aim is to eventually merge those into stdlib.os once API stabilizes; same spirit as compiler/pathutils except
lib/std/private/
is the perfect staging place IMO if you need to use it from not justcompiler/
but other places (eg kochdocs, koch, tools, compiler, other modules in stdlib etc), giving it some internal exposure to give a chance to fix API without breaking user code, before converting it.private
conveys exactly what it is: for internal use only, if you use it in your code outside of nim repo it may break at any timeadded
walkDirRecFilter
that's IMO the better API, and the most flexible (and walkDirRec can later be implemented on top of it)
It's a common requested feature (eg see recent thread Can I "prune" directories with walkDirRect? - Nim forum) and should be in stdlib; but I also needed it in this PR, see below
fix a bug in
getDocList
this was picking up all the nim files in various nimcache folders in my repo (eg those created by runnableExamples); noone noticed since these don't export any symbols and therefore don't end up in the docs, but
nim doc
was being run on all of these, and there were quite a lot, slowing downkoch docs
.The clean way to filter is via a follow filter (ie "filter early" before recursing down a folder instead of filtering at the end which is less efficient), hence
walkDirRecFilter
fix a bug in lib/std/time_t.nim
which was making docs CI fail on windows since the compiler docs were enabled
used a glob to generate the rst files; added back
docstyle
which wasn't being docgen'di added
docstyle
which seemed like an unintentional omissionI kept docs.rst out since it's just an include
ditto with nimfix which is dead for now ( :-( ), but I wouldn't mind showing it in docs, would increase likelihood it gets revived
=> that's why glob+blacklist is always better than whitelist