-
Notifications
You must be signed in to change notification settings - Fork 317
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
Sidebars from sphinx-multiversion #234
Comments
Ah I don't believe that it does. Here's the sidebar template: https://github.com/pandas-dev/pydata-sphinx-theme/blob/master/pydata_sphinx_theme/docs-sidebar.html I think we'd need to add in some lines there about adding the extra HTML templates if desired. |
Is there some other suggested way of building multiple versions and linking between them? I've seen some comments in the issues about enabling something like the ReadTheDocs version selector, but I'm not clear on how to make use of them. |
hmmm, I don't know of another way to accomplish this unless the multiversion extension lets you insert a widget or button somewhere, but I think we should probably add support for the Sphinx sidebar extensions |
Otherwise, I can upgrade that snippet file into a landing page, and have users select from there. |
I think you could define your own template in a |
The |
I think it should just follow whatever is the normal practice for doing this in |
Hmmm, I've put a document called {% extends "pydata_sphinx_theme/layout.html" %}
{% block docs_toc %}
<h1>This is a version sidebar</h1>
{{ super() }}
{% endblock %} However, nothing is appearing on the page. I can't even find it being referenced in the Sphinx log (with |
I'm not sure what to tell you (and I'm about to go on paternity leave so probably won't be able to help out). Maybe @jorisvandenbossche has thoughts there. |
Enjoy your leave. @jorisvandenbossche , I did managed to figure out that I needed to call the file {% extends "!pydata_sphinx_theme/layout.html" %}
{% block docs_navbar %}
{{ super() }}
{% if versions %}
<div class="container-xl">
<h4>{{ _('Versions') }}</h4>
<ul>
{%- for item in versions %}
<li><a href="{{ item.url }}">{{ item.name }}</a></li>
{%- endfor %}
</ul>
</div>
{% endif %}
{% endblock %} (everything to do with versions comes from |
Is there anything I can do to help add the hooks for customising the sidebar in the |
Hey, we've done this downstream in spyder-ide/spyder-docs-sphinx-theme (check out our docs site for how it looks) and hope to upstream support here soon, at least the ability to inject your custom templates in the sidebar, and perhaps full support for the Sphinx-Multiversion dropdown without having to add bespoke support to each docs site. Stay tuned, and if you want a quick fix, check out spyder-ide#33 for how we added the hooks (not sure its the best way, but we iterated a few times on it). |
Hi, yep as @CAM-Gerlach says we have worked on this for the Spyder docs (and we added some other stuff that maybe could be nice to get upstream too :) ). Particularly, these are a couple of ideas we thought about (we went with the first alternative but maybe is worthy to explore the second alternative too) to render the versions information and that you can see implemented in the PR linked by @CAM-Gerlach :
Theme sideChange the {%- if sidebars %}
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
{%- endif %} Your docs sideAdd a template to manage the version to the html_sidebars = {
'**': ["versioning.html"],
}
Theme sideChange the {%- if versions %}
{%- include "versioning.html" %}
{%- endif %} Theme side/your docs sideProbably in this case a base |
A middle ground between the two we also thought about that has most of the advantages of both is to simply host the |
Hmmm.... I'm not keen on copying |
Note that this theme now supports the Sphinx "sidebars" config: html_sidebars = {
"pagename": ["sidebar1.html", "sidebar2.html"]
} It should now be possible to include any sidebars from other extensions 👍 |
I saw, and was able to do so, thanks! |
wohoo! so I think we can close this now? |
Yes |
🎉 |
I'm trying to use
sphinx-multiversion
on ourpydata-sphinx-theme
docs, and I'm having trouble having the version sidebar appear. I've created theversioning.html
sidebar file as mentioned in the multiversion documentation, and added the following toconf.py
:However, I'm not seeing the sidebars appear. Does the
pydata-sphinx-theme
use this sidebar setting? The fact that the theme has left and right sidebars makes me wonder, but the documentation doesn't seem to mention any alternative setting.If there is an alternative package for generating documentation for multiple versions of a repo which is better integrated with
pydata-sphinx-theme
, I'd be happy to switch too.The text was updated successfully, but these errors were encountered: