Skip to content

Commit d9e3552

Browse files
Merge pull request #6 from markellekelly/nbextension
Functional notebook on server extension
2 parents 6a96d91 + dddff02 commit d9e3552

File tree

15 files changed

+15651
-762
lines changed

15 files changed

+15651
-762
lines changed

.DS_Store

0 Bytes
Binary file not shown.

clarity/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import jinja2
33
from jupyter_server.extension.application import ExtensionApp
4-
from .handler import MyExtHandler, MyExtHandler2, ErrorHandler
4+
from .handler import MyExtHandler, PathHandler, ErrorHandler
55

66
HERE = os.path.dirname(__file__)
77

@@ -27,7 +27,7 @@ def initialize_handlers(self):
2727
# Add a group with () to send to handler.
2828
self.handlers.extend([
2929
(r'/clarity/?', MyExtHandler),
30-
(r'/clarity/page1/(.*)', MyExtHandler2),
30+
(r'/clarity/path/(.*)', PathHandler),
3131
(r'/clarity/(.*)', ErrorHandler)
3232
])
3333

clarity/handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ def get(self):
1111
self.write(html)
1212

1313

14-
class MyExtHandler2(ExtensionHandler):
14+
class PathHandler(ExtensionHandler):
1515

1616
def get_template(self,name):
1717
return self.settings['clarity_jinja2_env'].get_template(name)
1818

1919
def get(self, path):
2020
# Pass input text (path) to the html file.
21-
html = self.render_template("page1.html", text=path)
21+
html = self.render_template("path.html", path=path)
2222
self.write(html)
2323

2424
class ErrorHandler(ExtensionHandler):

clarity/static/bundle.js

Lines changed: 12636 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clarity/static/index.d.ts

Whitespace-only changes.

clarity/static/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

clarity/templates/index.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,5 @@
1414
})();
1515
</script>
1616
</head>
17-
<body>
18-
<h1> My server extension home page </h1>
19-
<ul>
20-
<li>You made a server extension</li>
21-
<li>Good job</li>
22-
<li>Add "/page1/" + [your text] to the end of the URL to request a page.</li>
23-
</ul>
17+
<body id="clarity-container">
2418
</body>

clarity/templates/page1.html

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

0 commit comments

Comments
 (0)