Skip to content
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
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions clarity/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import jinja2
from jupyter_server.extension.application import ExtensionApp
from .handler import MyExtHandler, MyExtHandler2, ErrorHandler
from .handler import MyExtHandler, PathHandler, ErrorHandler

HERE = os.path.dirname(__file__)

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

Expand Down
4 changes: 2 additions & 2 deletions clarity/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def get(self):
self.write(html)


class MyExtHandler2(ExtensionHandler):
class PathHandler(ExtensionHandler):

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

def get(self, path):
# Pass input text (path) to the html file.
html = self.render_template("page1.html", text=path)
html = self.render_template("path.html", path=path)
self.write(html)

class ErrorHandler(ExtensionHandler):
Expand Down
12,646 changes: 12,636 additions & 10 deletions clarity/static/bundle.js

Large diffs are not rendered by default.

Empty file removed clarity/static/index.d.ts
Empty file.
1 change: 0 additions & 1 deletion clarity/static/index.js

This file was deleted.

8 changes: 1 addition & 7 deletions clarity/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,5 @@
})();
</script>
</head>
<body>
<h1> My server extension home page </h1>
<ul>
<li>You made a server extension</li>
<li>Good job</li>
<li>Add "/page1/" + [your text] to the end of the URL to request a page.</li>
</ul>
<body id="clarity-container">
</body>
19 changes: 0 additions & 19 deletions clarity/templates/page1.html

This file was deleted.

Loading