Raw Cells not being rendered when opening a Jupyter Notebook
Cells of type raw are not being rendered when displaying the file
Example:
https://gitlab.com/gitlab-org/incubation-engineering/mlops/glyter/-/blob/poc/notebooks/sample.ipynb
| Actual | Expected |
|---|---|
![]() |
![]() |
on NBViewer: https://nbviewer.org/urls/gitlab.com/gitlab-org/incubation-engineering/mlops/glyter/-/raw/poc/notebooks/sample.ipynb
Implementation guide:
A minimal example:
-
Add a new format type in
https://gitlab.com/gitlab-org/gitlab/-/blob/master/gems/ipynbdiff/lib/ipynb_diff/output_transformer.rb#L22-22for parsingrawoutput_type -
Add a new testcase in https://gitlab.com/gitlab-org/gitlab/-/blob/2d84e7021eeb07e5da23a6e05017ee75da1777d0/gems/ipynbdiff/spec/ipynb_diff/transformer_spec.rb#L17 (testdata for the other tests is under https://gitlab.com/gitlab-org/gitlab/-/tree/2d84e7021eeb07e5da23a6e05017ee75da1777d0/gems/ipynbdiff/spec/testdata for reference):
input.ipynb should be:
{
"cells": [
{
"cell_type": "raw",
"source": [
"---\n",
"image: python:3.9-buster\n",
"execution: 0 -> 1 -> 2"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
}
expected.md should be:
%% Cell type:raw
---
image: python:3.9-buster
execution: 0 -> 1 -> 2

