Skip to content

Commit f75be86

Browse files
authored
Merge pull request #177 from bollwyvl/add-sphinx-docs
Start sphinx docs
2 parents fcf7b65 + 4574cd7 commit f75be86

20 files changed

+836
-27
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,5 @@ junit.xml
114114
coverage/
115115
.vscode/
116116
_schema.d.ts
117+
_build
117118
.virtual_documents/

CHANGELOG.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CHANGELOG
1+
## CHANGELOG
22

33
## `@krassowski/jupyterlab-lsp 0.8.0` (unreleased)
44

@@ -52,7 +52,7 @@
5252
[#164](https://github.com/krassowski/jupyterlab-lsp/pull/164)
5353
)
5454

55-
## `lsp-ws-connection 0.3.1`
55+
### `lsp-ws-connection 0.3.1`
5656

5757
- added `sendSaved()` method (textDocument/didSave) (
5858
[#147](https://github.com/krassowski/jupyterlab-lsp/pull/147)
@@ -61,7 +61,7 @@
6161
[#140](https://github.com/krassowski/jupyterlab-lsp/pull/140)
6262
)
6363

64-
## `@krassowski/jupyterlab-lsp 0.7.0`
64+
### `@krassowski/jupyterlab-lsp 0.7.0`
6565

6666
- features
6767

@@ -128,7 +128,7 @@
128128
[#140](https://github.com/krassowski/jupyterlab-lsp/pull/140)
129129
)
130130

131-
## `lsp-ws-connection 0.3.0`
131+
### `lsp-ws-connection 0.3.0`
132132

133133
- infrastructure
134134
- brought into monorepo [#107](https://github.com/krassowski/jupyterlab-lsp/pull/107)
@@ -141,7 +141,7 @@
141141
- added initialization checks before executing sendChange to comply
142142
with LSP specs [#115](https://github.com/krassowski/jupyterlab-lsp/pull/115)
143143

144-
## `jupyter-lsp 0.7.0b0`
144+
### `jupyter-lsp 0.7.0b0`
145145

146146
- features
147147
- adds a language server status endpoint (
@@ -155,14 +155,14 @@
155155
[#100](https://github.com/krassowski/jupyterlab-lsp/pulls/100)
156156
)
157157

158-
## `@krassowski/jupyterlab-lsp 0.6.1`
158+
### `@krassowski/jupyterlab-lsp 0.6.1`
159159

160160
- features
161161
- adds an indicator to the statusbar
162162
- dependencies
163163
- removes unused npm dependencies
164164

165-
## `@krassowski/jupyterlab-lsp 0.6.0`
165+
### `@krassowski/jupyterlab-lsp 0.6.0`
166166

167167
- features
168168
- allows "rename" action in file editor
@@ -174,7 +174,7 @@
174174
- dependencies
175175
- requires `jupyter-lsp`
176176

177-
## `jupyter-lsp 0.6.0b0`
177+
### `jupyter-lsp 0.6.0b0`
178178

179179
- features
180180
- starts language servers on demand

azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ variables:
2828
jobs:
2929
- template: ci/job.lint.yml
3030
- template: ci/job.test.yml
31+
- template: ci/job.docs.yml
3132
- template: ci/job.combine.yml

ci/job.docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
parameters:
2+
platforms:
3+
- name: Linux
4+
vmImage: ubuntu-16.04
5+
activate: source activate
6+
pythons:
7+
- name: ThreeSeven
8+
spec: '>=3.7,<3.8.0a0'
9+
env_update: conda env update -n jupyterlab-lsp --file env-test.yml --quiet
10+
env_docs: conda env update -n jupyterlab-lsp --file requirements/docs.yml --quiet
11+
12+
jobs:
13+
- ${{ each platform in parameters.platforms }}:
14+
- ${{ each python in parameters.pythons}}:
15+
- job: Docs
16+
dependsOn:
17+
- Lint
18+
pool:
19+
vmImage: ${{ platform.vmImage }}
20+
steps:
21+
- template: steps.conda.yml
22+
parameters:
23+
name: ${{ platform.name }}
24+
25+
- script: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.spec }}" ">=1,<2"
26+
displayName: generate env with python and lab version
27+
28+
- script: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }}
29+
displayName: base dependencies
30+
31+
- script: ${{ parameters.env_docs }} || ${{ parameters.env_docs }} || ${{ parameters.env_docs }}
32+
displayName: docs dependencies
33+
34+
- script: ${{ platform.activate }} jupyterlab-lsp && python scripts/docs.py
35+
displayName: build docs
36+
37+
- task: PublishPipelineArtifact@0
38+
displayName: publish docs
39+
inputs:
40+
targetPath: docs/_build
41+
artifactName: Docs $(Build.BuildId)

ci/job.lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
name: ${{ platform.name }}
2222

2323
- script: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.spec }}" ">=1,<2"
24-
displayName: base dependencies
24+
displayName: generate env with python and lab version
2525

2626
- script: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }}
2727
displayName: testing dependencies

ci/job.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
name: ${{ platform.name }}
3636

3737
- script: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.spec }}" "${{ python.lab }}"
38-
displayName: update environment with python and lab version
38+
displayName: generate env with python and lab version
3939

4040
- script: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }}
4141
displayName: update conda environment with test dependencies

