-
When I tried to create an own theme based on furo I stumbled over the fact that the context variables are only initialized if the theme is called "furo": Lines 136 to 137 in fd66689 ❯ make html
Running Sphinx v4.1.2
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
Theme error:
An error happened in rendering the page index.
Reason: UndefinedError("'furo_pygments' is undefined")
make: *** [html] Error 2 It would be splendid to be able to inherit from furo for reusing in an own custom theme. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
This is tricky. A whole bunch of stuff in Furo's Python side is tied to the exact asset names, or exact contents/structure of the templates. I'm happy to accept a PR for this, but, TBH, I'm not even sure what exactly the needs of downstream themes would be from this one; or what promises around stability I'd be willing to make. |
Beta Was this translation helpful? Give feedback.
-
Hey @pradyunsg, would you still accept a PR for this? We're hoping to migrate the Sphinx theme for Qiskit—IBM's open source quantum computing library—from a Pytorch fork to Furo. Because we have multiple repos, we release a package qiskit_sphinx_theme to PyPI with the theme. It would not be sustainable for us to have each Qiskit repository override HTML templates & CSS styling in their repo directly. I'm happy to champion this project. I work on Qiskit for my day job, with documentation as my main priority, so I will be around for any maintenance too.
For now, the main thing is to not crash when inheriting the theme. That is, this [theme]
inherit = furo I don't think there's much else Furo will need to do. Sphinx has solid support already for inheriting themes, including:
I don't think you need to make any guarantees around stability. It's fair to mark this feature unstable. The only stability that would help us at Qiskit is having a test that I would add to ensure you can inherit the Theme without crashing. (qiskit_sphinx_theme would pin to exact Furo versions. Anytime we upgrade Furo versions, we'd closely check for any relevant changes.) P.S. Thanks for this theme and your other work in Python! Update April 13 |
Beta Was this translation helpful? Give feedback.
-
In 48c0bf2, I've removed the check that enforced that the theme name be People are welcome to go buckwild with inheriting from this theme; but know that there are no stability promises involved if you do this -- see https://pradyunsg.me/furo/stability/#undocumented-unstable-customisations for the details on that. Thanks @Eric-Arellano for the nudge on this, since that made me look into this again. :) |
Beta Was this translation helpful? Give feedback.
In 48c0bf2, I've removed the check that enforced that the theme name be
furo
.People are welcome to go buckwild with inheriting from this theme; but know that there are no stability promises involved if you do this -- see https://pradyunsg.me/furo/stability/#undocumented-unstable-customisations for the details on that.
Thanks @Eric-Arellano for the nudge on this, since that made me look into this again. :)