N8-CIR-Bede / documentation

Documentation for the N8CIR Bede Tier 2 HPC faciltiy
https://bede-documentation.readthedocs.io/en/latest/
7 stars 11 forks source link

Switch to (branded) alternate sphinx theme #87

Closed ptheywood closed 2 years ago

ptheywood commented 2 years ago

While working on splitting the source / using toctree more heavily, issues with the sphinx-bootstrap theme have been cropping up that are hard to workaround, or are not trivial to resolve.

This includes:

Many of these would be resolved by switching to the sphinx-rtd-theme, with rebranding of colours.

This is essentially duplicating previous work, but it should be less effort than manually modifying the sphinx-bootstrap-theme to address the issues highlighted above.

As other potential alternative themes, furo and pydata-sphinx-them are potential alternatives

If any big theme changes are made, it would also be worthwhile ensuring accessibility guideleines are met (#42)

ptheywood commented 2 years ago

Some testing of other sphinx themes without significant branding for reference, to see if they resolve the issues above. Further branding would be possible if the switch is deemed worthwhile.

sphinx-rtd-theme

image

furo

Furo has a user-toggleable dark and light theme, It should be possible to configure the default or disable this if it complicates and custom css.

Light

image

Dark

image

pydata

image

markdturner commented 2 years ago

Furo looks the best if it can be made to include in-page navigation.

ptheywood commented 2 years ago

Furo's developer / maintainer has marked issues for combining the site navigation and page navigation into a single sidebar as wontfix, as it is intended to be separate.

https://github.com/pradyunsg/furo/issues/79

I'm not convinced the split site and page toc is the better option, especially when both fold/collapse independently so the second toc may not be found by users.

We could probably override furo's toc implementation to include the page navigation, but this might be a decent amount of effort, so I'll likely fallback to rtd-theme unfortunately.

sphinx-book-theme is another modern theme, but again this implements a right-hand content sidebar, but does not collapse it as readily as furo.

ptheywood commented 2 years ago

Material theme

A few other HPC centres (Archer2, baskerville) use mkdocs based documentation with the Material theme. There is a sphinx port of this theme, which splits the navigation and page content like Furo, but does not fold the in-page nav as aggressively.

image

However it does fold the site navigation quite early, and the mobile navigation lackas any indication of depth:

image

It is not clearly under development/active maintenance however.

Sphinx-book-theme

The sphinx book theme mentioned in the previous comment seems like a good option for a non-RTD theme which splits the navigation and in-page tocs.

image

My only real complaint so far is the in-page highlighting of the current element does not behave well with short sections, as it skips some headings depending on content length.

I.e. the Installing Conda Packages section is never actively highlighted

image

I'd also like the topbar to include the n8cir logo when the side-nav is folded away, but i've not looked into this yet.

I'll spend a short amount of time customising/branding sphinx-rtd-theme and sphinx-book-theme to see how they look with branding, then potentially reach out for feedback on which option is prefferred unless a clear winner arises.

Additionally, the annoucnement theme option of sphinx-book-theme could be very useful for important status updates, such as the Rhel8 migration.

https://sphinx-book-theme.readthedocs.io/en/latest/customize/announcements.html

ptheywood commented 2 years ago

Simple customisation of the sphinx-book-theme, pushed to theme-test-book.

If selected over RTD, there's still a bit more work to be done

So far switching to this has greatly reduced the amount of custom CSS required to workaround issues, and fixes the major problems with the boostrap theme highlighted at the start of this issue.

image

ptheywood commented 2 years ago

After some (minor) customisation / branding of the sphinx-rtd-theme, pushed to theme-test-rtd.

If selected over the book theme, it would still benefit from:

image

ptheywood commented 2 years ago

I've set up temporary hosted demos of the RTD and book themes via ghpages + repo forks for demos withotu local builds being required: