Skip to content

Commit 9bb1bbc

Browse files
committed
Remove classic template
1 parent bc7cbfe commit 9bb1bbc

File tree

20 files changed

+81
-244
lines changed

20 files changed

+81
-244
lines changed

.gitignore

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ config.rst
3030
package-lock.json
3131

3232
share/jupyter/voila/templates/base/static/*voila.js
33-
share/jupyter/voila/templates/base/static/*.[woff|woff2|eot|svg]
34-
35-
share/jupyter/voila/templates/classic/static/labvariables.css
36-
share/jupyter/voila/templates/classic/static/materialcolors.css
37-
38-
share/jupyter/voila/templates/reveal/static/labvariables.css
39-
share/jupyter/voila/templates/reveal/static/materialcolors.css
33+
share/jupyter/voila/templates/base/static/*.woff
34+
share/jupyter/voila/templates/base/static/*.woff2
35+
share/jupyter/voila/templates/base/static/*.eot
36+
share/jupyter/voila/templates/base/static/*.svg
37+
share/jupyter/voila/templates/base/static/*.ttf
4038

4139
lib
4240

docs/source/customize.rst

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ Like nbconvert, Voilà supports the **light** and **dark** themes by default, bu
4141
pip install jupyterlab_miami_nights
4242
voila <path-to-notebook> --theme=jupyterlab_miami_nights
4343
44-
.. warning::
45-
Theme are specific to the "lab" template, they will not work for the "classic" template
46-
4744
.. note::
4845
Changing the theme from the notebook metadata may change in the future if this features moves to nbconvert.
4946

@@ -247,7 +244,7 @@ Here is an example of the configuration file. This file needs to be placed in th
247244
"""Do your stuffs here"""
248245
return notebook
249246
250-
c.Voila.prelaunch_hook = hook_function
247+
c.Voila.prelaunch_hook = hook_function
251248
252249
- Start Voila from a python script:
253250

@@ -273,7 +270,7 @@ Here is an example of a custom `prelaunch-hook` to execute a notebook with `pape
273270
from papermill.parameterize import parameterize_notebook
274271
275272
# setup for papermill
276-
#
273+
#
277274
# these two blocks are done
278275
# to avoid triggering errors
279276
# in papermill's notebook
@@ -423,7 +420,7 @@ For more information about these options, check out the `Jupyter Server <https:/
423420
Preheated kernels
424421
==================
425422

426-
Since Voilà needs to start a new jupyter kernel and execute the requested notebook in this kernel for every connection, this would lead to a long waiting time before the widgets can be displayed in the browser.
423+
Since Voilà needs to start a new jupyter kernel and execute the requested notebook in this kernel for every connection, this would lead to a long waiting time before the widgets can be displayed in the browser.
427424
To reduce this waiting time, especially for heavy notebooks, users can activate the preheating kernel option of Voilà.
428425

429426
.. warning::
@@ -451,25 +448,25 @@ will set the variable "FOO" in all preheated kernels.
451448

452449
If the pool size does not match the user's requirements, or some notebooks need to use specific environment variables..., additional settings are needed. The easiest way to change these settings is to provide a file named `voila.json` in the same folder containing the notebooks. Settings for preheating kernel ( list of notebooks does not need preheated kernels, number of kernels in pool, refilling delay, environment variables for starting kernel...) can be set under the `VoilaKernelManager` class name.
453450

454-
Here is an example of settings with explanations for preheating kernel option.
451+
Here is an example of settings with explanations for preheating kernel option.
455452

456453
.. code-block:: python
457454
458455
# voila.json
459456
{
460457
"VoilaConfiguration": {
461458
# Activate or deactivate preheat kernel option.
462-
"preheat_kernel": true
459+
"preheat_kernel": true
463460
},
464461
"VoilaKernelManager": {
465462
# A list of notebook name or regex patterns to exclude notebooks from using preheat kernel.
466463
"preheat_blacklist": [
467464
"notebook-does-not-need-preheat.ipynb",
468465
"^.*foo.*$",
469466
...
470-
],
467+
],
471468
# Configuration for kernel pools
472-
"kernel_pools_config": {
469+
"kernel_pools_config": {
473470
# Setting for `voila.ipynb` notebook
474471
"voila.ipynb": {
475472
"pool_size": 3, # Size of pool
@@ -515,7 +512,7 @@ In normal mode, Voilà users can get the `query string` at run time through the
515512
.. code-block:: python
516513
517514
import os
518-
query_string = os.getenv('QUERY_STRING')
515+
query_string = os.getenv('QUERY_STRING')
519516
520517
In preheating kernel mode, users can prepend with ``wait_for_request`` from ``voila.utils``
521518

@@ -536,9 +533,9 @@ If the Voilà websocket handler is not started with the default protocol (`ws`),
536533
{
537534
...
538535
"VoilaKernelManager": {
539-
"kernel_pools_config": {
536+
"kernel_pools_config": {
540537
"foo.ipynb": {
541-
"kernel_env_variables": {
538+
"kernel_env_variables": {
542539
"VOILA_APP_IP": "192.168.1.1",
543540
"VOILA_APP_PORT": "6789",
544541
"VOILA_WS_PROTOCOL": "wss"
@@ -561,7 +558,7 @@ Hiding output and code cells based on cell tags
561558
Voilà uses `nbconvert <https://github.com/jupyter/nbconvert>`_ under the hood to render the notebooks so we can benefit from some of its advanced functionalities to hide code and output cells based on cell tags.
562559

563560
To hide the cell output for every cell in your notebook that has been tagged (`how to tag <https://jupyter-notebook.readthedocs.io/en/stable/changelog.html#cell-tags>`_) with "hide" in Voilà::
564-
561+
565562
voila --TagRemovePreprocessor.remove_all_outputs_tags='{"hide"}' your_notebook.ipynb
566563

567564
To hide both the code cell and the output cell (if any) for every cell that has been tagged with "hide"::

hatch_build.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/voila/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,15 @@
4040
"@lumino/properties": "^1.5.2",
4141
"@lumino/signaling": "^1.7.2",
4242
"@lumino/virtualdom": "^1.11.2",
43-
"@lumino/widgets": "^1.26.2",
44-
"react": "^17.0.1"
43+
"@lumino/widgets": "^1.26.2"
4544
},
4645
"devDependencies": {
4746
"@babel/core": "^7.2.2",
4847
"@babel/preset-env": "^7.3.1",
4948
"@jupyterlab/builder": "^3.0.0",
5049
"@types/node": "^18.8.3",
5150
"babel-loader": "^8.0.5",
52-
"css-loader": "~5.0.2",
51+
"css-loader": "^6.7.2",
5352
"file-loader": "^6.2.0",
5453
"fs-extra": "^9.1.0",
5554
"glob": "~7.1.6",
@@ -58,7 +57,8 @@
5857
"p-limit": "^2.2.2",
5958
"raw-loader": "^4.0.2",
6059
"rimraf": "^3.0.2",
61-
"style-loader": "^2.0.0",
60+
"sass-loader": "^13.2.0",
61+
"style-loader": "^3.3.1",
6262
"svg-url-loader": "^7.1.1",
6363
"typescript": "~4.1.3",
6464
"url-loader": "^4.1.1",

packages/voila/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
// Inspired by: https://github.com/jupyterlab/jupyterlab/blob/master/dev_mode/index.js
1414

15-
import './style.css';
16-
1715
import { PageConfig, URLExt } from '@jupyterlab/coreutils';
1816

1917
import { VoilaApp } from './app';

packages/voila/style.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/voila/style/index.css

Whitespace-only changes.

packages/voila/webpack.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ fs.ensureDirSync(buildDir);
2727

2828
// Copy files to the build directory
2929
const libDir = path.resolve(__dirname, 'lib');
30-
const style = path.resolve(__dirname, 'style.css');
3130
fs.copySync(libDir, buildDir);
32-
fs.copySync(style, path.resolve(buildDir, 'style.css'));
3331

3432
const extras = Build.ensureAssets({
3533
packageNames: names,
@@ -38,6 +36,7 @@ const extras = Build.ensureAssets({
3836

3937
// Make a bootstrap entrypoint
4038
const entryPoint = path.join(buildDir, 'bootstrap.js');
39+
const styleEntryPoint = path.join(buildDir, 'style.js');
4140

4241
if (process.env.NODE_ENV === 'production') {
4342
baseConfig.mode = 'production';
@@ -58,7 +57,11 @@ const distRoot = path.resolve(
5857
module.exports = [
5958
merge(baseConfig, {
6059
mode: 'development',
61-
entry: ['./publicpath.js', './' + path.relative(__dirname, entryPoint)],
60+
entry: [
61+
'./' + path.relative(__dirname, styleEntryPoint),
62+
'./publicpath.js',
63+
'./' + path.relative(__dirname, entryPoint)
64+
],
6265
output: {
6366
path: distRoot,
6467
library: {

pyproject.toml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ artifacts = [
8383
"share/jupyter/voila/templates"
8484
]
8585

86-
[tool.hatch.build.hooks.custom]
87-
path = "hatch_build.py"
88-
8986
[tool.hatch.build.targets.wheel.shared-data]
9087
"etc/jupyter" = "etc/jupyter"
9188
"voila/labextension" = "share/jupyter/labextensions/@voila-dashboards/jupyterlab-preview"
@@ -105,17 +102,9 @@ dependencies = [
105102
build-function = "hatch_jupyter_builder.npm_builder"
106103
ensured-targets = [
107104
"voila/labextension/static/style.js",
108-
"share/jupyter/voila/templates/classic/static/materialcolors.css",
109-
"share/jupyter/voila/templates/classic/static/labvariables.css",
110-
"share/jupyter/voila/templates/reveal/static/materialcolors.css",
111-
"share/jupyter/voila/templates/reveal/static/labvariables.css",
112105
]
113106
skip-if-exists = [
114107
"voila/labextension/static/style.js",
115-
"share/jupyter/voila/templates/classic/static/materialcolors.css",
116-
"share/jupyter/voila/templates/classic/static/labvariables.css",
117-
"share/jupyter/voila/templates/reveal/static/materialcolors.css",
118-
"share/jupyter/voila/templates/reveal/static/labvariables.css",
119108
]
120109

121110
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]

share/jupyter/voila/templates/classic/index.html.j2

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)