sphinx
sphinx copied to clipboard
Allow extensions to detect freshenv builds
trafficstars
Some extensions cache data outside of the BuildEnvironment (usually for memory/performance reasons). For these extensions it would be helpful to detect when sphinx-build -E has been called, which in essence suggests the user wishes to remove cached data before building.
This PR adds the Sphinx.fresh_env_used public property, exposing Sphinx._fresh_env_used in an immutable manner.
Note, you could create some form of callback event for this, but I feel this is probably overkill and the property will suffice.
(Also added a docstring for the Sphinx.__init__)