-
Notifications
You must be signed in to change notification settings - Fork 22
Jupyter Notebook Previewer #128
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
base: develop
Are you sure you want to change the base?
Conversation
Introduces a new previewer for Jupyter Notebook (.ipynb) files, including HTML, CSS, and JavaScript for rendering notebooks with syntax highlighting, markdown, and math support. Enhances user experience by mimicking native Jupyter styling and supporting multiple programming languages.
Added example curl commands for registering a Jupyter Notebook previewer external tool in both 5.2curlcommands.md and 6.1curlcommands.md. This enables users to preview .ipynb files via an external tool integration.
Introduces the 'jupyterPreviewText' key to English, Spanish, and French i18n files to support Jupyter Notebook preview localization.
Updated multi-line comments in jupyter.css to use correct CSS comment syntax, improving readability and preventing potential parsing issues.
@JR-1991 - Cool!. Not sure I understand what you're asking about signed urls: When using retriever.js, and using writeContentAndData() in your js, both forms are automatically supported. The only change required is to change the configuration json. In general, I think we've been putting the old form in the 5.2 curl commands (prior to signed urls) and using the signed url form in the 6.1+ examples. For signed URLs, using retriever.js, you have to add URLs retriever.js expects - as in dataverse-previewers/6.1curlcommands.md Lines 25 to 44 in a7472ad
dataverse-previewers/previewers/betatest/js/retriever.js Lines 43 to 51 in a7472ad
|
@qqmyers, thanks for clarifying and providing the snippets. I was only looking at the lower part implementing the previous mechanism, but that’s fantastic to know! I’ll add the |
Extended the JupyterPreview tool configuration with an allowedApiCalls array specifying permitted API calls for file retrieval and dataset metadata. Removed toolParameters and updated formatting for clarity.
Jupyter notebooks are widely used in our community, but there hasn’t been a previewer for them yet, aside from a full Binder run. This pull request introduces a Jupyter Notebook previewer to the Dataverse external tools ecosystem, allowing users to view
.ipynb
files directly in the browser with syntax highlighting, markdown support, and mathematical expression rendering. In addition to typical Python, this previewer also utilizes Prism to provide syntax highlighting for Julia and R.Jupyter Notebook Previewer Integration
5.2curlcommands.md
and6.1curlcommands.md
documentation files, detailing its usage and API parameters. [1] [2]Frontend Implementation
previewers/betatest/JupyterPreview.html
, a standalone HTML page that loads required libraries (Prism.js, marked.js, notebookjs, KaTeX, Bootstrap) and custom scripts/styles to render Jupyter notebooks with syntax highlighting, markdown, and math support.previewers/betatest/js/jupyter.js
, which configures notebook rendering, syntax highlighting, and handles the loading and display of notebook content.previewers/betatest/css/jupyter.css
for custom styling of notebook cells, headings, tables, and outputs to mimic the Jupyter Notebook look and feel.Internationalization
jupyterPreviewText
key for multi-language support of the previewer interface. [1] [2] [3]Local tests
I’ve tested this previewer on a locally hosted Dataverse 6.6 container. I’ve been testing older releases in parallel, so the older release is being used here. However, I don’t think this will affect newer versions. I have used the following manifest:
Screenshots
Draft View
Published View
Full View
Code and Viz Example