You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
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
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-builderJan 14, 2022
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
The text was updated successfully, but these errors were encountered: