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

Switch our build system to use the sphinx-theme-builder #417

Closed
Tracked by #416
choldgraf opened this issue Oct 19, 2021 · 4 comments
Closed
Tracked by #416

Switch our build system to use the sphinx-theme-builder #417

choldgraf opened this issue Oct 19, 2021 · 4 comments
Labels
enhancement New feature or request 🏷️ maintenance Related to maintaining and developing this theme

Comments

@choldgraf
Copy link
Member

choldgraf commented Oct 19, 2021

Description / Summary

Our current setup commits the compiled CSS + hashes directly into our repository. The biggest downside to this is that merge conflicts happen any time somebody merges a PR when another person has a PR open that also modifies CSS or JS.
We're also using the web-compile package to compile our web assets. This is quite lightweight and useful, though we do miss some of the benefit of the NPM ecosystem, which has a lot more functionality that is designed for building web assets.

Recently there has emerged a new theme development tool called sphinx-theme-builder. This is a Python package that bundles a version of nodejs along with it, so you don't need to go through the hassle of setting up your own node environment. It also has a command line set of tools that let you quickly perform compilation steps via webpack, so you can use the full webpack ecosystem, vendor fonts/packages/etc as you like but without needing to do a bunch of javascript installs. Because the compilation is part of the build step, it means that you do not need to check your compiled CSS/JS assets into the repository, you can do that at build time, so you don't generate merge conflicts whenever you change the JS/CSS compiled assets. Finally, the theme builder is a nice step towards defining a standard sphinx theme structure, which will make it easier to port patterns and share development between the themes that are out there.

Implementation details

The PyData theme recently switched over to using this new build system, and it has worked out pretty nicely over there. Here's the PR where @pradyunsg did that work:

pydata/pydata-sphinx-theme#514

@choldgraf choldgraf added enhancement New feature or request 🏷️ maintenance Related to maintaining and developing this theme labels Oct 19, 2021
@choldgraf choldgraf changed the title Stop bundling the compiled CSS with our theme Stop bundling the compiled CSS with our theme by following Furo's build pattern Oct 19, 2021
@kousu
Copy link
Contributor

kousu commented Nov 11, 2021

That's great! That's very clever.

@pradyunsg
Copy link
Member

Alright, at the rate of ~1 hour per day, I've been working on sphinx-theme-builder and Furo's main branch has moved over.

You might be able to copy more than just the asset build system. :)

@choldgraf choldgraf changed the title Stop bundling the compiled CSS with our theme by following Furo's build pattern Switch our build system to use the sphinx-theme-builder Jan 14, 2022
@AakashGfude
Copy link
Member

Closing this issue. As this PR #469 does the switch.

@choldgraf
Copy link
Member Author

Woohoo! Thanks @AakashGfude for tackling this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🏷️ maintenance Related to maintaining and developing this theme
Projects
None yet
Development

No branches or pull requests

4 participants