Skip to content

Commit 37add76

Browse files
committed
Clean-up ServerProcess doc
1 parent 138343a commit 37add76

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

jupyter_server_proxy/config.py

+26-21
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ def _default_path_info(self):
8282

8383

8484
class ServerProcess(Configurable):
85-
name = Unicode(help="Name").tag(config=True)
85+
name = Unicode(help="Name of the server").tag(config=True)
86+
8687
command = List(
8788
Unicode(),
88-
help="""\
89+
help="""
8990
An optional list of strings that should be the full command to be executed.
90-
The optional template arguments {{port}}, {{unix_socket}} and {{base_url}}
91+
The optional template arguments ``{port}``, ``{unix_socket}`` and ``{base_url}``
9192
will be substituted with the port or Unix socket path the process should
9293
listen on and the base-url of the notebook.
9394
@@ -102,9 +103,9 @@ class ServerProcess(Configurable):
102103
environment = Union(
103104
[Dict(Unicode()), Callable()],
104105
default_value={},
105-
help="""\
106+
help="""
106107
A dictionary of environment variable mappings. As with the command
107-
traitlet, {{port}}, {{unix_socket}} and {{base_url}} will be substituted.
108+
traitlet, ``{port}``, ``{unix_socket}`` and ``{base_url}`` will be substituted.
108109
109110
Could also be a callable. It should return a dictionary.
110111
""",
@@ -117,7 +118,7 @@ class ServerProcess(Configurable):
117118
absolute_url = Bool(
118119
False,
119120
help="""
120-
Proxy requests default to being rewritten to '/'. If this is True,
121+
Proxy requests default to being rewritten to ``/``. If this is True,
121122
the absolute URL will be sent to the backend instead.
122123
""",
123124
).tag(config=True)
@@ -160,24 +161,24 @@ class ServerProcess(Configurable):
160161
161162
Keys recognized are:
162163
163-
enabled
164-
Set to True (default) to make an entry in the launchers. Set to False to have no
165-
explicit entry.
164+
``enabled``
165+
Set to True (default) to make an entry in the launchers. Set to False to have no
166+
explicit entry.
166167
167-
icon_path
168-
Full path to an svg icon that could be used with a launcher. Currently only used by the
169-
JupyterLab launcher
168+
``icon_path``
169+
Full path to an svg icon that could be used with a launcher. Currently only used by the
170+
JupyterLab launcher
170171
171-
title
172-
Title to be used for the launcher entry. Defaults to the name of the server if missing.
172+
``title``
173+
Title to be used for the launcher entry. Defaults to the name of the server if missing.
173174
174-
path_info
175-
The trailing path that is appended to the user's server URL to access the proxied server.
176-
By default it is the name of the server followed by a trailing slash.
175+
``path_info``
176+
The trailing path that is appended to the user's server URL to access the proxied server.
177+
By default it is the name of the server followed by a trailing slash.
177178
178-
category
179-
The category for the launcher item. Currently only used by the JupyterLab launcher.
180-
By default it is "Notebook".
179+
``category``
180+
The category for the launcher item. Currently only used by the JupyterLab launcher.
181+
By default it is "Notebook".
181182
""",
182183
).tag(config=True)
183184

@@ -204,7 +205,7 @@ def _default_launcher_entry(self):
204205
default_value={},
205206
help="""
206207
A dictionary of additional HTTP headers for the proxy request. As with
207-
the command traitlet, {{port}}, {{unix_socket}} and {{base_url}} will be substituted.
208+
the command traitlet, ``{port}``, ``{unix_socket}`` and ``{base_url}`` will be substituted.
208209
""",
209210
).tag(config=True)
210211

@@ -218,6 +219,8 @@ def _default_launcher_entry(self):
218219
``.body``, ``.headers``, ``.code``, or ``.reason`` of the ``response``
219220
argument. For example:
220221
222+
.. code-block::
223+
221224
def dog_to_cat(response):
222225
response.headers["I-Like"] = "tacos"
223226
response.body = response.body.replace(b'dog', b'cat')
@@ -234,6 +237,8 @@ def dog_to_cat(response):
234237
A list or tuple of functions can also be specified for chaining multiple
235238
rewrites. For example:
236239
240+
.. code-block::
241+
237242
def cats_only(response, path):
238243
if path.startswith("/cat-club"):
239244
response.code = 403

0 commit comments

Comments
 (0)