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

Update base handler #16

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM jupyter/scipy-notebook
FROM jupyter/scipy-notebook:latest

USER root

Expand All @@ -16,8 +16,13 @@ RUN mkdir /opt/nbtags && \
chmod +x /usr/local/bin/before-notebook.d/*.sh
USER $NB_UID

RUN jupyter nbextensions_configurator enable --user && \
jupyter nbextension install --py --user nbtags && \
jupyter serverextension enable --py --user nbtags && \
jupyter nbextension enable --py --user nbtags && \
RUN jupyter nbclassic-extension install --py jupyter_nbextensions_configurator --user && \
jupyter nbclassic-extension enable --py jupyter_nbextensions_configurator --user && \
jupyter nbclassic-serverextension enable --py jupyter_nbextensions_configurator --user && \
jupyter nbclassic-extension install --py --user nbtags && \
jupyter nbclassic-serverextension enable --py --user nbtags && \
jupyter nbclassic-extension enable --py --user nbtags && \
jupyter nblineage quick-setup --user

# Make classic notebook the default
ENV DOCKER_STACKS_JUPYTER_CMD=nbclassic
2 changes: 1 addition & 1 deletion nbtags/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (0, 1, 0, 'dev1')
version_info = (0, 2, 0, 'dev1')
__version__ = '.'.join(map(str, version_info))
11 changes: 5 additions & 6 deletions nbtags/handler.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from notebook.base.handlers import IPythonHandler
from jupyter_server.base.handlers import APIHandler, JupyterHandler
from tornado import web
import json
import itertools
import re
from nbtags.scrapbox import ScrapboxAPI


class TagsHandler(IPythonHandler):
class TagsHandler(APIHandler):
def initialize(self, nb_app):
self.nb_app = nb_app

Expand Down Expand Up @@ -96,7 +95,7 @@ def _has_code(self, text):
return text.startswith('code:cell.') or text.strip() == 'code:toc.md'


class CellCreateURLHandler(IPythonHandler):
class CellCreateURLHandler(JupyterHandler):
def initialize(self, nb_app):
self.nb_app = nb_app

Expand Down Expand Up @@ -134,7 +133,7 @@ def _get_content(self, cell):
return ''


class NotebookCreateURLHandler(IPythonHandler):
class NotebookCreateURLHandler(JupyterHandler):
def initialize(self, nb_app):
self.nb_app = nb_app

Expand All @@ -159,7 +158,7 @@ def _get_content(self, toc):
return 'code:toc.md\n' + '\n'.join([' ' + l for l in toc])


class NotebookMemeHandler(IPythonHandler):
class NotebookMemeHandler(APIHandler):
def initialize(self, nb_app):
self.nb_app = nb_app

Expand Down
3 changes: 2 additions & 1 deletion nbtags/nbextension/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Description: "Sticky Note for Jupyter Notebook"
Link: README.md
Icon: main.png
Main: main.js
Compatibility: 5.x 6.x
# 1.x means nbclassic - leave 6.x in place just in case.
Compatibility: 1.x 6.x
3 changes: 2 additions & 1 deletion nbtags/nbextension/tree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Description: "Sticky Note for Jupyter Notebook"
Link: README.md
Icon: tree.png
Main: tree.js
Compatibility: 5.x 6.x
# 1.x means nbclassic - leave 6.x in place just in case.
Compatibility: 1.x 6.x
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
notebook>=5.0.0
notebook>=6.5.4
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package_data={'nbtags': ['nbextension/*']},
include_package_data=True,
platforms=['Jupyter Notebook 5.x', 'Jupyter Notebook 6.x'],
install_requires=['notebook>=5.0.0'])
install_requires=['notebook>=6.5.4'])

if __name__ == '__main__':
setup(**setup_args)