diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index b1c953d5ac..0000000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "notebook/static/components" -} \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index c28b820105..2a726f90e2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,8 +3,7 @@ include CONTRIBUTING.rst include README.md include CHANGELOG.md include package.json -include bower.json -include .bowerrc +include bower-lite include pyproject.toml include setup.py include setupbase.py diff --git a/bower-lite b/bower-lite new file mode 100755 index 0000000000..3f8fc9c054 --- /dev/null +++ b/bower-lite @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +""" +bower-lite + +Since Bower's on its way out, +stage frontend dependencies from node_modules into components +""" +import json +import os +import shutil +from os.path import join + +HERE = os.path.abspath(os.path.dirname(__file__)) + + +components = join(HERE, "notebook", "static", "components") +node_modules = join(HERE, "node_modules") + +if os.path.exists(components): + shutil.rmtree(components) +os.mkdir(components) + +with open(join(HERE, "package.json")) as f: + package_json = json.load(f) + +renames = { + "jquery-ui-dist": "jquery-ui", +} + +dependencies = package_json["dependencies"] +for dep in dependencies: + src = join(node_modules, dep) + dest_name = renames.get(dep, dep) + dest = join(components, dest_name) + print(f"{src} -> {dest}") + shutil.copytree(src, dest) diff --git a/bower.json b/bower.json deleted file mode 100644 index 393db02ad1..0000000000 --- a/bower.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "jupyter-notebook-deps", - "version": "0.0.1", - "dependencies": { - "backbone": "components/backbone#~1.2", - "bootstrap": "bootstrap#~3.4", - "bootstrap-tour": "0.9.0", - "codemirror": "components/codemirror#5.56.0+components1", - "create-react-class": "https://cdn.jsdelivr.net/npm/create-react-class@15.6.3/create-react-class.min.js", - "es6-promise": "~1.0", - "font-awesome": "components/font-awesome#~4.7.0", - "jed": "~1.1.1", - "jquery": "components/jquery#~3.5.0", - "jquery-typeahead": "~2.10.6", - "jquery-ui": "components/jqueryui#~1.12", - "marked": "~0.7", - "MathJax": "^2.7.4", - "moment": "~2.19.3", - "react": "~16.0.0", - "requirejs": "~2.2", - "requirejs-text": "~2.0.15", - "requirejs-plugins": "~1.0.3", - "text-encoding": "~0.1", - "underscore": "components/underscore#~1.8.3", - "xterm.js": "https://unpkg.com/xterm@~3.1.0/dist/xterm.js", - "xterm.js-css": "https://unpkg.com/xterm@~3.1.0/dist/xterm.css", - "xterm.js-fit": "https://unpkg.com/xterm@~3.1.0/dist/addons/fit/fit.js" - } -} diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 590e755b86..9892eca4ca 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1353,7 +1353,7 @@ def _default_mathjax_url(self): if not self.enable_mathjax: return u'' static_url_prefix = self.tornado_settings.get("static_url_prefix", "static") - return url_path_join(static_url_prefix, 'components', 'MathJax', 'MathJax.js') + return url_path_join(static_url_prefix, 'components', 'mathjax', 'MathJax.js') @observe('mathjax_url') def _update_mathjax_url(self, change): diff --git a/notebook/templates/notebook.html b/notebook/templates/notebook.html index 4b43d31313..5a0729c9ea 100644 --- a/notebook/templates/notebook.html +++ b/notebook/templates/notebook.html @@ -13,7 +13,6 @@ window.mathjax_url = "{{mathjax_url}}"; - {{super()}} diff --git a/notebook/templates/page.html b/notebook/templates/page.html index 2237319037..791d5950b7 100644 --- a/notebook/templates/page.html +++ b/notebook/templates/page.html @@ -7,7 +7,7 @@ {% block title %}Jupyter Notebook{% endblock %} {% block favicon %}{% endblock %} - + @@ -15,10 +15,10 @@ {% endblock %} - - - - + + + +