Visual Studio Code でSphinxのビルドタスクを設定
${command:python.interpreterPath} でvenv環境のPythonを指定
problemMatcherで sphinx-buildの警告を拾う
code:tasks.json
{
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build html",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "${command:python.interpreterPath}",
"args": [
"-m", "sphinx", "-M", "html", "source", "build"
],
"problemMatcher": {
"owner": "python",
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+)-(\\d+):\\s+(WARNING|ERROR):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"endColumn": 4,
"severity": 5,
"message": 6
}
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}