-
Notifications
You must be signed in to change notification settings - Fork 387
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
addition of cell id introduced with nbformat>=4.5 to text format #1263
Comments
Hi @itcarroll , thanks for opening this discussion. Sure, we could do something in that direction. Actually, some of the formats have support for a cell title that dates back to the spyder format. It might make sense to map that to the cell id. Right now I think the Pandoc markdown format might have support for cell ids, if you want to give it a try, but I understand that you might be more interested into a Python format. I will have some time to give this a try in two weeks time or later. |
Hi @itcarroll , I have a first draft of this functionality in the attached PR (which contains instructions on how to install the development version). Would you like to give it a try and let me know what you think? The new option is not active by default. If you want to use it, you will have to create a
You can rename the cell ids as you wish, however the new name must match this regular expression: Let me know what you think! |
Thanks for the work on this! I'll definitely give it a try and report back, but it will be sometime next week. |
Perfect! No rush, and thanks for suggesting that in the first place - I'm curious to see if/how we can turn this into something usable! |
This is looking very usable already, although I am encountering an error that only shows up when I've created an .ipynb file from a .py file with
My
My
|
Discussion on #735, after it was closed, pointed to the need for an issue on inclusion of the cell id in jupytext text formats. I can't find one, and I think it's an enhancement worth considering.
Currently, a cell id is preserved in paired notebooks, but there are cases where the paired notebook is not present. Primary among these is when only text formats are held in a git repository. In this case, collaborators that generate notebooks locally from the text format end up with all cells having a different id. I'm interested to know, is there support for directly incorporating the cell id in the "light" format?
The obvious proposal would be to require a start-of-cell delimiter for every cell and include the id. The id is distinct from metadata because 1) it is first and 2) is not a key=value pair (the "=" character is not permitted in a cell id).
The examples would become:
The text was updated successfully, but these errors were encountered: