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

ipynb listings #1900

Closed
Kwpolska opened this Issue Jul 20, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@Kwpolska
Member

Kwpolska commented Jul 20, 2015

It would be nice if I could throw an .ipynb file in the listings directory and have it render.

Issues:

  • would anyone ever want to show off the raw (json) file?
  • strange behavior, compared to other formats (including html)

@Kwpolska Kwpolska added this to the v7.6.2 milestone Jul 20, 2015

@ralsina

This comment has been minimized.

Show comment
Hide comment
@ralsina

ralsina Jul 20, 2015

Member

Honestly, it would stinkk of special-casing. We could have a task plugin that took /notebooks and rendered it somewhere in the proper way tho

Member

ralsina commented Jul 20, 2015

Honestly, it would stinkk of special-casing. We could have a task plugin that took /notebooks and rendered it somewhere in the proper way tho

@damianavila

This comment has been minimized.

Show comment
Hide comment
@damianavila

damianavila Jul 20, 2015

Member

It would be nice if I could throw an .ipynb file in the listings directory and have it render.

In fact I think it would be nice to have something like:

listing: foo.ipynb cells[2:5] python

I mean, some way to read the content from cell 2 to 5 and show that but rendered correctly (as nbconverted html snippet...

would anyone ever want to show off the raw (json) file?

Not to much frequently...

strange behavior, compared to other formats (including html)

What do you mean with strange?

Member

damianavila commented Jul 20, 2015

It would be nice if I could throw an .ipynb file in the listings directory and have it render.

In fact I think it would be nice to have something like:

listing: foo.ipynb cells[2:5] python

I mean, some way to read the content from cell 2 to 5 and show that but rendered correctly (as nbconverted html snippet...

would anyone ever want to show off the raw (json) file?

Not to much frequently...

strange behavior, compared to other formats (including html)

What do you mean with strange?

@ralsina

This comment has been minimized.

Show comment
Hide comment
@ralsina

ralsina Jul 20, 2015

Member

@Kwpolska On second thought ... how does that differ from throwing the notebook in stories/ ?

Member

ralsina commented Jul 20, 2015

@Kwpolska On second thought ... how does that differ from throwing the notebook in stories/ ?

@Kwpolska

This comment has been minimized.

Show comment
Hide comment
@Kwpolska

Kwpolska Jul 20, 2015

Member

I would have to take care of directory listings myself, create .py .rst code
block stories out of non-ipynb related files, and it won't display in
listings/.

Member

Kwpolska commented Jul 20, 2015

I would have to take care of directory listings myself, create .py .rst code
block stories out of non-ipynb related files, and it won't display in
listings/.

@ralsina

This comment has been minimized.

Show comment
Hide comment
@ralsina

ralsina Jul 23, 2015

Member

So... currently we just use pygments to highlight stuff in listings. So, to support this usage, we'd need to have a mechanism to support different processors for different extensions. With that, it would not be horribly hard :-)

Member

ralsina commented Jul 23, 2015

So... currently we just use pygments to highlight stuff in listings. So, to support this usage, we'd need to have a mechanism to support different processors for different extensions. With that, it would not be horribly hard :-)

@ralsina ralsina modified the milestones: v7.6.2, 7.6.3, Whenever Jul 29, 2015

@ralsina

This comment has been minimized.

Show comment
Hide comment
@ralsina

ralsina Jul 31, 2015

Member

If anyone can describe how this feature would work, I'm happy to take a shot at it.

One problem is that the listings directive has no way to support this, so it will make things more complicated.

Another is that it should be, if it is to be implemented, a reasonably complete thing that provides support for arbitrary renderers, which means it has huge feature overlap with stories. In fact, it looks like "stories organized by folder hierarchy" which is sort of easy?

Member

ralsina commented Jul 31, 2015

If anyone can describe how this feature would work, I'm happy to take a shot at it.

One problem is that the listings directive has no way to support this, so it will make things more complicated.

Another is that it should be, if it is to be implemented, a reasonably complete thing that provides support for arbitrary renderers, which means it has huge feature overlap with stories. In fact, it looks like "stories organized by folder hierarchy" which is sort of easy?

@Kwpolska

This comment has been minimized.

Show comment
Hide comment
@Kwpolska

Kwpolska Jul 31, 2015

Member

I actually looked into this now and an implementation in the “full” listings is really simple, will have a PR ready in a moment.

As for the directive, would that be useful? If yes, I think it could be implemented with a simple get_code_from_file modification that would return raw HTML nodes from that ipynb plugin.

Implementing “listings = stories with folders” could be problematic. You see, the current idea takes ipynb only, because it’s very unlikely someone would actually want to display the raw JSON files (and if they do, they can just change the extension and also get JSON code highlighting), and displaying notebooks sounds like something a scientist might want to do. But, we could get a web developer who wants to showcase some .html, .md, .rst, and this could be a problem, because we would need some setting/magic to tell raw and rendered modes apart.

Member

Kwpolska commented Jul 31, 2015

I actually looked into this now and an implementation in the “full” listings is really simple, will have a PR ready in a moment.

As for the directive, would that be useful? If yes, I think it could be implemented with a simple get_code_from_file modification that would return raw HTML nodes from that ipynb plugin.

Implementing “listings = stories with folders” could be problematic. You see, the current idea takes ipynb only, because it’s very unlikely someone would actually want to display the raw JSON files (and if they do, they can just change the extension and also get JSON code highlighting), and displaying notebooks sounds like something a scientist might want to do. But, we could get a web developer who wants to showcase some .html, .md, .rst, and this could be a problem, because we would need some setting/magic to tell raw and rendered modes apart.

@Kwpolska Kwpolska self-assigned this Jul 31, 2015

@Kwpolska Kwpolska modified the milestones: 7.6.3, Whenever Jul 31, 2015

@Kwpolska Kwpolska closed this in 2224f68 Jul 31, 2015

Kwpolska added a commit that referenced this issue Jul 31, 2015

Merge pull request #1920 from getnikola/ipynb-listings
Fix #1900 -- render ipynb in listings

Kwpolska added a commit that referenced this issue Jan 8, 2017

Add some documentation about #1900/ipynb listings
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment