add_ai_assistant_context#
- scikitplot._externals._sphinx_ext._sphinx_ai_assistant.add_ai_assistant_context(app, pagename, templatename, context, doctree)[source]#
Inject AI-assistant configuration into each HTML page’s template context.
Registered with Sphinx’s
html-page-contextevent insetup.- Parameters:
- appsphinx.application.Sphinx
The active Sphinx application instance.
- pagenamestr
The logical page name (e.g.
"index").- templatenamestr
The Jinja2 template name (e.g.
"page.html").- contextdict
The template rendering context; modified in place.
- doctreedocutils.nodes.document or None
The parsed document tree for the page.
- Returns:
- None
- Parameters:
- Return type:
None
Notes
Security: Serialised via
_safe_json_for_script(XSS guard). Invalid position → fallback to"sidebar"with a logged warning. Providers with dangerousurl_templateschemes are filtered out.