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
}
]
}
-E
to force it to rebuild even if nothing’s changed-b
to set bulderhtml
builderd
path for the cached environment and doctree files (default: OUTPUTDIR/.doctrees)_build/doctrees
cached environment.
source directory_build/html
output directory.
justMyCode
sets if debugger steps only through local code or include code in site-packages.
For PyCharm see Step debugging sphinx-build in PyCharm