Add Binder (#2)

* Add Binder

* Build from source on Binder

* Add support for notebook server extensions

* Add notebook shim

* Remove python from deps

* Add templates to MANIFEST

* Binder

* Add matplotlib and numpy to Binder
pull/6294/head
Jeremy Tuloup 5 years ago committed by GitHub
parent d2b902359c
commit deee0bd750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,6 +9,7 @@ include ts*.json
graft jupyterlab-classic/labextension
graft jupyterlab-classic/static
graft jupyterlab-classic/templates
# Javascript files
graft src

@ -1,6 +1,7 @@
# jupyterlab-classic
![Github Actions Status](https://github.com/jtpio/jupyterlab-classic/workflows/Build/badge.svg)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jtpio/jupyterlab-classic/master?urlpath=classic/notebooks/binder/example.ipynb)
The next gen old-school Notebook UI.

@ -0,0 +1,13 @@
name: jupyterlab-classic
channels:
- conda-forge/label/jupyterlab_rc
- conda-forge/label/jupyterlab_server_rc
- conda-forge/label/jupyterlab_widgets_rc
- conda-forge
dependencies:
- ipywidgets=7
- jupyterlab=3
- jupyterlab_widgets=1
- matplotlib
- numpy
- nodejs

@ -0,0 +1,122 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# JupyterLab Classic"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"from ipywidgets import IntSlider\n",
"slider = IntSlider()\n",
"slider"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"slider"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import Latex\n",
"Latex(r\"\"\"\\begin{eqnarray}\n",
"\\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\\n",
"\\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\\n",
"\\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\\n",
"\\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \n",
"\\end{eqnarray}\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"x = np.linspace(0, 10, 100)\n",
"\n",
"plt.plot(x, np.sin(x))\n",
"plt.plot(x, np.cos(x))\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import HTML\n",
"from IPython.display import display\n",
"\n",
"s = \"\"\"<table>\n",
"<tr>\n",
"<th>Header 1</th>\n",
"<th>Header 2</th>\n",
"</tr>\n",
"<tr>\n",
"<td>row 1, cell 1</td>\n",
"<td>row 1, cell 2</td>\n",
"</tr>\n",
"<tr>\n",
"<td>row 2, cell 1</td>\n",
"<td>row 2, cell 2</td>\n",
"</tr>\n",
"</table>\"\"\"\n",
"h = HTML(s)\n",
"display(h)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

@ -0,0 +1,2 @@
jlpm && jlpm run build
python -m pip install -e .

@ -0,0 +1,7 @@
{
"NotebookApp": {
"nbserver_extensions": {
"jupyterlab_classic": true
}
}
}

@ -13,6 +13,7 @@ from jupyterlab.commands import get_app_dir, get_user_settings_dir, get_workspac
from jupyterlab_server import LabServerApp
from jupyterlab_server.config import get_page_config, recursive_update, LabConfig
from jupyterlab_server.handlers import is_url, _camelCase
from nbclassic.shim import NBClassicConfigShimMixin
from tornado import web
from ._version import __version__
@ -81,7 +82,7 @@ class ClassicHandler(ExtensionHandlerJinjaMixin, ExtensionHandlerMixin, JupyterH
)
class ClassicApp(LabServerApp):
class ClassicApp(NBClassicConfigShimMixin, LabServerApp):
name = "classic"
app_name = "JupyterLab Classic"
app_version = version

@ -41,6 +41,11 @@ data_files_spec = [
"jupyter-config/jupyter_server_config.d",
"jupyterlab_classic.json",
),
(
"etc/jupyter/jupyter_notebook_config.d",
"jupyter-config/jupyter_notebook_config.d",
"jupyterlab_classic.json",
),
]
cmdclass = create_cmdclass(

Loading…
Cancel
Save