Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New approach for JupyterLab 3 #605

Closed
wants to merge 49 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0637903
First stand-alone app
fcollonval Nov 12, 2021
b9151e4
Lab like app
fcollonval Nov 15, 2021
bdb826e
Be sure Reveal layout takes over
fcollonval Nov 15, 2021
ecedeb9
Pass notebook path as part of URL
fcollonval Nov 15, 2021
a152583
Fix loading included files
fcollonval Nov 15, 2021
94069ca
Add widgets test case
fcollonval Nov 15, 2021
06177d7
Reduce mandatory plugin list
fcollonval Nov 15, 2021
d792bc5
Add JupyterLab extension
fcollonval Nov 15, 2021
643638b
Fix webpack shared scope
fcollonval Nov 15, 2021
4361160
Rename classic to nbextension
fcollonval Nov 15, 2021
cd75d28
Restructure the repo as one python pkg
fcollonval Nov 15, 2021
c5a4a45
Remove symlink
fcollonval Nov 15, 2021
ee6dea9
Keep License and Readme as symlink
fcollonval Nov 15, 2021
62e1e6a
Improve binder environment
fcollonval Nov 15, 2021
d9b9cd8
Lint code
fcollonval Nov 15, 2021
646b7e3
Fix python sdist bdist
fcollonval Nov 15, 2021
77d9cde
Pin package to JLab 3.0
fcollonval Nov 15, 2021
42a9d9a
Fix for binder
fcollonval Nov 16, 2021
9bd084b
Add folder structure description
fcollonval Nov 17, 2021
3413608
Correct git pre-commit hook
fcollonval Nov 20, 2021
f564c90
Lint code
fcollonval Nov 20, 2021
4091fec
Upgrade yarn.lock
fcollonval Nov 20, 2021
105449d
- Remove toolbar
fcollonval Nov 20, 2021
5203b1f
Preview side-by-side in JLab
fcollonval Nov 20, 2021
fb8048e
Fix `watch` script
fcollonval Nov 21, 2021
c53a797
Add note about `watch` script and update folder structure
fcollonval Nov 21, 2021
823c24f
develop doc: remove obsolete intro, and reformat
parmentelat Nov 20, 2021
a95f20d
a test notebook
parmentelat Nov 20, 2021
b21f231
an attempt at re-implementing the logic for all 5 slide types
parmentelat Nov 21, 2021
acae3fd
Merge pull request #1 from parmentelat/ft/jlab3
fcollonval Nov 22, 2021
d51d867
Multiple enhancements
fcollonval Nov 26, 2021
7ee2bd1
Chalkboard and notes are working
fcollonval Nov 26, 2021
e46ba5c
Propagate activeCell from JLab to Rise
fcollonval Nov 26, 2021
d18dcd9
Add support for autolaunch
fcollonval Nov 26, 2021
efc3f5c
Fix open in new tab in preview
fcollonval Nov 26, 2021
c35a620
Fix yarn install and building steps, otherwise they failed when you s…
damianavila Nov 28, 2021
73f8937
Update icon
fcollonval Nov 30, 2021
03f6228
Fix fullscreen
fcollonval Nov 30, 2021
c95a034
Remove some ugly styles
fcollonval Nov 30, 2021
fd518eb
Support auto fullscreen
fcollonval Dec 10, 2021
8f5be28
Load colocalized CSS style sheet
fcollonval Dec 10, 2021
301c815
Load collocated `rise.css`
fcollonval Dec 10, 2021
78956a2
add mention to pip install -e . in the dev doc
parmentelat Dec 11, 2021
6845408
tweak dev doc again
parmentelat Dec 13, 2021
c6c2f41
add more samples of all the title levels
parmentelat Dec 13, 2021
e774243
a very rough attempt at fixing font sizes
parmentelat Dec 13, 2021
03071d4
fixing the size of <li> elements (#4)
parmentelat Jun 30, 2022
30554a9
fix speaker notes (#5)
YiqinZhang Aug 5, 2022
023fd81
Fix toggle all RISE buttons on slides (#6)
YiqinZhang Sep 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pass notebook path as part of URL
fcollonval committed Nov 15, 2021

Unverified

This user has not yet uploaded their public signing key.
commit ecedeb9419997305a417b6be60dd88fb7e125237
18 changes: 12 additions & 6 deletions lab/rise/app.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os
from os.path import join as pjoin
from pathlib import Path
from typing import Optional


from jupyter_server.base.handlers import JupyterHandler
from jupyter_server.base.handlers import JupyterHandler, path_regex
from jupyter_server.extension.handler import (
ExtensionHandlerJinjaMixin,
ExtensionHandlerMixin,
@@ -25,7 +27,7 @@
class RiseHandler(
ExtensionHandlerJinjaMixin, ExtensionHandlerMixin, JupyterHandler
):
def get_page_config(self):
def get_page_config(self, notebook_path: Optional[str] = None):
config = LabConfig()
app = self.extensionapp
base_url = self.settings.get("base_url")
@@ -37,7 +39,7 @@ def get_page_config(self):
"token": self.settings["token"],
"fullStaticUrl": ujoin(self.base_url, "static", self.name),
"frontendUrl": ujoin(self.base_url, "rise/"),
'notebookPath': 'test.ipynb',
'notebookPath': notebook_path,
}

mathjax_config = self.settings.get("mathjax_config", "TeX-AMS_HTML-full,Safe")
@@ -75,14 +77,18 @@ def get_page_config(self):
return page_config

@web.authenticated
def get(self):
def get(self, path: str = None):
nb_path = Path(path)
if nb_path.suffix != '.ipynb':
raise web.HTTPError(404, f"Only notebook files can be opened with RISE; got {path}")

return self.write(
self.render_template(
"index.html",
static=self.static_url,
base_url=self.base_url,
token=self.settings["token"],
page_config=self.get_page_config()
page_config=self.get_page_config(path)
)
)

@@ -104,7 +110,7 @@ class RiseApp(LabServerApp):
subcommands = {}

def initialize_handlers(self):
self.handlers.append(("/rise", RiseHandler))
self.handlers.append((f"/rise{path_regex}", RiseHandler))
super().initialize_handlers()

def initialize_templates(self):