Skip to content

Commit 1235f2b

Browse files
authored
Use mdformat instead of prettier (#1022)
1 parent 31cdf4d commit 1235f2b

File tree

6 files changed

+146
-132
lines changed

6 files changed

+146
-132
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ repos:
4141
- id: validate-pyproject
4242
stages: [manual]
4343

44-
- repo: https://github.com/pre-commit/mirrors-prettier
45-
rev: v2.7.1
44+
- repo: https://github.com/executablebooks/mdformat
45+
rev: 0.7.16
4646
hooks:
47-
- id: prettier
47+
- id: mdformat
4848

4949
- repo: https://github.com/asottile/pyupgrade
5050
rev: v2.38.2

CHANGELOG.md

Lines changed: 97 additions & 97 deletions
Large diffs are not rendered by default.

COPYING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,7 @@ change to one of the Jupyter repositories.
5656
With this in mind, the following banner should be used in any source code file
5757
to indicate the copyright and license terms:
5858

59-
# Copyright (c) Jupyter Development Team.
60-
# Distributed under the terms of the Modified BSD License.
59+
```
60+
# Copyright (c) Jupyter Development Team.
61+
# Distributed under the terms of the Modified BSD License.
62+
```

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ For more information, read our [documentation here](http://jupyter-server.readth
1212
To install the latest release locally, make sure you have
1313
[pip installed](https://pip.readthedocs.io/en/stable/installing/) and run:
1414

15-
pip install jupyter_server
15+
```
16+
pip install jupyter_server
17+
```
1618

1719
Jupyter Server currently supports Python>=3.6 on Linux, OSX and Windows.
1820

@@ -30,7 +32,9 @@ To see the changes between releases, checkout the [CHANGELOG](https://github.com
3032

3133
Launch with:
3234

33-
jupyter server
35+
```
36+
jupyter server
37+
```
3438

3539
### Testing
3640

examples/authorization/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
This folder contains the following examples:
44

55
1. a "read-only" Jupyter Notebook Server
6-
2. a read/write Server without the ability to execute code on kernels.
7-
3. a "temporary notebook server", i.e. read and execute notebooks but cannot save/write files.
6+
1. a read/write Server without the ability to execute code on kernels.
7+
1. a "temporary notebook server", i.e. read and execute notebooks but cannot save/write files.
88

99
## How does it work?
1010

@@ -45,27 +45,27 @@ In the `jupyter_nbclassic_readonly_config.py`
4545

4646
pip install nbclassic
4747

48-
2. Navigate to the jupyter_authorized_server `examples/` folder.
48+
1. Navigate to the jupyter_authorized_server `examples/` folder.
4949

50-
3. Launch nbclassic and load `jupyter_nbclassic_readonly_config.py`:
50+
1. Launch nbclassic and load `jupyter_nbclassic_readonly_config.py`:
5151

5252
jupyter nbclassic --config=jupyter_nbclassic_readonly_config.py
5353

54-
4. Try creating a notebook, running a notebook in a cell, etc. You should see a `403: Forbidden` error.
54+
1. Try creating a notebook, running a notebook in a cell, etc. You should see a `403: Forbidden` error.
5555

5656
### Read+Write example
5757

5858
1. Install nbclassic using `pip`.
5959

6060
pip install nbclassic
6161

62-
2. Navigate to the jupyter_authorized_server `examples/` folder.
62+
1. Navigate to the jupyter_authorized_server `examples/` folder.
6363

64-
3. Launch nbclassic and load `jupyter_nbclassic_rw_config.py`:
64+
1. Launch nbclassic and load `jupyter_nbclassic_rw_config.py`:
6565

6666
jupyter nbclassic --config=jupyter_nbclassic_rw_config.py
6767

68-
4. Try running a cell in a notebook. You should see a `403: Forbidden` error.
68+
1. Try running a cell in a notebook. You should see a `403: Forbidden` error.
6969

7070
### Temporary notebook server example
7171

@@ -75,10 +75,10 @@ This configuration allows everything except saving files.
7575

7676
pip install nbclassic
7777

78-
2. Navigate to the jupyter_authorized_server `examples/` folder.
78+
1. Navigate to the jupyter_authorized_server `examples/` folder.
7979

80-
3. Launch nbclassic and load `jupyter_temporary_config.py`:
80+
1. Launch nbclassic and load `jupyter_temporary_config.py`:
8181

8282
jupyter nbclassic --config=jupyter_temporary_config.py
8383

84-
4. Edit a notebook, run a cell, etc. Everything works fine. Then try to save your changes... you should see a `403: Forbidden` error.
84+
1. Edit a notebook, run a cell, etc. Everything works fine. Then try to save your changes... you should see a `403: Forbidden` error.

jupyter_server/i18n/README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ if running Ubuntu 14, you should set environment variable `LANGUAGE="xx_XX"`.
2929

3030
**All i18n-related commands are done from the related directory :**
3131

32-
cd notebook/i18n/
32+
```
33+
cd notebook/i18n/
34+
```
3335

3436
### Message extraction
3537

@@ -69,7 +71,9 @@ pybabel compile -D nbui -f -l ${LANG} -i ${LANG}/LC_MESSAGES/nbui.po -o ${LANG}/
6971

7072
_nbjs.po_ needs to be converted to JSON for use within the JavaScript code, with _po2json_, as follows:
7173

72-
po2json -p -F -f jed1.x -d nbjs ${LANG}/LC_MESSAGES/nbjs.po ${LANG}/LC_MESSAGES/nbjs.json
74+
```
75+
po2json -p -F -f jed1.x -d nbjs ${LANG}/LC_MESSAGES/nbjs.po ${LANG}/LC_MESSAGES/nbjs.json
76+
```
7377

7478
When new languages get added, their language codes should be added to _notebook/i18n/nbjs.json_
7579
under the `supported_languages` element.
@@ -111,21 +115,25 @@ to handle these cases properly.
111115

112116
### Known issues and future evolutions
113117

114-
1. Right now there are two different places where the desired language is set. At startup time, the Jupyter console's messages pay attention to the setting of the `${LANG}` environment variable
115-
as set in the shell at startup time. Unfortunately, this is also the time where the Jinja2
116-
environment is set up, which means that the template stuff will always come from this setting.
117-
We really want to be paying attention to the browser's settings for the stuff that happens in the
118-
browser, so we need to be able to retrieve this information after the browser is started and somehow
119-
communicate this back to Jinja2. So far, I haven't yet figured out how to do this, which means that if the ${LANG} at startup doesn't match the browser's settings, you could potentially get a mix
120-
of languages in the UI ( never a good thing ).
121-
122-
2. We will need to decide if console messages should be translatable, and enable them if desired.
123-
3. The keyboard shortcut editor was implemented after the i18n work was completed, so that portion
124-
does not have translation support at this time.
125-
4. Babel's documentation has instructions on how to integrate messages extraction
126-
into your _setup.py_ so that eventually we can just do:
127-
128-
./setup.py extract_messages
118+
1. Right now there are two different places where the desired language is set. At startup time, the Jupyter console's messages pay attention to the setting of the `${LANG}` environment variable
119+
as set in the shell at startup time. Unfortunately, this is also the time where the Jinja2
120+
environment is set up, which means that the template stuff will always come from this setting.
121+
We really want to be paying attention to the browser's settings for the stuff that happens in the
122+
browser, so we need to be able to retrieve this information after the browser is started and somehow
123+
communicate this back to Jinja2. So far, I haven't yet figured out how to do this, which means that if the ${LANG} at startup doesn't match the browser's settings, you could potentially get a mix
124+
of languages in the UI ( never a good thing ).
125+
126+
1. We will need to decide if console messages should be translatable, and enable them if desired.
127+
128+
1. The keyboard shortcut editor was implemented after the i18n work was completed, so that portion
129+
does not have translation support at this time.
130+
131+
1. Babel's documentation has instructions on how to integrate messages extraction
132+
into your _setup.py_ so that eventually we can just do:
133+
134+
```
135+
./setup.py extract_messages
136+
```
129137

130138
I hope to get this working at some point in the near future. 5. The conversions from `.po` to `.mo` probably can and should be done using `setup.py install`.
131139

0 commit comments

Comments
 (0)