Skip to content
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

Create proof of concept that the napari sphinx theme doesn't need to be maintained separatedly #592

Closed
wants to merge 21 commits into from

Conversation

willingc
Copy link
Contributor

@willingc willingc commented Feb 22, 2025

References and relevant issues

This PR is a proof of concept.

Description

Motivation

Maintaining a custom theme adds complexity and maintenance burden. Ideally, one would opt for a custom theme
only if a major feature could not be implemented by another well maintained theme.

Currently, our docs workflow and contribution is more complex than needed if someone is trying to do a local documenation build.

Proof of Concept

This PR demonstrates the possibilities:

  • moving from napari sphinx theme to stock pydata sphinx theme
  • move templates from napari sphinx theme to docs directory _templates
  • move napari css from napari sphinx theme to docs directory _static
  • combine custom.css with the napari css to have one file
  • add annotation/comments for the conf.py file to better understand the configuration
  • fixes the copybutton
  • added more precommit checks
  • added logging for scripts

Next steps

This is by no means merge ready. It was basically to prove to myself that we could create a napari styled theme using the pydata sphinx theme and remove the need to maintain a separate repo for the napari-sphinx-theme.

This all works locally on my mac. Let's see if this draft can pass our CI.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 22, 2025
@psobolewskiPhD
Copy link
Member

Wow! Thanks for the effort on this one!

I'm of two minds about this.
On one hand having it all in one place is really convenient!
On the other hand, the idea of our own theme was to make it easier to use by other repos, e.g. napari-animation (which does use it for docs).

Also I noticed prettier in the pre-commit: does it support myst markdown and the colon fencing we use?
It's something we ran into in the past when trying to implement formatting, see some discussion here:
#54 (comment)

@willingc
Copy link
Contributor Author

@psobolewskiPhD This really was a proof of concept (wasn't aware of napari-animation). I think that the benefit of this PR will be to simplify the napari sphinx theme. Doing the proof of concept, I removed a bunch of cruft and added some best practices. Happy to do it in the napari sphinx theme repo.

- pygments highlighting
- headless on mac
- fix styling for This Page source
- search wtf keyboard shortcut (where did you go)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

@willingc
Copy link
Contributor Author

Closing as this is a proof of concept, and I'm satisfied with the results.

@willingc willingc closed this Mar 13, 2025
@willingc willingc deleted the remove-custom branch March 13, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants