Skip to content

Commit c209597

Browse files
committed
Convert build to a Sphinx site
1 parent 97b7425 commit c209597

File tree

10 files changed

+111
-48
lines changed

10 files changed

+111
-48
lines changed

.circleci/config.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ node_modules
2828

2929
# Jupyter Book
3030
_build
31+
32+
# Python files
33+
__pycache__

jupyter-debugger-protocol/jupyter-debugger-protocol.md renamed to 47-jupyter-debugger-protocol/jupyter-debugger-protocol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Jupyter debugger protocol [active]
1+
# Jupyter debugger protocol
22

33
| Item | Value |
44
|------------|------------------------------------------------------------------------------------------------------------------------------|

72-language-server-protocol/language-server-protocol.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ pr-number: 72
66
date-started: 2021-06-27
77
---
88

9-
# Summary
9+
# Jupyter integration with the Language Server Protocol
10+
11+
## Summary
1012

1113
[jupyter(lab)-lsp](https://github.com/krassowski/jupyterlab-lsp) is a project bringing integration
1214
of language-specific IDE features (such as diagnostics, linting, autocompletion, refactoring) to the
@@ -20,7 +22,7 @@ a working implementation, the proposal is not tied to it (beyond a proposal for
2022
repository to a Jupyter-managed GitHub organization) but rather aimed to guide the process of
2123
formalizing and evolving the way of integrating Jupyter with LSP in general.
2224

23-
# Motivation
25+
## Motivation
2426

2527
A common criticism of the Jupyter environment (regardless of the front-end editor) and of the
2628
official Jupyter frontends (in light of recent, experimental support of feature-rich notebook
@@ -38,7 +40,7 @@ VSCode(TM).
3840
Many language servers are community supported and available for free (see the community-maintained
3941
list of [language servers](https://langserver.org/)).
4042

41-
# Guide-level explanation
43+
## Guide-level explanation
4244

4345
Much like
4446
[Jupyter Kernel Messaging](https://jupyter-client.readthedocs.io/en/stable/messaging.html), LSP
@@ -59,14 +61,14 @@ line) and Jupyter Server (for the `1.x`). We will discuss the architecture and e
5961
of maintaining these components at greater length, leveraging a good deal of the user and developer
6062
[documentation](https://jupyterlab-lsp.readthedocs.io/en/latest/?badge=latest).
6163

62-
# Reference-level explanation
64+
## Reference-level explanation
6365

6466
The current implementation of the LSP integration is a barely a proof of concept. We believe that a
6567
different implementation should be developed to take the more comprehensive use cases and diversity
6668
of the Jupyter ecosystem into account; we created detailed proposals for improvement and refactoring
6769
of our code as explained later.
6870

69-
## Dealing with Jupyter notebooks complexity
71+
### Dealing with Jupyter notebooks complexity
7072

7173
The following features need to be considered in the design:
7274

@@ -81,7 +83,7 @@ existing languages:
8183
warn users about unused empty cells, out of order execution markers, etc., as briefly discussed in
8284
[#467](https://github.com/krassowski/jupyterlab-lsp/issues/467))
8385

84-
## Current implementation
86+
### Current implementation
8587

8688
Currently:
8789

@@ -102,7 +104,7 @@ Currently:
102104
specification of the LSP servers (where to look for an executable of the LSP server, for which
103105
languages/kernels given LSP server should be used, what is its display name, etc.)
104106

105-
# Rationale and alternatives
107+
## Rationale and alternatives
106108

107109
A previous (stale) JEP proposed to integrate LSP and to adopt Monaco editor, which would entail
108110
bringing a heavy dependency and large reliance on continuous development of Monaco by Microsoft; it
@@ -119,7 +121,7 @@ driver behind bad coding practices due to the lack of available toolset in the o
119121
Alternative formats to ipynb were proposed and sometimes the only motivation was a better
120122
IDE-features support.
121123

122-
# Prior art
124+
## Prior art
123125

124126
Multiple editors already support the Language Server Protocol, whether directly or via extension
125127
points, including VSCode, Atom, Brackets (Adobe), Spyder, Visual Studio and many more. The list of
@@ -136,7 +138,7 @@ The on-going integration of the [Debug Adapter Protocol][dap] has demonstrated b
136138
benefits, and kernel maintainer costs, of "embracing and extending" existing, non-Jupyter protocols
137139
rather than re-implementing.
138140

139-
# Unresolved questions
141+
## Unresolved questions
140142

141143
The current implementation can be improved by:
142144

@@ -185,7 +187,7 @@ on user and/or developer experience:
185187
- enabling integration with other packages providing completion suggestions
186188
- enabling use of multiple LSP servers for a single document
187189

188-
# Future possibilities
190+
## Future possibilities
189191

190192
- Amending the kernel messaging protocol to ask only for runtime (e.g. keys in a dictionary, columns
191193
in a data frame) and kernel-specific completions (e.g. magics), this is excluding static-analysis

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ encouraged to commence on the topic.
3333
| 0029 | **Accepted** | [Jupyter Enhancement Proposal updates](29-jep-process/jep-process.md) | [#29](https://github.com/jupyter/enhancement-proposals/pull/29) |
3434
| 0042 | **Accepted** | [Voila Incorporation](42-voila-incorporation/voila-incorporation.md) | [#43](https://github.com/jupyter/enhancement-proposals/pull/43) |
3535
| 0044 | **Accepted** | [Xeus Incorporation](44-xeus-incorporation/xeus-incorporation.md) | [#44](https://github.com/jupyter/enhancement-proposals/pull/44) |
36+
| 0047 | **Accepted** | [Jupyter Debugger Protocol](47-jupyter-debugger-protocol/jupyter-debugger-protocol.md) | [#47](https://github.com/jupyter/enhancement-proposals/pull/47) |
3637
| 0062 | **Accepted** | [Cell ID Addition to Notebook Format](62-cell-id/cell-id.md) | [#62](https://github.com/jupyter/enhancement-proposals/pull/62) |
3738
| 0072 | **Accepted** | [Language server protocol (LSP)](72-language-server-protocol/language-server-protocol.md) | [#72](https://github.com/jupyter/enhancement-proposals/pull/72) |
39+
| 0079 | **Submitted** | Build Jupyter Notebook v7 off of JupyterLab components | [#79](https://github.com/jupyter/enhancement-proposals/pull/79) |
3840

3941
## How do I submit a JEP?
4042

@@ -44,3 +46,31 @@ In addition, read
4446
[the JEP proposal template](jupyter-enhancement-proposal-guidelines/JEP-TEMPLATE.md)
4547
for guidance on the questions you should answer before officially submitting
4648
the JEP.
49+
50+
## Build the enhancement proposal docs
51+
52+
The Enhancement Proposal documentation is structured as a [Sphinx documentation site](https://www.sphinx-doc.org/) that uses a them and configuration inspired by [Jupyter Book](https://jupyterbook.org).
53+
54+
To build the documentation locally, use [the `nox` automation and environment management tool](https://nox.thea.codes/).
55+
Follow these steps:
56+
57+
- Install `nox`:
58+
59+
```console
60+
$ pip install nox
61+
```
62+
- Build the docs from the `enhancement-proposals` folder:
63+
64+
```console
65+
$ nox -s docs
66+
```
67+
68+
This will automatically install the environment needed to build the documentation, and then place the output HTML in the `_build/html` folder.
69+
70+
To build the documentation with a live reload server, run:
71+
72+
```console
73+
$ nox -s docs-live
74+
```
75+
76+
To manually install and build the documentation with Sphinx, install the requirements in `requirements.txt` and then run `sphinx-build . _build/html`.

_toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ parts:
99

1010
- caption: Accepted JEPs
1111
chapters:
12+
- file: 72-language-server-protocol/language-server-protocol.md
1213
- file: 62-cell-id/cell-id
14+
- file: 47-jupyter-debugger-protocol/jupyter-debugger-protocol.md
1315
- file: 44-xeus-incorporation/xeus-incorporation
1416
- file: 42-voila-incorporation/voila-incorporation
1517
- file: 29-jep-process/jep-process

conf.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
author = "Project Jupyter"
2+
copyright = "2021"
3+
exclude_patterns = ["_build", ".nox", ".github"]
4+
extensions = [
5+
"myst_parser",
6+
"sphinx_copybutton",
7+
"sphinx_external_toc",
8+
"sphinx.ext.intersphinx",
9+
"sphinx_book_theme",
10+
]
11+
html_baseurl = "https://jupyter.org/enhancement-proposals"
12+
html_favicon = ""
13+
html_logo = ""
14+
html_sourcelink_suffix = ""
15+
html_theme = "sphinx_book_theme"
16+
html_theme_options = {
17+
"search_bar_text": "Search the docs...",
18+
"repository_url": "https://github.com/jupyter/enhancement-proposals",
19+
"repository_branch": "master",
20+
"home_page_in_toc": True,
21+
"use_repository_button": True,
22+
"use_edit_page_button": True,
23+
"use_issues_button": True,
24+
}
25+
html_title = "Jupyter Enhancement Proposals"
26+
27+
myst_enable_extensions = [
28+
"colon_fence",
29+
"linkify",
30+
]
31+
pygments_style = "sphinx"
32+

noxfile.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import nox
2+
3+
nox.options.reuse_existing_virtualenvs = True
4+
5+
build_command = ["-b", "html", ".", "_build/html"]
6+
7+
@nox.session
8+
def docs(session):
9+
session.install("-r", "requirements.txt")
10+
session.run("sphinx-build", *build_command)
11+
12+
@nox.session(name="docs-live")
13+
def docs_live(session):
14+
session.install("-r", "requirements.txt")
15+
session.install("sphinx-autobuild")
16+
17+
AUTOBUILD_IGNORE = [
18+
"_build",
19+
"build_assets",
20+
"tmp",
21+
]
22+
cmd = ["sphinx-autobuild"]
23+
for folder in AUTOBUILD_IGNORE:
24+
cmd.extend(["--ignore", f"*/{folder}/*"])
25+
cmd.extend(build_command)
26+
session.run(*cmd)

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
linkify-it-py
2+
myst-parser
3+
sphinx-book-theme
4+
sphinx-copybutton
5+
sphinx_external_toc

0 commit comments

Comments
 (0)