Skip to content
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

Gist support #5

Open
alexwhittemore opened this issue Aug 27, 2018 · 3 comments
Open

Gist support #5

alexwhittemore opened this issue Aug 27, 2018 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@alexwhittemore
Copy link

I love the work! I notice that, trying to use a Gist (https://gist.github.com/alexwhittemore/fb5913c8146ab441e795a13f9ec8d7ea) rather than a commit in a proper repo, I get no output (the frame renders, but no notebook). Digging into nbconvert.php, it looks like you're parsing the URL methodically to extract info about the repo, user, and so on in order to make sure you're always pulling the latest version of the file. It seems to me like that would architecturally preclude the plugin working for Gists?

Additionally, on that Gist page, I see a pretty handy looking "embed" option. It ends up creating a scrolling iframe, which I don't much love, but it's certainly easy and pretty. I suppose another disadvantage vs nbconvert is that it's not auto-updating.

So perhaps for my use-case (I don't want to serve out of a proper repo), either this embedded gist scheme, or raw HTML manually exported from Jupyter Notebook might be more appropriate solutions?

@ghandic
Copy link
Owner

ghandic commented Jan 23, 2019

Hey, sorry I hadnt gotten back to you as I have been travelling 😄 Nbconvert should autoupdate I believe as it is dynamic and creates the html when the page is loaded. I can look into the gists, PHP isnt one of my primary languages and hence the terrible architecture 😆

@ghandic ghandic added enhancement New feature or request help wanted Extra attention is needed labels Jan 23, 2019
@alexwhittemore
Copy link
Author

Re-reading that, I definitely should have been clearer:

  1. Support for gists would be cool, since that's the easiest and quickest way to get a notebook posted somewhere. I think gist support would require a different URL parsing scheme, although the quick and easy way to do it is just some conditional logic "is this URL a gist? Parse it that way instead!" But in either event, parsing a URL seems like a way to do it that's prone to breaking if github changes the slightest little thing.

  2. Since I want to "embed a gist in my blog," my comment was that gists actually support doing that. I just mean that that strategy is less pretty and good, and doesn't automatically update if I change the gist (like Nbconvert WOULD, if it supported gists).

More just food for thought! Slash I may have a go at putting together a PR myself for gist support, since it seems not TOO hard. But only if I can find time sometime this decade :P

@ghandic
Copy link
Owner

ghandic commented Mar 31, 2019

Hey, literally all that needs to happen is to point any link to nbviewer... So there was no need for me to start breaking up the url anyways! I will fix this when I get around to it. Other than that, pull requests welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants