{"id":24624,"library":"sphinx-plotly-directive","title":"sphinx-plotly-directive","description":"A Sphinx directive for embedding Plotly figures in documentation. Current version 0.1.3, release cadence is low (last release Aug 2020).","status":"active","version":"0.1.3","language":"python","source_language":"en","source_url":"https://github.com/harupy/sphinx-plotly-directive","tags":["sphinx","plotly","documentation","directive"],"install":[{"cmd":"pip install sphinx-plotly-directive","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required as the documentation framework.","package":"sphinx","optional":false},{"reason":"Required to render Plotly figures.","package":"plotly","optional":false}],"imports":[{"note":"It is a Sphinx extension, not a Python module to import in code.","wrong":"from sphinx_plotly_directive import ...","symbol":"plotly directive","correct":"No explicit import; activate via extensions = ['sphinx_plotly_directive'] in conf.py"}],"quickstart":{"code":"# conf.py\nextensions = [\n    'sphinx_plotly_directive',\n]\n\n# index.rst\n.. plotly::\n\n    import plotly.graph_objects as go\n    fig = go.Figure(data=go.Scatter(x=[1,2,3], y=[1,3,2]))\n    fig","lang":"python","description":"Add the extension to conf.py, then use the .. plotly:: directive in RST."},"warnings":[{"fix":"Ensure the last line or the variable name is `fig` (or use `:show-source:` option, but still need fig).","message":"The directive expects the Python code to assign a variable `fig` (the plotly figure). If no variable named `fig` is defined, nothing is rendered.","severity":"gotcha","affected_versions":"all"},{"fix":"Check for duplicate extension loading or use a different directive name via `plotly_plotly_directive_directive_name` option in conf.py (undocumented).","message":"When using with Sphinx 4+, there is a known issue with 'plotly' directive clashing if other plotly-related extensions are loaded. This can cause 'WARNING: directive plotly already registered'.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Migrate to sphinxcontrib-plotly or nbsphinx if you need active maintenance.","message":"The extension has not been updated since 2020. Consider using sphinxcontrib-plotly or the newer nbsphinx for Plotly support.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure only one extension providing 'plotly' is loaded in conf.py, or rename the directive via configuration (not exposed in this extension).","cause":"Another Sphinx extension also registers a 'plotly' directive (e.g., sphinxcontrib-plotly).","error":"WARNING: directive plotly already registered."},{"fix":"Make sure the code block ends with `fig` assigned to a Plotly figure object.","cause":"The Python code inside the directive did not assign a variable named `fig`.","error":"Plotly figure not rendered in output (empty space or missing)."},{"fix":"Use `:show-source:` in RST directive.","cause":"Incorrect option name; the directive option is `:show-source:` (with hyphen), not `:show_source:`.","error":"TypeError: __init__() got an unexpected keyword argument 'show_source'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}