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
I'm trying to write an extension which runs code to be rendered, but I'd like to be able to split the code across several directives and have a shared state between them (more specifically a share prolog for imports and initialisation code). I don't know where to store it.
This is similar to what the ..testsetup directive does for ..doctest, except that doctest uses a specific renderer to figure out the relationship between the directives.
The documentation of sphinx.environment.BuildEnvironment.current_document says it exists while processing the current document, so I suppose I could use that. However the documentation is a bit terse, I'm unsure about its scope.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write an extension which runs code to be rendered, but I'd like to be able to split the code across several directives and have a shared state between them (more specifically a share prolog for imports and initialisation code). I don't know where to store it.
This is similar to what the ..testsetup directive does for ..doctest, except that doctest uses a specific renderer to figure out the relationship between the directives.
The documentation of sphinx.environment.BuildEnvironment.current_document says it exists while processing the current document, so I suppose I could use that. However the documentation is a bit terse, I'm unsure about its scope.
Beta Was this translation helpful? Give feedback.
All reactions