Skip to content

Instantly share code, notes, and snippets.

@Amourspirit
Last active June 13, 2022 23:54
Show Gist options
  • Save Amourspirit/00f00495bf878e30c43f8f3c3f977d51 to your computer and use it in GitHub Desktop.
Save Amourspirit/00f00495bf878e30c43f8f3c3f977d51 to your computer and use it in GitHub Desktop.
How to debug Shinx Docs in VS Code

How to debug Shinx Docs in VS Code

In VS Code add a new configuration to launch json.

Open launch.json ctl+shirt+p and type launch.json. From there you can open launch.json.

The revelent section is to add to your launch.json is Python: Sphinx Docs

{
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true
        },
        {
            "name": "Python: Sphinx Docs",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/env/bin/sphinx-build",
            "cwd": "${workspaceFolder}/docs",
            "args": [
                "-E",
                "-b",
                "html",
                "-d",
                "_build/doctrees",
                ".",
                "_build/html"
            ],
            "console": "integratedTerminal",
            "justMyCode": false
        }
    ]
}

Options

args

  • -E to force it to rebuild even if nothing’s changed
  • -b to set bulder
  • html builder
  • d path for the cached environment and doctree files (default: OUTPUTDIR/.doctrees)
  • _build/doctrees cached environment
  • . source directory
  • _build/html output directory.

Other setting

  • justMyCode sets if debugger steps only through local code or include code in site-packages.

Pycharm

For PyCharm see Step debugging sphinx-build in PyCharm

See Also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment