-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently, the rendering of Jupyter notebook cell outputs is basic and doesn't correctly handle rich formats like HTML, images, or styled text. This leads to a poor representation of the notebook content on the blog.
To fix this, we should use the nbformat library, which is the standard for working with .ipynb files. It allows us to parse the notebook structure and correctly interpret the various output types.
Acceptance Criteria
- Update the notebook rendering logic in
main.py. - Use
nbformat.reads()to parse the notebook content. - Iterate through the notebook cells and their
outputs. - Implement logic to handle different
output_typevalues (display_data,execute_result,stream,error). - Prioritize rendering
text/htmldata if available, falling back totext/plain. - Handle rich media, such as images (e.g.,
image/png), by correctly embedding them in the final HTML. - Add
nbformatto the project dependencies inpyproject.tomland ensure dependencies are synced.
The issue will be considered resolved when cell outputs in the blog posts are rendered with the same fidelity as they appear in a Jupyter environment.
Metadata
Metadata
Assignees
Labels
No labels