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

cannot comment on html view of notebooks #2727

Open
jackalack opened this issue Aug 6, 2017 · 8 comments
Open

cannot comment on html view of notebooks #2727

jackalack opened this issue Aug 6, 2017 · 8 comments

Comments

@jackalack
Copy link

After creating a pull request, it would be great if people could leave comments on the html view of the jupyter notebook. I believe it is the case that you can only leave comments on the raw jupyter notebook, which makes for a confusing user experience.

@mpacer
Copy link
Member

mpacer commented Aug 7, 2017 via email

@dsblank
Copy link
Member

dsblank commented Aug 7, 2017

I have comments on some of mine, being rendered:

https://athena.brynmawr.edu/jupyter/hub/dblank/public/Jupyter%20Help.ipynb

In a markdown cell:

<div id="disqus_thread"></div>
    <script type="text/javascript">
        var disqus_shortname = 'calicoproject'; // required: replace example with your forum shortname
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
    <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

@mpacer
Copy link
Member

mpacer commented Aug 7, 2017

That doesn't quite solve the line-comments version of the problem does it?

Furthermore, you can't easily wrap GitHub in a Discus comment thread or embed arbitrary js in the html that GitHub renders. So, while cool, that doesn't really solve this problem.

What we need is a way to overlay something for annotating text inside html. That's why I figured something like hypothes.is might work.

Unfortunately, the hypothes.is tool doesn't actually work on text in iframes… so it too wouldn't solve the line-comment version of the problem. I think the protocol would be able to handle it, but I'm not 100% sure.

If you want to see the closest I could come to solution based on the capabilities of hypothes.is today: go to jupyter/nbconvert/…/markdown_display_priority with your hypothes.is account active.

@dsblank
Copy link
Member

dsblank commented Aug 7, 2017

Oh, I see... this was about PRs. Sorry for the noise.

@mpacer
Copy link
Member

mpacer commented Aug 7, 2017

No, it's cool! Thank you for sharing — it's a neat idea, just doesn't work in this case.

@takluyver
Copy link
Member

I suspect that inline comments integrated with Github's pull request system may be impossible because of the security considerations. They're displaying notebooks in an iframe so that it can't do anything with your Github login, but posting comments requires access to your login.

Maybe there's some way for the JS outside an iframe to capture events inside the iframe and modify its DOM? I haven't heard of any such thing, and I'm not sure it would be possible without breaking the isolation requirements, but browsers do a lot of amazing things.

@judell
Copy link

judell commented Aug 9, 2017

It is possible to do this:

image

In other words, open the iframe in a new tab and annotate there. Not what you're looking for, I know. It's awkward to open the iframe separately, and annotations made there aren't visible to a reader of the notebook as rendered in GitHub. Just mentioning it for completeness. Interested parties could arrange to be notified of annotations on the inner frame, and follow links to it.

@dave-kielpinski-circleci

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants