-
-
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
[RFC] Optional documentation generation for crystal version, stdlib and shards. #7904
Comments
Having a |
I've tested generating A filter with the following may help:
Why each shard? Sometimes your hunting for basic documentation. Other times It's nice to know a shard adds methods to String or another base class. |
Rather than having to regenerate documentation I would like to see project grouping support in documentation browser. So adding another hierarchy level on top when there's more than one project. Similar to what devdocs.io does for languages, so you can search across everything in the top level but also move into the project and limit the search there. |
As nice as this all sounds, I seriously doubt whether that fits into the scope of the docs generator. The current concept is quite clear: Provide docs for all features in It wouldn't be difficult to build a tool on top of that that combines individual API docs to a bigger package, similar to devdocs.io. |
Some context: I'd like to have a docs build service similar to https://pkg.go.dev/ which provides automatically built API docs for shards. Setting up and maintaining docs for all your shard releases is a tasks that doesn't sound too complicated, but it's still some work that shard authors shouldn't have to worry about. They can obviously still provide their own docs. But currently most shards don't. So this would also be a service to the users who don't have to rely on authors to provide API docs. In this use case, there would be docs for hundreds of shards sitting around next to each other and many of them have dependency connections between them. There should be a simple way to link namespaces and other features between shards while still keeping each shard's documentation a separate piece from all the others. |
My main use case is generating documentation for an application with all API's in a single place. If I need to quickly fix a bug (or security hole) I need to see the documentation with the correct versions for everything including private shards preferably without hunting around. There may be private shards or forks that aren't available on the web which I also need documentation for. This wouldn't work for:
You can almost generate this sort of documentation by passing extra files on the command line to the doc generator. The only issues are:
As far as I can tell the work is minimal. |
There's no reason why having one solution wouldn't preclude the other - I'm still in favour of adding an |
@jhass and mine are semi mutually exclusive. @RX14 I think provides a minimal starting point. @straight-shoota's suggestion is independent. |
Just including all public API features into the docs output, should be really easy to achieve. |
Including everything required should be easy, doing the complete stdlib will be harder I think. This is why |
I don't think this should be a problem. |
This command should allow you to get some of this functionality, just add/remove what you want/don't want. AFAICT flags like crystal doc \
src/**/*.cr \ # Repo api docs
lib/*/src/{*.cr,**/*.cr} \ # Shards api docs
/usr/lib/crystal/docs_main.cr # Stdlib api docs |
Can the following options be added to the documentation generator to further my proposal in #5215 and for general use?
crystal docs
Int
|String
| Etc.Documentation for each class or method would ideally be marked/colored with the shard it came from, stdlib, core or with the most prominent indicator for the current application or shard.
The text was updated successfully, but these errors were encountered: