-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #6583, fix #14376, index+search now generated for all projects, many bug fixes with nim doc #14324
Conversation
7aa3e04
to
ca4fcad
Compare
ebbab45
to
b54318e
Compare
62d73fe
to
d7198ee
Compare
Thats going to break a ton of scripts and is not any more so consistent with the way output binaries are generated, IMO its just surprising and inconvinient behaviour. |
The only point of contention with this PR (IMO, please clarify if not) is the default choice for Everything below is in reference to Note that it's a small change in this PR to add some kind of fallback compatibility behavior ( Please make sure you understand the problem before jumping to conclusions, I'm not sure you know the current and past behavior of
I doubt it, the last breaking change to date in how Since behavior without
no it's useful, it's the same rationale as why It also makes If you have a better behavior in mind, please suggest in detail how it would work (with and without --project) docs in devel:
=> this implies current design is not the result of some "intended design", it's just result of regressions after regressions, eg:in all cases below, I'm using the same sample project (see below) nim doc --index:on --skipusercfg --skipparentcfg src/sub/fun2.nim
nim doc --project --index:on --skipusercfg --skipparentcfg src/sub/fun2.nim
(the sample project used for all above commands:just 3 files, each exporting 1 symbol; with main file importing above and below its level:
|
3d0b133
to
781895a
Compare
Well that's not only "regressions because untested", it's also the result of a combinational command line switch explosion, and you yourself are too quick to introduce always more switches. (And putting the swiches into a hierarchy doesn't change the underlying maths.) |
just to be clear, I was passing no judgement on quality of past releases, which are excellent; I'm only referring to the narrow problem at hand: behavior when
it's not so much the number of flags as it is how flags interact; N flags with orthogonal behavior needs We shouldn't introduce flags that don't pull their weight, sure; but I use these all the time, eg In fact I'm considering after this PR turning FWIW, At least we have nims, which is far far better than any config system I've seen (nims eats its own dogfood, so improvements in VM improves nims instead of being something entirely separate like |
Ok, maybe.
That's fine but hopefully we're slowly getting to a point where you are happy with the switches we offer. |
Isn't this just because they are temporaries that you should not care about? I do care about my docs, so why should they be generated somewhere outside of my project directory? Instead, make it so that it will always output to a For when |
781895a
to
f1e53ba
Compare
f1e53ba
to
c7fcef3
Compare
92b94ef
to
f170114
Compare
@Araq PTAL outdir when --outdir not explicitly specified(of course, specifying when outdir is not provided, for a
the only difference with what @alaviss described is that I'm using doc generated auxiliary files can be considered as implementation details subject to change (in particular dochack.js, css, idx, theindex.html) so best to just encapsulate those inside a htmldocs dir so users don't have to worry about what to gitignore
|
… all projects, many bug fixes with nim doc (nim-lang#14324) * refs nim-lang#6583 fix nim doc output * changelog * change default for outDir when unspecified * cleanups * --project implies --index
summary: lots of bug fixes, nim doc now directly generates index and search for user projects; saner semantics for default location where docs are generated
example
this creates and opens compiler docs (with an index) in your browser on the fly in 6s and doesn't clobber sources files nor current dir
details
fix doc2 outputs in current work dir #6583 as follows: all doc-like commands now output to $nimcache/htmldocs unless
--outdir
is providedthis avoids clobbering current dir as well as sources, which was a common annoyance in particular with
--project
. This was already inconsistent with other commands before this PR, but I chose this semantics over outputting next to sources because nim doc is special: it installs many other things (eg nimdoc.out.css, idx files, html files, and subdirs) in particular with--project
fix
nim doc
recursive should allow specifying a directory and flattened structure #14376 (in particular all items innim doc
recursive should allow specifying a directory and flattened structure #14376 (comment)) before PR,nim doc --project
was inconsistant withnim doc
(files were output next to their sources) which also was a regression from a prior time; now it's consistent withnim doc
and outputs by default under$nimcache/htmldocs
.$nimcache/htmldocs
is a better default than$PWD/htmldocs
as it avoids clobbering your current directory in particular if you run commands from different dirs.In particular, if you just want to see docs, you can do:
nim doc -r main
, and all is kept in nimcache (but main html file is shown with successX msg as with other commands)nim buildIndex -o:htmldocs/theindex.html
is now done automatically withnim doc --project --index main
(more DRY, and avoids an extra step)fix a recent regression introduced sometime after fix #13150
nim doc --project
now works reliably #13223 where --docroot would cause nimdoc.out.css to be misplacedfix a bug where
nim doc --docroot:$PWD main
would give wrong relative paths if $PWD is a symlink (eg common on OSX, where aftercd /tmp/
you'd have since problem since /tmp is a symlink to /private/tmp on OSX)dochack.js is now installed by default when you use --project so that search works by default; it gets compiled (once) if it doesn't exist
updated docgen which didn't reflect reality (even before this PR)
theindex.html is now shown by default as an index entry, making it easy to navigate across pages in docs
I added regression tests testing a number of configurations to avoid more regressions in doc generation (see trunner.nim)
for future PR
nim doc --project -o:sub/bar.html main
outputssub/bar.html/main.html
; it's a preexisting odd/buggy behavior from the times outdir didn't existdochacks.nim
hardcodesrequest.open("GET", "theindex.html", false);
which is incorrect (eg if using custom theindex.html, or if subdirs are involved); since this never worked before in those cases it can be fixed in a future PR (but at least now dochacks works for user projects if no subdirs and using the exact name theindex.html) => dochack.nim uses wrong path to find theindex.html => search doesn't work unless file is in same dir as theindex.html #14476nim doc --index
generates incorrect module href, fooled by doc comments #14434 as well