Skip to content

Commit

Permalink
Added a new way to work with sphinx.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Jan 30, 2016
1 parent 83b5151 commit c12ce46
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -5,7 +5,7 @@ root = true

# Tab indentation (no size specified)
[*]
indent_style = tab
indent_style = space

[{.travis.yml,npm-shrinkwrap.json}]
indent_style = space
Expand Down
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -38,6 +38,10 @@ This extension is hosted at [Visual Studio Marketplace](https://marketplace.visu

When the extension information is displayed, click the install button.

## Integration with Sphinx

Check out the [workarounds](docs/sphinx.md) for more details.

## Contributing to the Code

Check out the [development documentation](docs/development.md) for more details
Expand Down
51 changes: 49 additions & 2 deletions docs/sphinx.md
@@ -1,8 +1,55 @@
#How to work with Sphinx

It has been planned to add Sphinx integration, but it won't come soon. Before that, manual steps can be used,
It has been planned to add Sphinx integration, but it won't come soon. Before that, a few workarounds can be used.

## Use VS Code Tasks
This requires a new file `./.vscode/tasks.json` to be created in your document project.

The sample content is as below,

```
{
"version": "0.1.0",
"command": "make",
"isShellCommand": true,
"args": ["html"],
"showOutput": "silent",
"problemMatcher": {
"owner": "restructuredtext",
"fileLocation": ["absolute"],
"pattern": {
"regexp": "^(.*):(\\d+):\\s+(WARNING|ERROR):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
}
}
```

Once this file is saved, the following steps can activate it in VS Code,

1. Press `F1` to open the Command panel in VS Code.
1. Type "Run Task" and choose "Tasks: Run Task" command from the list.
1. Press `Enter` key to active the task list, where "make" is showed.
1. Choose "make" and press `Enter` key again.

The warning and errors can be checked in Error panel by pressing `⇧⌘M`.

Note that this assumes your document project has `make.bat` or `makefile` at root directory.

## Launch a Terminal (The Easy Way)
If you do want to open a terminal, it is quite easy to launch a terminal as below,

1. Open a Sphinx project folder in VS Code.
1. Press `⇧⌘C` to launch a terminal.

At terminal Sphinx commands can be executed.
At terminal Sphinx commands can be executed.

## Launch a Terminal (The Hard Way)
Alternatively, the following steps can be used,

1. Press `F1` to open the Command panel in VS Code.
1. Type "Terminal" till "Open New Terminal" command shows and highlights.
1. Press `Enter` key to launch the terminal.

0 comments on commit c12ce46

Please sign in to comment.