typescript-notebook icon indicating copy to clipboard operation
typescript-notebook copied to clipboard

Support plain text *.js & *.ts files for opening notebooks

Open DonJayamanne opened this issue 4 years ago • 4 comments

I.e. use plain text files as backing store.

DonJayamanne avatar Sep 07 '21 04:09 DonJayamanne

would this allows us to open those files as a notebook? i.e. similar to how there are some tools to convert .py scripts to .ipynb and back?

RandomFractals avatar Sep 11 '21 17:09 RandomFractals

Yes

DonJayamanne avatar Sep 11 '21 21:09 DonJayamanne

(firstly let me congratulate on the awesome project! glad to see the feature I was planning to ask about was already on the tracker :))

This would definitely be awesome, it's so much easier to store JS files in git etc. So essentially we'd need something like jupytext but for js.

How do you assess the relative complexity of achieving this?

mgielda avatar Feb 09 '22 10:02 mgielda

How do you assess the relative complexity of achieving this?

Not really following your question here. Right now there's no concept of cells in JS files. Basically i'd consider treating any line that starts with // %% as a cell (following from Jupyter) And from there split all of those into separate cells.

Now that we have a way to parse JS files, we would need to create a notebook serializer that would do this translation in both directions. That should be fairly easy.

DonJayamanne avatar Apr 11 '22 19:04 DonJayamanne