Comments (10)
@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 { ... }
top-level object).
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 metadata
section would be a reasonable place to put it, perhaps with the license
key?
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 license
key with SPDX identifier, and license_txt
for the full contents of the license?
What do you think?
from autogen.
.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.
from autogen.
@wangtz — what do you think of this?
from autogen.
Looks good. Thanks. :-)
I see that you added a text block instead of code block for these comments. I'm fine with either.
from autogen.
@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?
from autogen.
Eh. I didn't find any related commit. Most recent one is adding .bat support. Do you mean a pull request?
from autogen.
@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 ipynb-support
in this repo, it's not a PR yet as I'm still iterating on it.
from autogen.
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?
from autogen.
@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:
https://github.com/mbrukman/autogen/blob/ipynb-support/tests/testdata/sample.ipynb
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?
from autogen.
I've merged #66 to add support for Jupyter notebooks.
from autogen.
Related Issues (20)
- Typo in README? HOT 1
- Split header license comment from TODO comment HOT 1
- Provide Vim repo for easier usage
- Rename tool to drop extension
- JavaScript: Conflict with eslinst Google rules HOT 5
- Add support for a config file
- Make top-level comments optional HOT 1
- Add a man page
- Build packages for distributions for easy installation
- "-i" option doesn't adjust Unicode BOM HOT 4
- autogen inserts extra unit test and bootstrap code for python files
- License header checker HOT 1
- Rewrite autogen in Python to support complex new features
- Add support for .bat
- cmdline option -i doesn't preserve permissions HOT 2
- Handle existing run-lines
- Fix Bazel build on macOS
- Naming confusion with GNU AutoGen HOT 2
- BUILD files not recognized when used in conjunction with `find`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autogen.