@@ -77,12 +77,13 @@ def _default_path_info(self):
77
77
78
78
79
79
class ServerProcess (Configurable ):
80
- name = Unicode (help = "Name" ).tag (config = True )
80
+ name = Unicode (help = "Name of the server" ).tag (config = True )
81
+
81
82
command = List (
82
83
Unicode (),
83
- help = """\
84
+ help = """
84
85
An optional list of strings that should be the full command to be executed.
85
- The optional template arguments {{ port}}, {{ unix_socket}} and {{ base_url}}
86
+ The optional template arguments ``{ port}``, ``{ unix_socket}`` and ``{ base_url}``
86
87
will be substituted with the port or Unix socket path the process should
87
88
listen on and the base-url of the notebook.
88
89
@@ -97,9 +98,9 @@ class ServerProcess(Configurable):
97
98
environment = Union (
98
99
[Dict (Unicode ()), Callable ()],
99
100
default_value = {},
100
- help = """\
101
+ help = """
101
102
A dictionary of environment variable mappings. As with the command
102
- traitlet, {{ port}}, {{ unix_socket}} and {{ base_url}} will be substituted.
103
+ traitlet, ``{ port}``, ``{ unix_socket}`` and ``{ base_url}`` will be substituted.
103
104
104
105
Could also be a callable. It should return a dictionary.
105
106
""" ,
@@ -112,7 +113,7 @@ class ServerProcess(Configurable):
112
113
absolute_url = Bool (
113
114
False ,
114
115
help = """
115
- Proxy requests default to being rewritten to '/' . If this is True,
116
+ Proxy requests default to being rewritten to ``/`` . If this is True,
116
117
the absolute URL will be sent to the backend instead.
117
118
""" ,
118
119
).tag (config = True )
@@ -155,24 +156,24 @@ class ServerProcess(Configurable):
155
156
156
157
Keys recognized are:
157
158
158
- enabled
159
- Set to True (default) to make an entry in the launchers. Set to False to have no
160
- explicit entry.
159
+ `` enabled``
160
+ Set to True (default) to make an entry in the launchers. Set to False to have no
161
+ explicit entry.
161
162
162
- icon_path
163
- Full path to an svg icon that could be used with a launcher. Currently only used by the
164
- JupyterLab launcher
163
+ `` icon_path``
164
+ Full path to an svg icon that could be used with a launcher. Currently only used by the
165
+ JupyterLab launcher
165
166
166
- title
167
- Title to be used for the launcher entry. Defaults to the name of the server if missing.
167
+ `` title``
168
+ Title to be used for the launcher entry. Defaults to the name of the server if missing.
168
169
169
- path_info
170
- The trailing path that is appended to the user's server URL to access the proxied server.
171
- By default it is the name of the server followed by a trailing slash.
170
+ `` path_info``
171
+ The trailing path that is appended to the user's server URL to access the proxied server.
172
+ By default it is the name of the server followed by a trailing slash.
172
173
173
- category
174
- The category for the launcher item. Currently only used by the JupyterLab launcher.
175
- By default it is "Notebook".
174
+ `` category``
175
+ The category for the launcher item. Currently only used by the JupyterLab launcher.
176
+ By default it is "Notebook".
176
177
""" ,
177
178
).tag (config = True )
178
179
@@ -199,7 +200,7 @@ def _default_launcher_entry(self):
199
200
default_value = {},
200
201
help = """
201
202
A dictionary of additional HTTP headers for the proxy request. As with
202
- the command traitlet, {{ port}}, {{ unix_socket}} and {{ base_url}} will be substituted.
203
+ the command traitlet, ``{ port}``, ``{ unix_socket}`` and ``{ base_url}`` will be substituted.
203
204
""" ,
204
205
).tag (config = True )
205
206
@@ -213,6 +214,8 @@ def _default_launcher_entry(self):
213
214
``.body``, ``.headers``, ``.code``, or ``.reason`` of the ``response``
214
215
argument. For example:
215
216
217
+ .. code-block::
218
+
216
219
def dog_to_cat(response):
217
220
response.headers["I-Like"] = "tacos"
218
221
response.body = response.body.replace(b'dog', b'cat')
@@ -229,6 +232,8 @@ def dog_to_cat(response):
229
232
A list or tuple of functions can also be specified for chaining multiple
230
233
rewrites. For example:
231
234
235
+ .. code-block::
236
+
232
237
def cats_only(response, path):
233
238
if path.startswith("/cat-club"):
234
239
response.code = 403
0 commit comments