Skip to content

Commit 8bb3845

Browse files
authored
Merge pull request #96 from swyddfa/develop
New Release
2 parents 2680320 + 103acaa commit 8bb3845

33 files changed

+609
-288
lines changed

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
"**/.tox": true,
2222
"**/.pytest_cache": true,
2323
"**/.ipynb_checkpoints": true,
24-
"**/.coverage": true
24+
"**/.coverage": true,
25+
"**/.vscode-test": true
2526
},
2627
"python.pythonPath": ".env/bin/python",
27-
"python.formatting.provider": "black"
28+
"python.formatting.provider": "black",
2829
}

code/README.md

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,102 @@
1-
# Esbonio
1+
# Esbonio ![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/swyddfa.esbonio?style=flat-square)
22

33
**This extension is in early development**
44

5-
Esbonio is an extension for editing Sphinx projects.
5+
Esbonio is an extension that provides a language server for working with
6+
[Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects.
7+
8+
## Setup
9+
10+
The language server works by wrapping an instance of Sphinx's application object,
11+
inspecting it and exposing the results over the Language Service Protocol. As Sphinx is
12+
a Python application this also dictates thats the Language Server is written in Python
13+
and distributed as a package on [PyPi](https://pypi.org/project/esbonio/).
14+
15+
In order to correctly wrap your Sphinx application this requires the Language Server be
16+
installed into the same environment as the one that you use to build your
17+
documentation.
18+
19+
There are a number of ways this can be accomplished.
20+
21+
### Automatically
22+
23+
The extension does its best to automate the installation and application of updates to the
24+
Language Server. By default Esbonio will use the Python environment you have configured
25+
[Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
26+
when installing and running the server. If however, you don't have the Python extension
27+
installed or you want to use a different Python environment for your documentation there
28+
is a configuration option `esbonio.server.pythonPath` that you can use to configure the
29+
environment.
30+
31+
There are a number of configuration options that allow you to control exactly how
32+
installation and updates are handled. See the
33+
[documentation](https://swyddfa.github.io/esbonio/docs/lsp/editors/vscode.html#configuration)
34+
for more details.
35+
36+
![Setup Demo](../resources/images/vscode-setup-demo.gif)
37+
38+
### Manually
39+
40+
Alternatively you can opt to manage the installation of the language server entirely
41+
yourself. To install the Lanaguage Server open the terminal in your desired Python
42+
environment and run
43+
44+
```
45+
(env) $ pip install esbonio[lsp]
46+
```
47+
48+
Then all you have to ensure is that Esbonio is configured to use the same environment,
49+
either through the
50+
[Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
51+
or through the `esbonio.server.pythonPath` configuration option.
52+
53+
To also manage updates manually, be sure to look at the
54+
[documentation](https://swyddfa.github.io/esbonio/docs/lsp/editors/vscode.html#configuration)
55+
for options on how to disable automatic updates.
56+
57+
## Features
58+
59+
### Completions
60+
61+
The language server can provide completion suggestions in various contexts
62+
#### Directives
63+
64+
Completion suggestions are offered for the directives themselves, as well as any options
65+
that they expose.
66+
67+
![Directive Completions](../resources/images/complete-directive-demo.gif)
68+
69+
#### Roles
70+
71+
In the case of roles, completions can also be offered for the targets of certain
72+
[supported](https://swyddfa.github.io/esbonio/docs/lsp/features.html#roles) role types
73+
74+
![Role Completions](../resources/images/complete-role-demo.gif)
75+
76+
#### Inter Sphinx
77+
78+
The [intersphinx](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html)
79+
extension can be used to easily link to other Sphinx projects. If configured, the language
80+
server will offer suggestions when appropriate
81+
82+
![InterSphinx Completions](../resources/images/complete-intersphinx-demo.gif)
83+
84+
### Diagnostics
85+
86+
Errors from a build are published to VSCode as diagnostics
87+
88+
![Diagnostics](../resources/images/diagnostic-sphinx-errors-demo.png)
89+
90+
### Syntax Highlighting
91+
92+
This extension also offers a simple grammar definition to enable some basic
93+
syntax highlighting
94+
95+
![Syntax Highlighting](../resources/images/syntax-highlighting-demo.png)
96+
97+
## Alternatives
98+
99+
This project was created to scratch an itch, if it happens to also scratch an itch
100+
for you then great! If not, here are some alternatives you may wish to consider
101+
102+
- [reStructuredText](https://marketplace.visualstudio.com/items?itemName=lextudio.restructuredtext)

code/changes/47.fix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix edge cases around syntax highlighting bold/italic elements.

code/changes/49.fix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The extension now activates when it detects a sphinx project

code/changes/50.fix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The language client now also listens to changes in Python files so that we can
2+
pick up changes in the project's ``conf.py```

code/changes/70.fix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix edge cases around syntax highlighting inline code snippets

code/changes/85.feature.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Expose an ``esbonio.log.level`` config option that allows the level of logging
2+
output to be configured

code/changes/88.feature.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Add ``esbonio.server.updateFrequency`` option that controls how often the
2+
extension should check for updates. Valid values are ``daily``, ``weekly``,
3+
``monthly`` and ``never```

code/changes/89.feature.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add ``esbonio.server.updateBehavior`` option that controls how updates should be
2+
applied. Valid values are ``promptAlways``, ``promptMajor`` and ``automatic``

code/package-lock.json

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)