Browse Source

Merge branch 'master' of https://github.com/jupyterlab/jupyterlab

Steven Silvester 6 years ago
parent
commit
b0eefcffb3

+ 11 - 6
docs/source/conf.py

@@ -64,14 +64,19 @@ author = 'Project Jupyter'
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
-#
-# The short X.Y version.
-import json
-with open('../../dev_mode/package.json', 'r') as f:
-    version = json.load(f)['version']
 
+import os
+_version_py = os.path.join('..', '..', 'jupyterlab', '_version.py')
+version_ns = {}
+
+with open(_version_py, mode='r') as version_file:
+    exec(version_file.read(), version_ns)
+
+# The short X.Y version.
+version = '%i.%i' % version_ns['version_info'][:2]
 # The full version, including alpha/beta/rc tags.
-release = version
+release = version_ns['__version__']
+
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

+ 14 - 3
jupyterlab/_version.py

@@ -3,11 +3,22 @@
 
 from collections import namedtuple
 
-VersionInfo = namedtuple('VersionInfo', ['major', 'minor', 'micro', 'releaselevel', 'serial'])
+VersionInfo = namedtuple('VersionInfo', [
+    'major',
+    'minor',
+    'micro',
+    'releaselevel',
+    'serial'
+])
 
 version_info = VersionInfo(0, 35, 0, 'final', 0)
 
 _specifier_ = {'alpha': 'a', 'beta': 'b', 'candidate': 'rc', 'final': ''}
 
-__version__ = '{}.{}.{}{}'.format(version_info.major, version_info.minor, version_info.micro,
-'' if version_info.releaselevel=='final' else _specifier_[version_info.releaselevel]+str(version_info.serial))
+__version__ = '{}.{}.{}{}'.format(
+    version_info.major,
+    version_info.minor,
+    version_info.micro,
+    (''
+     if version_info.releaselevel == 'final'
+     else _specifier_[version_info.releaselevel] + str(version_info.serial)))

+ 5 - 0
jupyterlab/extension.py

@@ -58,6 +58,11 @@ def load_config(nbapp):
     config.user_settings_dir = user_settings_dir
     config.workspaces_dir = workspaces_dir
 
+    if getattr(nbapp, 'override_static_url', ''):
+        config.public_url = nbapp.override_static_url
+    if getattr(nbapp, 'override_theme_url', ''):
+        config.themes_url = nbapp.override_theme_url
+
     if public_url:
         config.public_url = public_url
     else:

+ 4 - 0
jupyterlab/labapp.py

@@ -318,6 +318,10 @@ class LabApp(NotebookApp):
     default_url = Unicode('/lab', config=True,
         help="The default URL to redirect to from `/`")
 
+    override_static_url = Unicode('', help=('The override url for static lab assets, typically a CDN.'))
+
+    override_theme_url = Unicode('', help=('The override url for static lab theme assets, typically a CDN.'))
+
     app_dir = Unicode(get_app_dir(), config=True,
         help="The app directory to launch JupyterLab from.")
 

+ 7 - 1
packages/filebrowser/style/index.css

@@ -40,10 +40,16 @@
 }
 
 .jp-BreadCrumbs-item {
-  margin: 0px 4px;
+  margin: 0px 2px;
+  padding: 0px 2px;
+  border-radius: var(--jp-border-radius);
   cursor: pointer;
 }
 
+.jp-BreadCrumbs-item:hover {
+  background-color: var(--jp-layout-color2);
+}
+
 .jp-BreadCrumbs-item:first-child {
   margin-left: 0px;
 }