sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

Allow extensions to detect freshenv builds

Open chrisjsewell opened this issue 1 year ago • 1 comments
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.

chrisjsewell avatar May 07 '24 02:05 chrisjsewell

(Also added a docstring for the Sphinx.__init__)

chrisjsewell avatar May 07 '24 02:05 chrisjsewell