Skip to content

Commit ec7eb7f

Browse files
committed
🔧 Add blacken-docs
* Fix Python syntax
1 parent 0483c8a commit ec7eb7f

File tree

9 files changed

+62
-36
lines changed

9 files changed

+62
-36
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ repos:
3333
rev: 24.8.0
3434
hooks:
3535
- id: black
36+
- repo: https://github.com/adamchainz/blacken-docs
37+
rev: "1.18.0"
38+
hooks:
39+
- id: blacken-docs
40+
args: [--line-length=79]
41+
additional_dependencies:
42+
- black
3643
- repo: local
3744
hooks:
3845
- id: linkcheck

docs/dashboards/voila/templating.rst

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,38 @@ Then you can create a layout, for example with:
4646

4747
.. code-block:: python
4848
49-
v.Tabs(_metadata={'mount_id': 'content-main'}, children=[
50-
v.Tab(children=['Tab1']),
51-
v.Tab(children=['Tab2']),
52-
v.TabItem(children=[
53-
v.Layout(row=True, wrap=True, align_center=True, children=[
54-
v.Flex(xs12=True, lg6=True, xl4=True, children=[
55-
fig, slider
56-
]),
57-
v.Flex(xs12=True, lg6=True, xl4=True, children=[
58-
figHist2, sliderHist2
59-
]),
60-
v.Flex(xs12=True, xl4=True, children=[
61-
fig2
62-
]),
63-
])
64-
]),
65-
v.TabItem(children=[
66-
v.Container(children=['Lorum ipsum'])
67-
])
68-
])
49+
v.Tabs(
50+
_metadata={"mount_id": "content-main"},
51+
children=[
52+
v.Tab(children=["Tab1"]),
53+
v.Tab(children=["Tab2"]),
54+
v.TabItem(
55+
children=[
56+
v.Layout(
57+
row=True,
58+
wrap=True,
59+
align_center=True,
60+
children=[
61+
v.Flex(
62+
xs12=True,
63+
lg6=True,
64+
xl4=True,
65+
children=[fig, slider],
66+
),
67+
v.Flex(
68+
xs12=True,
69+
lg6=True,
70+
xl4=True,
71+
children=[figHist2, sliderHist2],
72+
),
73+
v.Flex(xs12=True, xl4=True, children=[fig2]),
74+
],
75+
)
76+
]
77+
),
78+
v.TabItem(children=[v.Container(children=["Lorum ipsum"])]),
79+
],
80+
)
6981
7082
You can use :doc:`bqplot_vuetify_example` with:
7183

@@ -124,9 +136,11 @@ kernel:
124136
125137
import os
126138
139+
127140
def kill_kernel(change):
128141
os._exit(0)
129142
143+
130144
button = widgets.Button(description="Kill Kernel")
131145
button.on_click(kill_kernel)
132146
button

docs/hub/config.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ System Service for JupyterHub
3434

3535
.. code-block:: python
3636
37-
c.Spawner.cmd = ['/srv/jupyter/.local/share/virtualenvs/jupyter-tutorial-aFv4x91/bin/jupyterhub-singleuser']
37+
c.Spawner.cmd = [
38+
"/srv/jupyter/.local/share/virtualenvs/jupyter-tutorial-aFv4x91/bin/jupyterhub-singleuser"
39+
]
3840
3941
#. Add a new systemd unit file :file:`/etc/systemd/system/jupyterhub.service`
4042
with the command:
@@ -186,7 +188,7 @@ authentication.
186188

187189
.. code-block:: python
188190
189-
c.JupyterHub.cookie_secret_file = 'jupyterhub_cookie_secret'
191+
c.JupyterHub.cookie_secret_file = "jupyterhub_cookie_secret"
190192
191193
Proxy authentication token
192194
--------------------------
@@ -206,4 +208,6 @@ to be restarted every time unless the proxy is a subprocess of the hub.
206208

207209
.. code-block:: python
208210
209-
c.JupyterHub.proxy_auth_token = '18a0335b7c2e7edeaf7466894a32bea8d1c3cff4b07860298dbe353ecb179fc6'
211+
c.JupyterHub.proxy_auth_token = (
212+
"18a0335b7c2e7edeaf7466894a32bea8d1c3cff4b07860298dbe353ecb179fc6"
213+
)

docs/hub/ipyparallel/config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ when the IPython hub is started, usually in
4545

4646
.. code-block:: python
4747
48-
c.IPClusterEngines.engine_launcher_class = 'MPIEngineSetLauncher'
48+
c.IPClusterEngines.engine_launcher_class = "MPIEngineSetLauncher"
4949
5050
#. The cluster can then be started with:
5151

docs/hub/systemdspawner.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Then you can activate it in :file:`jupyterhub_config.py` with
4949

5050
.. code-block:: python
5151
52-
c.JupyterHub.spawner_class = 'systemdspawner.SystemdSpawner'
52+
c.JupyterHub.spawner_class = "systemdspawner.SystemdSpawner"
5353
5454
There are many other configuration options open to you, for example
5555

docs/nbconvert.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,18 @@ Use on the command line
108108
109109
# # `foo.ipynb`
110110
111+
111112
# In[1]:
112113
def bar():
113114
return "bar"
114115
116+
115117
# In[2]:
116118
def has_ip_syntax():
117119
listing = get_ipython().getoutput("ls")
118120
return listing
119121
122+
120123
# In[3]:
121124
def whatsmyname():
122125
return __name__

docs/nbextensions/list.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Hereinafter I will give a brief overview of some of the notebook extensions.
120120

121121
.. code-block:: python
122122
123-
c.CodeFoldingPreprocessor.remove_folded_code=True = True
123+
c.CodeFoldingPreprocessor.remove_folded_code = True
124124
125125
or on the command line with:
126126

docs/notebook/config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ supplemented with ``append``, ``extend``, ``prepend``, ``add`` and
5252

5353
.. code-block:: python
5454
55-
c.TemplateExporter.template_path.append('./templates')
55+
c.TemplateExporter.template_path.append("./templates")
5656
5757
… with the command line
5858
~~~~~~~~~~~~~~~~~~~~~~~

docs/sphinx/nbsphinx.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ Configure Sphinx
3636

3737
.. code-block:: python
3838
39-
extensions = [
40-
...
41-
"nbsphinx",
42-
]
43-
...
44-
exclude_patterns = [
45-
...
46-
"**/.ipynb_checkpoints",
47-
]
39+
extensions = [
40+
"nbsphinx",
41+
]
42+
43+
exclude_patterns = [
44+
"**/.ipynb_checkpoints",
45+
]
4846
4947
You can find an example in the :download:`/conf.py` file of the Jupyter
5048
tutorial.

0 commit comments

Comments
 (0)