-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add support for ipynb file #57
Comments
@wangtz — this is an interesting question, because *.ipynb files are actually JSON files, so including a comment-style preamble as we do for other files will not work, because then it would no longer be valid JSON, since JSON disallows anything outside of So how would you expect us to embed a license into it? Do you have any sample *.ipynb files we can take a look at to see what the typical standard is for these files? Maybe the Or maybe since it's JSON, we should follow the Node.js package style for specifying licenses? Though I think including the full license text is, in general, preferred by lawyers, so maybe we could have a What do you think? |
.ipynb file represents a series of Python code blocks. I'm suggesting to add license on top of the first code block so that it's visible to users. I don't think normal users would look into the JSON source code. |
@wangtz — what do you think of this? |
Looks good. Thanks. :-) I see that you added a text block instead of code block for these comments. I'm fine with either. |
@wangtz — I tried adding just a code block with those comments earlier, but it didn't work, but that was probably because I didn't have the right metadata at the end of the file, though. Just changed it to use code and metadata, and now it appears to work. Take another look? |
Eh. I didn't find any related commit. Most recent one is adding .bat support. Do you mean a pull request? |
@wangtz -- it's in a branch on this repository; you can see the preview using the same links as above (I modified a sample file in-place). If you want to see what it looks like in practice, see the |
Ah I see. I had a quick look at your ipynb.py but didn't quite understand the logic. Are you replacing the metadata section when a header is added. I thought the metadata section is provided by the users (e.g. they may not be using PYthon3), and all we need to in this case is to prepend an element in cells.source. What do you think? |
@wangtz — without the metadata section, the notebook didn't load in the tools I tried it in, it just failed, so it wasn't usable. How would a user get to a usable state if the boilerplate we generate (without the metadata section) is insufficient to load into a notebook viewer? I presume the metadata should be modifiable by users after the notebook is loaded. Here's my sample file: Do you want to try it out with your notebook environment, and then delete the metadata section and see if it still loads for you? |
I've merged #66 to add support for Jupyter notebooks. |
IPython notebook is a popular tool for machine learning developer/researcher. Would be great to add support for this.
Thanks,
The text was updated successfully, but these errors were encountered: