@@ -82,12 +82,13 @@ def _default_path_info(self):
82
82
83
83
84
84
class ServerProcess (Configurable ):
85
- name = Unicode (help = "Name" ).tag (config = True )
85
+ name = Unicode (help = "Name of the server" ).tag (config = True )
86
+
86
87
command = List (
87
88
Unicode (),
88
- help = """\
89
+ help = """
89
90
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}``
91
92
will be substituted with the port or Unix socket path the process should
92
93
listen on and the base-url of the notebook.
93
94
@@ -102,9 +103,9 @@ class ServerProcess(Configurable):
102
103
environment = Union (
103
104
[Dict (Unicode ()), Callable ()],
104
105
default_value = {},
105
- help = """\
106
+ help = """
106
107
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.
108
109
109
110
Could also be a callable. It should return a dictionary.
110
111
""" ,
@@ -117,7 +118,7 @@ class ServerProcess(Configurable):
117
118
absolute_url = Bool (
118
119
False ,
119
120
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,
121
122
the absolute URL will be sent to the backend instead.
122
123
""" ,
123
124
).tag (config = True )
@@ -160,24 +161,24 @@ class ServerProcess(Configurable):
160
161
161
162
Keys recognized are:
162
163
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.
166
167
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
170
171
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.
173
174
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.
177
178
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".
181
182
""" ,
182
183
).tag (config = True )
183
184
@@ -204,7 +205,7 @@ def _default_launcher_entry(self):
204
205
default_value = {},
205
206
help = """
206
207
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.
208
209
""" ,
209
210
).tag (config = True )
210
211
@@ -218,6 +219,8 @@ def _default_launcher_entry(self):
218
219
``.body``, ``.headers``, ``.code``, or ``.reason`` of the ``response``
219
220
argument. For example:
220
221
222
+ .. code-block::
223
+
221
224
def dog_to_cat(response):
222
225
response.headers["I-Like"] = "tacos"
223
226
response.body = response.body.replace(b'dog', b'cat')
@@ -234,6 +237,8 @@ def dog_to_cat(response):
234
237
A list or tuple of functions can also be specified for chaining multiple
235
238
rewrites. For example:
236
239
240
+ .. code-block::
241
+
237
242
def cats_only(response, path):
238
243
if path.startswith("/cat-club"):
239
244
response.code = 403
0 commit comments