Skip to content

Commit 18cf3d0

Browse files
committed
Switch to MyST and MyST-{NB} with book-theme
1 parent 3901053 commit 18cf3d0

16 files changed

+303
-216
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## CHANGELOG
1+
## Changelog
22

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

CONTRIBUTING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Contribute to jupyterlab-lsp and jupyter-lsp :heart:
1+
## Contributing
22

33
`jupyter-lsp` and `jupyterlab-lsp` are [open source][license] software, and
44
all contributions conforming to good sense, good taste, and the
@@ -19,9 +19,11 @@ You can contribute to the project through:
1919
- improving testing
2020
- reviewing pull requests
2121

22+
Thank you for all your contributions :heart:
23+
2224
[license]: https://github.com/krassowski/jupyterlab-lsp/blob/master/LICENSE
23-
[extending]: ./docs/Extending.ipynb
24-
[roadmap]: ./docs/Roadmap.ipynb
25+
[extending]: ./docs/Extending.html
26+
[roadmap]: ./docs/Roadmap.html
2527
[jupyterlab-lsp]: https://github.com/krassowski/jupyterlab-lsp.git
2628
[code-of-conduct]: https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md
2729

@@ -328,7 +330,7 @@ python scripts/lint.py
328330

329331
### Specs
330332

331-
While language servers can be configured by the user using a simple JSON or Python [configuration file](./Configuring.ipynb#language_servers),
333+
While language servers can be configured by the user using a simple JSON or Python [configuration file](./Configuring.html#language-servers),
332334
it is preferable to provide users with an option that does not require manual configuration. The language server specifications (specs)
333335
wrap the configuration (as would be defined by the user) into a Python class or function that can be either:
334336

@@ -357,7 +359,7 @@ A spec is a Python callable (a function, or a class with `__call__` method) that
357359

358360
The above example is only intended as an illustration and not as an up-to-date guide.
359361
For details on the dictionary contents, see the [schema][] definition and [built-in specs][].
360-
Basic concepts (meaning of the `argv` and `languages` arguments) are also explained in the [configuration files](./Configuring.ipynb#language_servers) documentation.
362+
Basic concepts (meaning of the `argv` and `languages` arguments) are also explained in the [configuration files](./Configuring.html#language-servers) documentation.
361363

362364
When contributing a specification we recommend to make use of the helper classes and other [utilities][] that take care of the common use-cases:
363365

docs/Architecture.ipynb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"cell_type": "code",
1212
"execution_count": null,
1313
"metadata": {
14-
"hide_input": true
14+
"tags": [
15+
"remove-cell"
16+
]
1517
},
1618
"outputs": [],
1719
"source": [
@@ -49,7 +51,9 @@
4951
"cell_type": "code",
5052
"execution_count": null,
5153
"metadata": {
52-
"hide_input": true
54+
"tags": [
55+
"remove-input"
56+
]
5357
},
5458
"outputs": [],
5559
"source": [
@@ -76,7 +80,10 @@
7680
"cell_type": "code",
7781
"execution_count": null,
7882
"metadata": {
79-
"hide_input": true
83+
"hide_input": true,
84+
"tags": [
85+
"remove-input"
86+
]
8087
},
8188
"outputs": [],
8289
"source": [

docs/CHANGELOG.ipynb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,13 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"metadata": {},
6-
"source": [
7-
"## Changelog"
8-
]
9-
},
10-
{
11-
"cell_type": "code",
12-
"execution_count": null,
135
"metadata": {
146
"hide_input": true
157
},
16-
"outputs": [],
178
"source": [
18-
"# this re-prints CHANGELOG.md, which is valuable to have in the root of the repo\n",
19-
"\n",
20-
"import pathlib\n",
21-
"\n",
22-
"import IPython\n",
9+
"```{include} ../CHANGELOG.md\n",
2310
"\n",
24-
"contrib = pathlib.Path(\"../CHANGELOG.md\").read_text().split(\"\\n\", 1)[1]\n",
25-
"IPython.display.Markdown(contrib)"
11+
"```"
2612
]
2713
}
2814
],

docs/Configuring.ipynb

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
"#### language_servers\n",
4343
"\n",
4444
"`jupyter-lsp` does not come with any Language Servers! However, we will try to\n",
45-
"use [known language servers](./Language%20Servers.ipynb) if they _are_ installed\n",
45+
"use [known language servers](./Language%20Servers.html) if they _are_ installed\n",
4646
"and we know about them: you can disable this behavior by configuring\n",
4747
"[autodetect](#autodetect).\n",
4848
"\n",
4949
"If you don't see an implementation for the language server you need, continue\n",
5050
"reading!\n",
5151
"\n",
52-
"> Please consider [contributing your language server spec](./Contributing.ipynb)\n",
52+
"> Please consider [contributing your language server spec](./Contributing.html)\n",
5353
"> to `jupyter-lsp`!"
5454
]
5555
},
@@ -68,12 +68,12 @@
6868
" get such an array.\n",
6969
"- the `languages` which the language server will respond to, and\n",
7070
"- the schema `version` of the spec (currently `2`)\n",
71-
"- `mime_types` by which the notebooks and files will be matched to the langauge\n",
71+
"- `mime_types` by which the notebooks and files will be matched to the language\n",
7272
" server:\n",
7373
" - for notebooks the MIME type is derived from `language_info`/`mimetype`\n",
7474
" element of [kernel_info][] response (with fallback on to cell metadata if\n",
7575
" missing from kernel response)\n",
76-
" - for files the implemntation is frontend-specific; in JupyterLab the MIME\n",
76+
" - for files the implementation is frontend-specific; in JupyterLab the MIME\n",
7777
" type is obtained from the MIME type registry.\n",
7878
"\n",
7979
"```python\n",
@@ -157,7 +157,7 @@
157157
"> default: `True`\n",
158158
"\n",
159159
"If `True`, `jupyter-lsp` will look for all\n",
160-
"[known language servers](./Language%20Servers.ipynb). User-configured\n",
160+
"[known language servers](./Language%20Servers.html). User-configured\n",
161161
"`language_servers` of the same implementation will be preferred over\n",
162162
"`autodetect`ed ones."
163163
]
@@ -215,11 +215,36 @@
215215
"`pip`-installable packages in the same environment as the Jupyter server can be\n",
216216
"automatically detected as providing [language_servers](#language_servers). These\n",
217217
"are a little more involved, but also more powerful: see more in\n",
218-
"[Contributing](Contributing.ipynb#Specs). Servers configured this way are loaded\n",
218+
"[Contributing](Contributing.html#Specs). Servers configured this way are loaded\n",
219219
"_before_ those defined in [configuration files](#Configuration-Files), so that a\n",
220220
"user can fine-tune their available servers."
221221
]
222222
},
223+
{
224+
"cell_type": "markdown",
225+
"metadata": {},
226+
"source": [
227+
"### Making Custom Servers Work With Notebooks\n",
228+
"\n",
229+
"To enable integration of language servers with Jupyter notebooks this extensions\n",
230+
"assumes that the `language_info` section of [`kernel_info_reply`][kernel_info]\n",
231+
"is complete and properly returned by the Kernel. In particular the following\n",
232+
"elements are required:\n",
233+
"\n",
234+
"- **File extension**: many language servers only handle files with specific file\n",
235+
" extensions and refuse to operate if not provided with such; the file extension\n",
236+
" of a native script for a given language (this is other than `.ipynb`), derived\n",
237+
" from `file_extension` field of `language_info`, will be added to the name of\n",
238+
" the notebook when communicating with the language server to satisfy the file\n",
239+
" extension check.\n",
240+
"- **MIME type**: matching of notebooks to servers is based on the MIME types\n",
241+
" declared in server specification files and `mimetype` field of\n",
242+
" `language_info`. If kernel fails to provide any MIME type, connecting the\n",
243+
" language server will not be possible; if multiple MIME types are in use, any\n",
244+
" would work well for this extension as long as you also include it in the\n",
245+
" `mime_types` list of language server specification."
246+
]
247+
},
223248
{
224249
"cell_type": "markdown",
225250
"metadata": {},

docs/Contributing.ipynb

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"## Contributing"
8-
]
9-
},
10-
{
11-
"cell_type": "code",
12-
"execution_count": null,
13-
"metadata": {
14-
"hide_input": true
15-
},
16-
"outputs": [],
17-
"source": [
18-
"# this re-prints CONTRIBUTING.md, which is valuable to have in the root of the repo\n",
19-
"\n",
20-
"import pathlib\n",
21-
"import re\n",
22-
"\n",
23-
"import IPython\n",
7+
"```{include} ../CONTRIBUTING.md\n",
248
"\n",
25-
"contrib = pathlib.Path(\"../CONTRIBUTING.md\").read_text().split(\"\\n\", 1)[1]\n",
26-
"contrib = re.sub(r\"^\\[(.*)\\]: \\./docs/(.*)$\", \"[\\\\1]: ./\\\\2\", contrib, flags=re.M)\n",
27-
"IPython.display.Markdown(contrib)"
9+
"```"
2810
]
2911
}
3012
],

docs/Extending.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@
169169
"\n",
170170
"### Language Server Specs\n",
171171
"\n",
172-
"Language Server Specs can be [configured](./Configuring.ipynb) by Jupyter users,\n",
172+
"Language Server Specs can be [configured](./Configuring.html) by Jupyter users,\n",
173173
"or distributed by third parties as python or JSON files. Since we'd like to see\n",
174174
"as many Language Servers work out of the box as possible, consider\n",
175-
"[contributing a spec](./Contributing.ipynb#specs), if it works well for you!"
175+
"[contributing a spec](./Contributing.html#specs), if it works well for you!"
176176
]
177177
},
178178
{

0 commit comments

Comments
 (0)