-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add "collapse/expand all" functionality #1393
Comments
I think would be a great thing to have, if you'd be willing to take a stab at implementing this. Generally, Documenter-based docs (including the Julia manual) tend to have these hugely long API reference pages, and I think this would really help navigating those long lists. |
@mortenpi This can be achieved using |
Pretty sure it's up for grabs. |
- Adding collapse/expand funcitonality to individual article blocks - Adding collapse/expand all functionality
For people that already know other programming languages, it would help a lot to get an overview of what's available in a package/module by looking at the list of available functions/types (without all the detailed explanations). However, in the current implementation of documenter template where each article is implemented like a card (with header + section) and a margin between each of them, it is (at least for me) not possible to do that easily. I have already seen that there is the index functionality but it doesn't seem to be in use that much and it adds a bit of clutter that can be avoided by collapsing the sections of each article. This would allow a somewhat implicit implementation of the index with additional information for different function groups with markdown in-between. I have created a Tampermonkey userscript to evaluate this idea as a proof-of-concept:
(Tampermonkey userscript gist: https://gist.github.com/cloudgiant/d02dca129d79558cab1a8cbbd820f0a7 . You can try it out on official julia docs after installing: https://docs.julialang.org/en/v1/base/collections/)
This script just adds an
expand/collapse articles
button on top right (It will of course need some css love for the proper implementation) and adds an onclick listener for the headers to expand/collapse single articles (Single article expand/collapse functionality can also be triggered by a button if an onclick listener for the header is a bit too much).In this crude implementation, the methods are shown duplicated. This problem can be solved by either showing signatures or grouping the methods together for the function name (with number of methods maybe?). Ideally the header would also show a single sentence summary in the collapsed state.
I think a variation of this functionality would be beneficial for reference part of every package documentation, especially for newcomer julia developers.
The text was updated successfully, but these errors were encountered: