Skip to content

Commit e72a11a

Browse files
authored
Make LabConfig configurable and add config API docs (#172)
1 parent 8d127b2 commit e72a11a

File tree

3 files changed

+47
-22
lines changed

3 files changed

+47
-22
lines changed

docs/source/api/config.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=========================
2+
JupyterLab Server Config
3+
=========================
4+
5+
Module: :mod:`jupyterlab_server.config`
6+
=======================================
7+
8+
.. automodule:: jupyterlab_server.config
9+
10+
.. currentmodule:: jupyterlab_server.config
11+
12+
.. autofunction:: get_package_url
13+
14+
.. autofunction:: get_federated_extensions
15+
16+
.. autofunction:: get_static_page_config
17+
18+
.. autofunction:: get_page_config
19+
20+
.. autofunction:: write_page_config
21+
22+
:class:`LabConfig`
23+
---------------------
24+
25+
.. autoconfigurable:: LabConfig

docs/source/api/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ JupyterLab Server API Reference:
66

77
.. toctree::
88
app
9-
9+
config

jupyterlab_server/config.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -185,66 +185,66 @@ def write_page_config(page_config, level='all'):
185185
class LabConfig(HasTraits):
186186
"""The lab application configuration object.
187187
"""
188-
app_name = Unicode('', help='The name of the application.')
188+
app_name = Unicode('', help='The name of the application.').tag(config=True)
189189

190-
app_version = Unicode('', help='The version of the application.')
190+
app_version = Unicode('', help='The version of the application.').tag(config=True)
191191

192-
app_namespace = Unicode('', help='The namespace of the application.')
192+
app_namespace = Unicode('', help='The namespace of the application.').tag(config=True)
193193

194-
app_url = Unicode('/lab', help='The url path for the application.')
194+
app_url = Unicode('/lab', help='The url path for the application.').tag(config=True)
195195

196-
app_settings_dir = Unicode('', help='The application settings directory.')
196+
app_settings_dir = Unicode('', help='The application settings directory.').tag(config=True)
197197

198198
extra_labextensions_path = List(Unicode(),
199199
help="""Extra paths to look for federated JupyterLab extensions"""
200-
)
200+
).tag(config=True)
201201

202-
labextensions_path = List(Unicode(), help='The standard paths to look in for federated JupyterLab extensions')
202+
labextensions_path = List(Unicode(), help='The standard paths to look in for federated JupyterLab extensions').tag(config=True)
203203

204-
templates_dir = Unicode('', help='The application templates directory.')
204+
templates_dir = Unicode('', help='The application templates directory.').tag(config=True)
205205

206206
static_dir = Unicode('',
207207
help=('The optional location of local static files. '
208208
'If given, a static file handler will be '
209-
'added.'))
209+
'added.')).tag(config=True)
210210

211211

212-
labextensions_url = Unicode('', help='The url for federated JupyterLab extensions')
212+
labextensions_url = Unicode('', help='The url for federated JupyterLab extensions').tag(config=True)
213213

214-
settings_url = Unicode(help='The url path of the settings handler.')
214+
settings_url = Unicode(help='The url path of the settings handler.').tag(config=True)
215215

216216
user_settings_dir = Unicode('',
217217
help=('The optional location of the user '
218-
'settings directory.'))
218+
'settings directory.')).tag(config=True)
219219

220220
schemas_dir = Unicode('',
221221
help=('The optional location of the settings '
222222
'schemas directory. If given, a handler will '
223-
'be added for settings.'))
223+
'be added for settings.')).tag(config=True)
224224

225-
workspaces_api_url = Unicode(help='The url path of the workspaces API.')
225+
workspaces_api_url = Unicode(help='The url path of the workspaces API.').tag(config=True)
226226

227227
workspaces_dir = Unicode('',
228228
help=('The optional location of the saved '
229229
'workspaces directory. If given, a handler '
230-
'will be added for workspaces.'))
230+
'will be added for workspaces.')).tag(config=True)
231231

232-
listings_url = Unicode(help='The listings url.')
232+
listings_url = Unicode(help='The listings url.').tag(config=True)
233233

234-
themes_url = Unicode(help='The theme url.')
234+
themes_url = Unicode(help='The theme url.').tag(config=True)
235235

236236
themes_dir = Unicode('',
237237
help=('The optional location of the themes '
238238
'directory. If given, a handler will be added '
239-
'for themes.'))
239+
'for themes.')).tag(config=True)
240240

241-
translations_api_url = Unicode(help='The url path of the translations handler.')
241+
translations_api_url = Unicode(help='The url path of the translations handler.').tag(config=True)
242242

243-
tree_url = Unicode(help='The url path of the tree handler.')
243+
tree_url = Unicode(help='The url path of the tree handler.').tag(config=True)
244244

245245
cache_files = Bool(True,
246246
help=('Whether to cache files on the server. '
247-
'This should be `True` except in dev mode.'))
247+
'This should be `True` except in dev mode.')).tag(config=True)
248248

249249
@default('template_dir')
250250
def _default_template_dir(self):

0 commit comments

Comments
 (0)