-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Update readthedocs theme with upstream #1594
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
Conversation
@Blendify I'm taking the confidence to mention you here since you are one of the main maintainers of Read the Docs Sphinx Theme. It would be awesome if you could take a look at these changes when you have some time and give some feedback to mkdocs folks here. I really appreciate your help. You can just ignore this notification and that's fine. I'm sorry to bother you. |
There is no need to feel sorry, I am glad to help. I will take a look. |
Some toc options were not included these include:
Is there a reason these are not supported? |
MkDocs' concept of hidden pages is very different from Sphinx and therefore this option makes no sense. As I understand it, Sphinx page objects include a Or am I misunderstanding the purpose of this setting?
I haven't worked on these. Basically, I need to determine what is different about the HTML with these options enable/disabled and add the same logic to our template. Personally they are not high priority items so I haven't got to them yet. And the assumption is they could always be added at any time. |
I'm struggling to see the difference between As an aside, the documentation for
But that is not strictly true. You still get |
Hmm, our docs are a bit miss leading. http://www.sphinx-doc.org/en/stable/templating.html#toctree explains these options better. |
@Blendify thank you. Those docs are must more clear. I now have the following implemented:
|
I will take another look again, but from my first look over, it looked pretty good. |
Update support files and nav. Still not getting the expand option for nav though.
It is included above search box. This matches upstream. Note that the homepage still needs to be listed in the `nav` setting or there won't be any homepage.
In the upstream Sphinx theme, this is controled when defining the toctree. However, Sphinx has a seperate settign for identifying the "homepage". In MkDocs the homepage is identified at the first item in the `nav`. Therefore, without this setting you can't exclude the homepage from the sidebar like you can in Sphinx. With this setting we get feature parity.
This output is a little weird as the section title is a link that does nothign when you click it. You need to click the `+` to expand the submenu. But that is what the upstream theme requires to work.
This updates the
readthedocs
theme to more closely match the upstream Sphinx theme (at version 0.4.1). This should resolve #588 and #1374.The following theme config settings were added:
include_homepage_in_sidebar
: Lists the homepage in the sidebar menu. AsMkDocs requires that the homepage be listed in the
nav
configurationoption, this setting allows the homepage to be included or excluded from
the sidebar. Note that the site name/logo always links to the homepage.
Default:
True
.prev_next_buttons_location
: One ofbottom
,top
,both
, ornone
.Displays the “Next” and “Previous” buttons accordingly. Default:
bottom
.navigation_depth
: The maximum depth of the navigation tree in thesidebar. Default:
4
.titles_only
: If True, removes headers within a page from the sidebar.Default:
False
.