-
Notifications
You must be signed in to change notification settings - Fork 32
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
"Edit this page" on RTD #304
Comments
It can be enabled. I just put a if statement to disabled it. If you want, we can change that. Simply remove the constant
|
Yeh to me it seems unnecessary to disable, unless you have any reason to think differently? |
Just to expand on this: The config for the edit-this-page button would be a bit more complicated when using the theme's version selector drop down. I figured RTD's implementation was superior because it automatically accounts for branch or tag. I didn't think to compare with other themes. |
No objections to enabling. PR is welcome, but the docs should be adjusted accordingly. |
Ah ok so there is a bit of an orthogonal issue here: I see in https://sphinx-immaterial.readthedocs.io/en/latest/ the RTD dropdown shows up (top-right), but in the sphinx-needs documentation it was removed via CSS (https://github.com/useblocks/sphinx-needs/blob/3486ac383ea2ba1a3f65c2484c84b69647e119c4/docs/_static/custom.css#L157) Probably it was removed, because currently it does not look so nice where it shows up. you see its down on the bottom left in the ToC section |
Yeah, I chose to make it float above the right ToC because it wouldn't require altering any HTML templates and seemed the most non intrusive position (unless the header nav bar is hidden). Unfortunately, altering the HTML templates is a stricter undesirable change for us as it complicates merging updates from the mkdocs-material src. The left side ToC is only visible in this theme when the browser veiwport is sufficiently wide. Moving the RTD menu into the global ToC (on left side) would require changing the HTML templates in more than 1 place, a rather significant divergence from upstream's src. |
I suppose we could create our own RTD HTML template and conditionally include it in the navbar, but this is getting off topic... Looks like furo theme hosts its own RTD drop-down HTML src (and duplicated with a different filename for some reason) which is included in Sphinx' Unfortunately, this theme doesn't respect Sphinx' In a Firefox dev console, I was able to get what might be equivalent to the already available version selector by moving the RTD floating "badge" to the end of the header navbar element. With some more CSS tweaking I got it to look like this: I'm not sure what the preferred solution is here, but after researching how this is done in furo, I'm still leaning towards "don't fix what ain't broken." |
@chrisjsewell I opened #306 as a proof of concept in moving the RTD flyout menu to the header navbar (previewed on RTD here). Its still not very ideal on mobile, but it is a WIP. The injected RTD "badge" is not hidden on purpose (for comparison purposes). The JS that RTD uses seems to inject the badge in a way that isn't great for themes that aren't rtd-sphinx-theme. Even the advice in RTD's docs is really meant for variants of rtd-sphinx-theme (not really useful for any other themes). Although, they're currently revising the process of integrating the flyout menu... |
On https://jbms.github.io/sphinx-immaterial/customization.html#themeconf-edit_uri it says:
But I know the pydata-sphinx-theme (and its derivative sphinx-book-theme) have this functionality working on RTD:
https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/index.html
So are you sure this can't be enabled?
The text was updated successfully, but these errors were encountered: