-
Notifications
You must be signed in to change notification settings - Fork 16
[UI] Jupyter Notebook export in Frontend #343
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
Conversation
Cells in Jupyter notebook are linear whereas Codepod is hierarchical and 2D. In what order do we map 2D, hierarchical pods and scopes to linear cells? |
If the pods/scopes are connected by "edges", we can order the pods by the flow of edges; otherwise, pods are not ordered. |
Un-ordered is not a good idea as a notebook, in many cases, is designated as executable top-down.
|
Yes, this is what I have in my mind.
Say we have this:
Do you mean that we should put Or we could use markdown sections with different levels of titles to indicate the scope. Jupyter has a ToC section to display the levels. However, when we export rich text nodes to markdown cells, they will mess up with the ToC and levels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Sen! Overall looks great. A couple of minor comments.
ui/src/lib/store/podSlice.tsx
Outdated
return; | ||
} | ||
pod.richContent = richContent; | ||
pod.dirty = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to set pod.dirty=true
here, because pod.richContent
doesn't need to be saved to DB. Also, this doesn't change the behavior, as pod.dirty
is already set to true
in setPodContent
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 1ceac12
nbformat: 4, | ||
nbformat_minor: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest nbformat version seems to be 5.9.0. Should we use that instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the key names we use, I think we (along with CoLab and DeepNote) are already using NBFormat 5.9 despite that the value of #/nbformat
is 4. See here and pay attention to the new key names, that we are using, under "Changed in version nbformat: 4.0"
Sorry, I made a typo. Say we have this :
then pod A.B.1 and pod A.B.2 should be above pod A.1 and pod A.2 in the exported Jupyter notebook. Makes sense? |
Updated in 1ceac12. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks! Merging.
To export the Codepod repo as one Jupyter Notebook
Bug to fix [e5b9d1a]pod.content is not able to split by newline characterAdd support for rich-text cellNote, the export functionality requires the Amazon S3 bucket setup.