-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[HTML theme] add "Navigate to the Top" button #12558
Comments
While I understand the needs of a Prev/Next, on Firefox, you can already go down with Ctrl+Down keys. I don't think we'll add it for our own theme but you can suggest your idea to Furo (this is the theme used in your example).
In our current theme, this place is already taken by the versioning widget from RTD =/ @chrisjsewell IIRC, you recently added Next/Previous buttons, do you think it makes sense to have such button? (for me, no, because you can have it with basic keyboard features but I'd be happy to hear your thoughts). |
I think Furo already has. It kind of have at the top centre while scrolling up. |
100% yes, not everyone knows/wants to learn keyboard shortcuts 😉 plus mobile devices do not have keyboards And yeh furo already has "jump to top" functionality; haven't had a look at the implementation yet though |
I'm personally +0 but if you want to take upon the implementation (or someone else could), I don't mind. I'm currently trying to fix PEP 695 parsing for LaTeX builds |
Oh yeh it's not a priority, I don't know if I will have time soon for this, but I'm open to it (in the non-intrusive way like implemented in furo) |
Hey, can I work on this issue? I'm new to this organisation so this might help me to learn some new things. |
Yes sure! I'll assign the issue to you! |
Where do you suggest adding this (navigate to top) button, besides Previous/Next or like the one furo has (at the top centre)? |
I have very bad suggestions when it comes to design... I would say top right as a floating box, because I don't like something at the top center. And for the themes, I would say all of them should have this feature, except perhaps the most minimal where no features at all is better. I would however make the feature disabled by default, since this could be disruptive to themes that would have something placed at the position we decide. |
Should we attach with Previous | Next | Index?
For now, I'll try to add in |
If the theme does not have Previous/Next buttons, then I think it's worth it. If there's already a previous/next button, enhance them. In general, the Top (or Bottom) buttons are good if they move at the same as you scroll down/up. By the way, it would be easier to discuss the various proposals with visual examples. @chrisjsewell @timhoffm You have better insights on designs than me so your feedback would be more valuable than mine I think. |
Cool, I'll wait for their feedback and yes it'll be good to manage both previous/next buttons with top/bottom buttons. |
My 2 cents: This gives some tips on "Back to top" buttons. Furo and pydata-sphinx-theme follow it mostly. Additional personal comments:
I have no general recommendation on placement it all has pros and cons. |
Your 2 cents are worth more than 2 cents. Thank you Tim for the feedback! |
Some thoughts here:
As for where this should take the user:
Feel free to ping for follow ups or reviews if needed |
Thank you so much @timhoffm. This would be of great help while implementing this feature. |
I just noted that the button of pydata-sphinx-theme does not work well for iPhone. When scrolling up, safari shows the address bar, which reduces the available screen size and thus hides the button. 🙈 So definitively not easy to get this right. RPReplay_Final1721153791.mp4 |
Interesting @timhoffm - I had never noticed this as I am an Android user and have never had anyone flag this before. Is this standard behavior regardless of the browser being used, though? Will open an issue in PST tomorrow when I am back online. |
Here I'm still figuring out the code and continuously thinking about the correct name, the right place to keep the function (because this code has got some hight standards) and this conversation is now making me more nervous to implement this 😓. Now I'm scared, if I'll be able to do this or not. |
Sorry if this has become a bit overwhelming @kavania2002. What about getting started with a small prototype in a draft pull request. Don't worry about getting everything right the first time or even to integrate all the details here. Start small with a simple button, and feel free to ping me when you have something, I can help review it and we can iteratively make it better, one small step at a time. |
Thanks a lot @trallard 🙏 . I'll try my best to create a draft pull request. |
Great looking forward to it ✨ |
@trallard This seems to be specific to Safari on iOS. Edit: The button is placed at |
If you want some help on understanding the code base, I can give you some advice. I doubt you will need to touch the Python code itself and will likely only need to touch the CSS and HTML files. Nevertheless, what I can suggest, is that you create some dummy Sphinx project, and modify manually the static css file so that you can see the changes on your web browser more easily rather than going back and forth with rebuilding the docs. And also, don't worry about the time it can take. We are a small team and we are usually not pressed by deadlines and such, so feel free to familiarize yourself or ask questions. I agree that the code base is scary (it was for me the first time) but hopefully you'll only need to touch not-too-much-scary code |
@picnixz Thanks. I think I'm getting the hang of this (not-too-much-scary code part). |
I am a bit busy for the next 10 days or so but I'll have a look around mid August (or before if I have time). If I forget about it, feel free ro ping me! |
Yay! Excited to see this PR up. I have been on and off sick for the last few days. |
As I've already mentioned in the PR (#12618 (comment)), I don't think this should be part of the Having said that, if there is anything that the For example, it would probably be helpful to have a localized string (e.g. "Navigate to top") that can then be re-used by derived themes without needing their own internationalization. |
As long as derived themes can easily opt out of the default implementation, they still have all the freedom. |
So sorry, I was busy with some work. So what things are needed from my side, please let me know! |
Is your feature request related to a problem? Please describe.
Let's say I'm looking into
Debugging Tips
in contributing guideline page. It's tiring to roll back to top to get back to heading.Describe the solution you'd like
A
to the top
button at the bottom right corner might help and avoid excessive scrolling.The text was updated successfully, but these errors were encountered: