-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
docs_main.cr
is a mess
#14625
Comments
I wish we had a folder for std (e.g. require "./annotations"
require "./compiler/crystal/macros"
require "./std/*"
require "./docs_pseudo_methods" |
This actually works relatively decent if we use Some of the top-level files won't implicitly include all files in their parts of the stdlib. There is not even a |
See #15621 for an implementation.
|
A full tree require with |
docs_main.cr
serves as entry point to generate the API docs for the standard library. It requires all files that contain documented features.It's quite a chaotic mess.
Entries are unordered. That's probably due to some forced order dependencies, not sure about the details.
Many entries are omitted because they're already required as part of the prelude or are transitive dependencies of others. This makes it hard to follow which files actually end up being included in the docs.
There's generally quite a bit of overlap with
prelude.cr
. But it's inconsistent because some parts of the prelude are also indocs_main.cr
(require "array"
) while others aren't (require "base64"
).It would be cleaner to either embrace the prelude and remove duplicates, or spell out all requires in
docs_main.cr
explicitly and even remove the prelude from the docs build (crystal docs src/docs_main.cr --prelude=empty
).I don't think removing the prelude makes much sense. It would allow us to exclude files that don't contain any documented features, but they might be implicit requirements of other code that's relevant for documentation.
It would also be helpful to have a reminder to ensure newly added files are present in
docs_main.cr
. That's a relatively rare event, so we don't always remember it (see #14624). Most new files are added to paths likesrc/compiler
,src/crystal
orsrc/lib_c
anyway, which can be ignored for docs.Not sure if there's an easy way to do this, though. It might not be terribly relevant because we should usually notice if API docs are missing when preparing the release notes, so we should be able to fix it in time before a release.
So I'd suggest to do the following:
docs_main.cr
which are already inprelude.cr
.docs_main.cr
by path. If there are any forced order exceptions, document them (like inprelude.cr
).docs_main.cr
.The text was updated successfully, but these errors were encountered: