Esbonio
The Esbonio extension integrates the esbonio
language server into VSCode.
The esbonio
language server aims to make it easier to work with Sphinx documentation projects by proving IDE-like features to your reStructuredText and Markdown files.
Features
Live Preview
The extension can show a live HTML preview of the documentation, so the preview contents change whenever the document is updated.
Syncronised scrolling between the source and preview is also supported.
Completions
The language server can provide completion suggestions in various contexts
Goto Definition
Goto definition is currently implemented for objects linked to by :ref:
and :doc:
roles
Goto Implementation
Goto implementation is available for roles and directives
Diagnostics
Errors from a build are published to VSCode as diagnostics
Hover
Documentation is provided for certain roles and directives.
Document & Workspace Symbols
Section titles and directives within a document are recognised as symbols and displayed in the "Outline" view.
You can also search for symbols within the workspace using the Ctrl+T
shortcut.
Setup
The esbonio
language server is bundled with this extension, so there is no need to install it separately.
However, the server will need access the Python environment you use to build your documentation.
Open the folder containing your documentation project in VSCode, (opening a single file without an active workspace is not currently supported and will lead to errors).
Using the Python: Select Interpreter
command from the Python extension, choose the environment you use to build your documentation.
(You might be required to run the Esbonio: Restart Language Server
command for it to take effect).
Alternatively, you can set the esbonio.sphinx.pythonCommand
option to override the python interpreter used.
Open a reStructuredText or markdown file from your Sphinx project.
Sphinx build output will be available in Esbonio's Output
view in VSCode's panel.
Dependent Extensions
Esbonio relies on the following extensions
By default, Esbonio relies on the offical Python Extension to configure the environment in which it builds your documentation.
The MyST Syntax Highlighting extension provides syntax highlighting rules for MyST flavoured markdown.
Supplementry Extensions
The the following extensions are not required in order to use Esbonio, but you might find them useful
The reStructuredText integrates many other useful tools such as the traditional linters like doc8
and rstcheck
.
It also provides additional editor functionality for working with reStructuredText in general.
While VSCode has included a vendored copy of the reStructuredText Syntax highlighting extension since v1.66
, installing the extension from the marketplace will provide you with the latest version of the syntax definition.