Skip to content
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

Closed
cloudgiant opened this issue Aug 9, 2020 · 3 comments · Fixed by #2078
Closed

Add "collapse/expand all" functionality #1393

cloudgiant opened this issue Aug 9, 2020 · 3 comments · Fixed by #2078
Labels
Format: HTML Related to the default HTML output Type: Enhancement

Comments

@cloudgiant
Copy link

cloudgiant commented Aug 9, 2020

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:

collapse_expand

(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.

@cloudgiant cloudgiant changed the title Add "collapse/expand all" functionality to the documenter page Add "collapse/expand all" functionality Aug 9, 2020
@mortenpi mortenpi added Type: Enhancement Format: HTML Related to the default HTML output labels Aug 10, 2020
@mortenpi
Copy link
Member

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.

@Hetarth02
Copy link
Contributor

@mortenpi This can be achieved using slideToggle() function of jquery. If it is up for grabs, I am happy to contribute.

@mortenpi
Copy link
Member

mortenpi commented Mar 1, 2023

Pretty sure it's up for grabs.

Hetarth02 added a commit to Hetarth02/Documenter.jl that referenced this issue Mar 18, 2023
- Adding collapse/expand funcitonality to individual article blocks
- Adding collapse/expand all functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: HTML Related to the default HTML output Type: Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants