pradyunsg / furo

A clean customizable documentation theme for Sphinx
https://pradyunsg.me/furo/quickstart
MIT License
2.65k stars 304 forks source link

Allow inheriting Furo as a Sphinx theme #649

Closed Eric-Arellano closed 1 year ago

Eric-Arellano commented 1 year ago

To inherit Furo, the new Sphinx theme needs to call the setup code from furo/__init__.py's setup. See https://github.com/pradyunsg/furo/pull/648 for an example.

However, currently, these setup helper functions will not run if the theme is not set to Furo. (That's a good default behavior because it avoids Furo doing undesired things when you have Furo installed but aren't actually using it.)

So, this adds the argument validate_furo: bool = True to both _html_page_context and _builder_inited. That allows plugins to use functools.partial to set the argument to False, as done in https://github.com/pradyunsg/furo/pull/648.

The default behavior is unaffected because the default is set to True.

Eric-Arellano commented 1 year ago

Superseded by https://github.com/pradyunsg/furo/commit/48c0bf2aa983fb1ccd79b4167fe85387249afedf. Thank you! 🎉