File tree Expand file tree Collapse file tree
src/sphinxnotes/data/render Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from abc import ABC , abstractmethod
44
55from sphinx .util .docutils import SphinxDirective
6+ from docutils .parsers .rst .directives import _directives
7+ from docutils .parsers .rst .roles import _roles
68
79from .render import HostWrapper
810from .datanodes import pending_node
@@ -50,6 +52,7 @@ def __init__(self) -> None:
5052 self .global_ = {}
5153
5254 self .add_global_context ('sphinx' , _SphinxExtraContext ())
55+ self .add_global_context ('docutils' , _DocutilsExtraContext ())
5356 self .add_parsing_phase_context ('markup' , _MarkupExtraContext ())
5457 self .add_parsing_phase_context ('section' , _SectionExtraContext ())
5558 self .add_parsing_phase_context ('doc' , _DocExtraContext ())
@@ -120,6 +123,14 @@ class _SphinxExtraContext(GlobalExtraContxt):
120123 def generate (self ) -> Any :
121124 return proxy (self .app )
122125
126+ class _DocutilsExtraContext (GlobalExtraContxt ):
127+ @override
128+ def generate (self ) -> Any :
129+ # FIXME: use unexported api
130+ return {
131+ 'directives' : _directives ,
132+ 'roles' : _roles ,
133+ }
123134
124135# ========================
125136# Extra Context Management
You can’t perform that action at this time.
0 commit comments