docs/Architecture.ipynb

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"## Architecture"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {
14+
"hide_input": true
15+
},
16+
"outputs": [],
17+
"source": [
18+
"import graphviz, IPython, pathlib\n",
19+
"\n",
20+
"@IPython.core.magic.register_line_cell_magic\n",
21+
"def dot(line, cell=None):\n",
22+
" return graphviz.Source(pathlib.Path(line).read_text() if line else cell)"
23+
]
24+
},
25+
{
26+
"cell_type": "markdown",
27+
"metadata": {},
28+
"source": [
29+
"### As-Is\n",
30+
"These are how we _think_ everything works in the current release."
31+
]
32+
},
33+
{
34+
"cell_type": "markdown",
35+
"metadata": {},
36+
"source": [
37+
"#### Front End"
38+
]
39+
},
40+
{
41+
"cell_type": "code",
42+
"execution_count": null,
43+
"metadata": {
44+
"hide_input": true
45+
},
46+
"outputs": [],
47+
"source": [
48+
"%dot dot/as-is/frontend.dot"
49+
]
50+
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"#### Backend"
56+
]
57+
},
58+
{
59+
"cell_type": "code",
60+
"execution_count": null,
61+
"metadata": {
62+
"hide_input": true
63+
},
64+
"outputs": [],
65+
"source": [
66+
"%dot dot/as-is/backend.dot"
67+
]
68+
},
69+
{
70+
"cell_type": "markdown",
71+
"metadata": {},
72+
"source": [
73+
"### Proposals\n",
74+
"Some fragments of how the architecture could change in the future, and why (or why not) they might be a good idea."
75+
]
76+
},
77+
{
78+
"cell_type": "markdown",
79+
"metadata": {},
80+
"source": [
81+
"#### Frontend: One Socket Per Language\n",
82+
"[#165](https://github.com/krassowski/jupyterlab-lsp/pull/165) proposes a single `ConnectionManager` and at most one `Connection` _per language_ instead of one of each _per document_.\n",
83+
"\n",
84+
"**Pro**\n",
85+
"\n",
86+
"- Many fewer WebSocket connections\n",
87+
"\n",
88+
"**Contra**\n",
89+
"\n",
90+
"- backwards incompatibility"
91+
]
92+
},
93+
{
94+
"cell_type": "code",
95+
"execution_count": null,
96+
"metadata": {
97+
"hide_input": true
98+
},
99+
"outputs": [],
100+
"source": [
101+
"%dot dot/to-be/frontend-165.dot"
102+
]
103+
}
104+
],
105+
"metadata": {
106+
"kernelspec": {
107+
"display_name": "Python 3",
108+
"language": "python",
109+
"name": "python3"
110+
},
111+
"language_info": {
112+
"codemirror_mode": {
113+
"name": "ipython",
114+
"version": 3
115+
},
116+
"file_extension": ".py",
117+
"mimetype": "text/x-python",
118+
"name": "python",
119+
"nbconvert_exporter": "python",
120+
"pygments_lexer": "ipython3",
121+
"version": "3.7.6"
122+
}
123+
},
124+
"nbformat": 4,
125+
"nbformat_minor": 4
126+
}

docs/EXTENDING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# Extend jupyterlab-lsp and jupyter-lsp
1+
## Extend jupyterlab-lsp and jupyter-lsp
22

3-
## jupyterlab-lsp
3+
### jupyterlab-lsp
44

55
> At present, `jupyterlab-lsp` is still in very early development, and does not
66
> expose any runtime extension points. The [roadmap](./ROADMAP.md) lists several
77
> potential points of extension, but will require some refactoring to achieve.
88
9-
## jupyter-lsp
9+
### jupyter-lsp
1010

11-
### Language Server Specs
11+
#### Language Server Specs
1212

13-
Language Server Specs can be [configured](./LANGUAGESERVERS.ms) by Jupyter users,
13+
Language Server Specs can be [configured](./LANGUAGESERVERS.md) by Jupyter users,
1414
or distributed by third parties as python or JSON files. Since we'd like to see
1515
as many Language Servers work out of the box as possible, consider
1616
[contributing a spec](../CONTRIBUTING.md#specs), if it works well for you!
1717

18-
### Message Listeners
18+
#### Message Listeners
1919

2020
Message listeners may choose to receive LSP messages immediately after being
2121
received from the client (e.g. `jupyterlab-lsp`) or a language server. All
@@ -30,13 +30,13 @@ delivery of a message, a non-blocking technique like
3030

3131
[add_callback]: https://www.tornadoweb.org/en/stable/ioloop.html#tornado.ioloop.IOLoop.add_callback
3232

33-
#### Add a Listener with `entry_points`
33+
##### Add a Listener with `entry_points`
3434

3535
Listeners can be added via [entry_points][] by a package installed in the same
3636
environment as `notebook`:
3737

3838
```toml
39-
# setup.cfg
39+
## setup.cfg
4040

4141
[options.entry_points]
4242
jupyter_lsp_listener_all_v1 =
@@ -52,12 +52,12 @@ aside from logging in the event of an error on import.
5252

5353
[entry_points]: https://packaging.python.org/specifications/entry-points/
5454

55-
#### Add a Listener with Jupyter Configuration
55+
##### Add a Listener with Jupyter Configuration
5656

5757
Listeners can be added via `traitlets` configuration, e.g.
5858

5959
```yaml
60-
# jupyter_notebook_config.jsons
60+
## jupyter_notebook_config.jsons
6161
{
6262
'LanguageServerManager':
6363
{
@@ -68,7 +68,7 @@ Listeners can be added via `traitlets` configuration, e.g.
6868
}
6969
```
7070

71-
#### Add a listener with the Python API
71+
##### Add a listener with the Python API
7272

7373
`lsp_message_listener` can be used as a decorator, accessed as part of a
7474
`serverextension`.
@@ -90,7 +90,7 @@ def load_jupyter_server_extension(nbapp):
9090

9191
`scope` is one of `client`, `server` or `all`, and is required.
9292

93-
#### Listener options
93+
##### Listener options
9494

9595
Fine-grained controls are available as part of the Python API. Pass these as
9696
named arguments to `lsp_message_listener`.

0 commit comments

Comments
 (0)