-
Notifications
You must be signed in to change notification settings - Fork 205
Description
We have been working on a Bootstrap-based sphinx theme recently: https://github.com/pandas-dev/pandas-sphinx-theme
We originally wanted to start from this theme, but in the end started from "scratch" (while still looking at the source code here) because we wanted to use bootstrap 4, add some additional features and also ended up with a different layout.
However, I think it would still be interesting to see if this project would welcome some changes to be contributed to this repo.
Some general remarks about this theme:
- We are using Bootstrap 4, while this repo right now is using Bootstrap 2 / 3 (with compatibility for both in the layouts). But from the discussion in Support for bootstrap 4? #146, I understood you would be fine with moving to Bootstrap 4 exclusively (so not keeping compatibility with older bootstrap versions), if doing a proper version bump to indicate this.
- We are using a "BootstrapHTML5Translator", inspired on open PRs in this repo: Customized and bootstrap-ifyed HTMLTranslator #92, Additional custom html writer changes #104. This would replace some javascript code.
- We are also using "navigation objects" in the jinja2 templates to control the formatting of the navigation items, instead of letting sphinx generate the hard-coded html (eg the
{{ toctree(maxdepth=...) }}
in the layout here) and then have javascript to "fix up" the html generated by sphinx.
See https://github.com/pandas-dev/pandas-sphinx-theme/blob/81683c21877fb21d443be5e7a5f7ba50713950ad/pandas_sphinx_theme/docs-toc.html#L3-L16 for an example how the styled html for the navigation is created in the template.
Currently, this relies on a monkeypatch of sphinx (not ideal, but it's a quite robust one I think, see https://github.com/pandas-dev/pandas-sphinx-theme/blob/master/pandas_sphinx_theme/__init__.py). Ideally this would be included in sphinx itself, but for now this "hack" is working fine for us. Having full control on the layout (instead of having javascript correct it "on the fly") is a big plus IMO.
- We have a different default layout as the layouts included in this repo (there is a navbar, and two sidebars). This will certainly not be a suitable layout for all documentation (it was originally developed for a doc site with a lot of pages).
I think it would be interesting to see if it is easy to refactor the layout in this repo with the infrastructure (as explained above) of our new theme.
So I might be "cutting right to the chase" here without much prior context, but some questions:
- Would there be interest in those elements described above?
- Would there be interest in the layout described above? A possible question here is to what extent it is possible for a single package to distribute different sets of layouts (there is no one layout that rules them all ;))
Personally, I would be happy to see efforts combined. But, it might well be that the more complex layout and some other elements (version dropdowns, ..) in our new theme are "out of scope" for this theme, or that the approach is too different to combine, .. Even then, it might still make sense to see if certain common parts could be shared if there is interest. And at least I wanted to make you aware of the efforts going on in the other package.