Sphinx's env.temp_data equivalent within directives

15 views
Skip to first unread message

Francisco Vicent

unread,
Aug 19, 2022, 4:04:25 PM8/19/22
to nikola-discuss
Hi folks.

I am implementing a RestExtension plugin to support code tabs in Nikola, largely based on sphinx-tabs. Since code tabs need to be aware of each other (within the same document), in Sphinx there is a convenient self.env.temp_data dictionary that can be accessed from within directive's run() methods in order to share data between multiple Directive.run() calls. Does Nikola have an equivalent storage? Right now I am creating a global dictionary within my plugin file that gets cleared every time the compiled signal is emitted, but that only applies to post and pages, thus it won't work in the index page, for example.

I am not that versed in Nikola nor docutils internals, so maybe there is a simpler approach to address this issue that I am not able to see. Please let me know.

Regards,
Francisco
Reply all
Reply to author
Forward
0 new messages