-
Notifications
You must be signed in to change notification settings - Fork 16
Compare to pandas accordian #11
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
Comments
Nice - I quite like the accordions. I guess they piggy-back on bootstrap for this kinda thing (https://getbootstrap.com/docs/4.3/components/collapse/) but if we want the toggle button to be theme-independent then that might not be possible. Maybe we could add a check for bootstrap, or a flag or something? |
I went ahead and made a version of it in https://github.com/chrisjsewell/aiida_core/blob/docs-revamp-intro-install/docs/source/_extensions/accordion.py 😄 Yeh they were directly using some of the CSS from the You may have noticed I've also just created https://github.com/executablebooks/sphinx-panels. This is an idea from pandas as well and is quite nice for documentation, e.g. |
I saw that! I think it looks great...maybe we can have a brainstorm about what are the "common visual elements" seen across books that it would be worth making into directives. Another one I like from the pandas docs is this structure of a question: That also seems like it could be a part of the "toggle button" approach. I'm definitely not strictly tied to our current "little grey button to the right" approach if we can find something that is more sensible in the CSS. I think I am also fine depending on bootstrap for more advanced features, and telling users that they need to load bootstrap if they want advanced stuff to work. WDYT? |
I just had a chat with @jorisvandenbossche, who is the lead on the new "pydata sphinx theme". It sounds like they're interested in doing many of the same things (directive-ifying things etc). For example, they have a PR to generate the "cards" you mentioned with It would be great if we can coordinate a bit with the Pandas community on this so that we don't duplicate efforts in generalizing some of these visual elements. |
Ah interesting cheers. |
For our use case with jupyter book yes, but for providing general use case directives it's not ideal. Currently, trying to coerce AiiDA to use bootstrap lol aiidateam/aiida-core#4029 |
if we can achieve the same effects without requiring full bootstrap to be loaded, then I am 💯 for it - just don't want to create a huge maintenance burden on us by being too generic. It's already something I've run into with |
you mean I can't just put |
Yep, if you open a PR for pydata theme to have theirs at 1000 😆 |
@chrisjsewell sorry for the slow reply here. But, to be clear, I am all for better coordinating this / avoiding duplication! Cleaning those up in pandas (to avoid all this ugly raw html) has been a bit on the backburner, as you can see from the stalled PRs .. ;) When we started doing this for the pandas docs, the idea has always been to eventually upstream it to the theme, as it looked like generally useful building blocks (but it was a bit easier at the time to just quickly hack together what we needed in pandas ;)). Now, moving it to a separate package, instead of the pydata-sphinx-theme is fine for me as well (certainly if the capabilities start to grow, and mostly because people might want to use it without using the pydata-sphinx-theme). So it seems you basically already implemented all of it in sphinx-panels? 😃 One thing I am wondering: I understand the desire to make it available for people not using a bootstrap-based theme otherwise, but doesn't that give a risk on incompatibilities between the parts of bootstrap css you included in the package vs the bootstrap your theme is already loading? |
Sphinx-panels is cool! 😃 I quickly tried it out for one of the pandas pages. On top is with sphinx-panels, at the bottom our original raw html ones (can you spot the difference .. ?): (and we need to fix the "bug" with the green area left/right of the code blocks in both cases ..) And the rst I needed for this:
So for those cards, that seems to be working very nicely !! Thanks a lot for turning our idea/hack into a nice package ;) |
Reading the docs now, this seems already be handled with I have some more questions about the panels, but will open an issue on the sphinx-panel repo, instead of hijacking this thread about it. So that was about the panels/cards, but the original issue here was about the "accordion". What are your current thoughts about that? The other elements we currently have in pandas:
|
Yep, as mentioned above, the genesis of this was that over at AiiDA we are also re-vamping our documentation, and for the intro section I saw what you had done and thought "lets copy that" lol. Funnily enough I just found out we are also under the NumFocus Umbrella: http://www.aiida.net/news/aiida-becomes-numfocus-affiliated-project/; so its not copying, its sharing 😁 |
The accordion and toggle-button are to some extent one and the same; just with different types of button. Both should be covered by https://getbootstrap.com/docs/4.3/components/collapse/. |
I think a |
I'm gonna close this one, since I think the accordian functionality is / will be handled by |
I quite like the accordion toggle in https://pandas.pydata.org/docs/getting_started/index.html#intro-to-pandas, and we are thinking of doing something similar in the AiiDA documentation.
They actually achieve this by using lots of raw HTML (https://github.com/pandas-dev/pandas/blob/master/doc/source/getting_started/index.rst), which isn't ideal, and I feel this might be handled by this package.
Aslo linking the minimal accordian tutorial: https://www.w3schools.com/howto/howto_js_accordion.asp
The text was updated successfully, but these errors were encountered: