Carreau / nbviewer

An Heroku app that allows to view ipynb urls and gists as static html
Other
0 stars 1 forks source link

Added social button into nbviewer #5

Open damianavila opened 11 years ago

damianavila commented 11 years ago

Guys,

In the discussion about etherpad, Brian suggest "It would also be nice to auto-generate bit.lylinks for each notebook for easy posting elsewhere - maybe even a "post this to Twitter" button? " OK, I have added a "floating/unfold" bar at the right bottom of the page to share the url in the most popular social sites (each one with their proper icon) and hundreds more sites if your click into the share (+) button... There are a few lines of code... if you are interesting I can do a PR.

You can test it here: http://testviewer.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb

Cheers.

Damián.

pinging @Carreau @ellisonbg

damianavila commented 11 years ago

I forgot to mention that the floating bar is provided by addthis.com... so if you are interested, we can generate an user pubid, add it to js plugin and have the Analitics about links sharing...

ellisonbg commented 11 years ago

Damian,

Yes! This is really fantastic and will be a nice addition to nbviewer. My only thought is that the URLs for nbviewer get a bit long, is there any way of running the URL through bitly first?

Cheers,

Brian

On Sat, Jan 12, 2013 at 12:57 PM, Damián Avila notifications@github.comwrote:

Guys,

In the discussion about etherpad, Brian suggest "It would also be nice to auto-generate bit.lylinks for each notebook for easy posting elsewhere - maybe even a "post this to Twitter" button? " OK, I have added a "floating/unfold" bar at the right bottom of the page to share the url in the most popular social sites (each one with their proper icon) and hundreds more sites if your click into the share (+) button... There are a few lines of code... if you are interesting I can do a PR.

You can test it here: http://testviewer.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb

Cheers.

Damián.

pinging @Carreau https://github.com/Carreau @ellisonbghttps://github.com/ellisonbg

— Reply to this email directly or view it on GitHubhttps://github.com/Carreau/nbviewer/issues/5.

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

ellisonbg commented 11 years ago

One other thought. It might be nice to have these extra links such as "Share" and "Download" in a single floating div. There will probably be others (such as download slideshow, pdf, etc.). Oh I should mention this, that I think we don't want to create another separate domain for the slide show stuff. It should just be links off the main nbviewer page for each notebook.

Cheers,

Brian

On Sat, Jan 12, 2013 at 9:03 PM, Brian Granger ellisonbg@gmail.com wrote:

Damian,

Yes! This is really fantastic and will be a nice addition to nbviewer. My only thought is that the URLs for nbviewer get a bit long, is there any way of running the URL through bitly first?

Cheers,

Brian

On Sat, Jan 12, 2013 at 12:57 PM, Damián Avila notifications@github.comwrote:

Guys,

In the discussion about etherpad, Brian suggest "It would also be nice to auto-generate bit.lylinks for each notebook for easy posting elsewhere - maybe even a "post this to Twitter" button? " OK, I have added a "floating/unfold" bar at the right bottom of the page to share the url in the most popular social sites (each one with their proper icon) and hundreds more sites if your click into the share (+) button... There are a few lines of code... if you are interesting I can do a PR.

You can test it here: http://testviewer.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb

Cheers.

Damián.

pinging @Carreau https://github.com/Carreau @ellisonbghttps://github.com/ellisonbg

— Reply to this email directly or view it on GitHubhttps://github.com/Carreau/nbviewer/issues/5.

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

ellisonbg commented 11 years ago

http://support.addthis.com/customer/portal/articles/381247-url-shortening#.UPJBpGJQAak

On Sat, Jan 12, 2013 at 9:05 PM, Brian Granger ellisonbg@gmail.com wrote:

One other thought. It might be nice to have these extra links such as "Share" and "Download" in a single floating div. There will probably be others (such as download slideshow, pdf, etc.). Oh I should mention this, that I think we don't want to create another separate domain for the slide show stuff. It should just be links off the main nbviewer page for each notebook.

Cheers,

Brian

On Sat, Jan 12, 2013 at 9:03 PM, Brian Granger ellisonbg@gmail.comwrote:

Damian,

Yes! This is really fantastic and will be a nice addition to nbviewer. My only thought is that the URLs for nbviewer get a bit long, is there any way of running the URL through bitly first?

Cheers,

Brian

On Sat, Jan 12, 2013 at 12:57 PM, Damián Avila notifications@github.comwrote:

Guys,

In the discussion about etherpad, Brian suggest "It would also be nice to auto-generate bit.lylinks for each notebook for easy posting elsewhere - maybe even a "post this to Twitter" button? " OK, I have added a "floating/unfold" bar at the right bottom of the page to share the url in the most popular social sites (each one with their proper icon) and hundreds more sites if your click into the share (+) button... There are a few lines of code... if you are interesting I can do a PR.

You can test it here: http://testviewer.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb

Cheers.

Damián.

pinging @Carreau https://github.com/Carreau @ellisonbghttps://github.com/ellisonbg

— Reply to this email directly or view it on GitHubhttps://github.com/Carreau/nbviewer/issues/5.

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

Carreau commented 11 years ago

Short from my phone.

Please wait for nbconvert template to land before tweeking nbviewer. Adding ui element is painfull and once templare are ready it will be easier to integrate a notebook inside a web page and you would be able to have all the bootstrap navbar etc... The more you add now, the more we will have to port to the future Ui and the more the user will complain that it has changed.

Le 13 janv. 2013 06:10, "Brian E. Granger" notifications@github.com a écrit :

http://support.addthis.com/customer/portal/articles/381247-url-shortening#.UPJBpGJQAak

On Sat, Jan 12, 2013 at 9:05 PM, Brian Granger ellisonbg@gmail.com wrote:

One other thought. It might be nice to have these extra links such as "Share" and "Download" in a single floating div. There will probably be others (such as download slideshow, pdf, etc.). Oh I should mention this, that I think we don't want to create another separate domain for the slide show stuff. It should just be links off the main nbviewer page for each notebook.

Cheers,

Brian

On Sat, Jan 12, 2013 at 9:03 PM, Brian Granger ellisonbg@gmail.comwrote:

Damian,

Yes! This is really fantastic and will be a nice addition to nbviewer. My only thought is that the URLs for nbviewer get a bit long, is there any way of running the URL through bitly first?

Cheers,

Brian

On Sat, Jan 12, 2013 at 12:57 PM, Damián Avila < notifications@github.com>wrote:

Guys,

In the discussion about etherpad, Brian suggest "It would also be nice to auto-generate bit.lylinks for each notebook for easy posting elsewhere - maybe even a "post this to Twitter" button? " OK, I have added a "floating/unfold" bar at the right bottom of the page to share the url in the most popular social sites (each one with their proper icon) and hundreds more sites if your click into the share (+) button... There are a few lines of code... if you are interesting I can do a PR.

You can test it here:

http://testviewer.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb

Cheers.

Damián.

pinging @Carreau https://github.com/Carreau @ellisonbg< https://github.com/ellisonbg>

— Reply to this email directly or view it on GitHub< https://github.com/Carreau/nbviewer/issues/5>.

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

— Reply to this email directly or view it on GitHubhttps://github.com/Carreau/nbviewer/issues/5#issuecomment-12189774.

Carreau commented 11 years ago

My only thought is that the URLs for nbviewer get a bit long, is there any way of running the URL through bitly first?

Please don't most of services already shorten, and than when you click you go to 2 redirection.

An option to get shorten url why not, but otherwise please consider not doing it.

Carreau commented 11 years ago

Oh I should mention this, that I think we don't want to create another separate domain for the slide show stuff. It should just be links off the main nbviewer page for each notebook.

The 2 are not exclusive.

The problem is just if you keep the same domain how do you pass the information that you want slide or not ? Moreover subdomain allow easy load balancing of application that are lighter.

damianavila commented 11 years ago

El 13/01/13 02:10, Brian E. Granger escribió:

http://support.addthis.com/customer/portal/articles/381247-url-shortening#.UPJBpGJQAak

I will look in the url shortening issue... And you are right, it would be great to have a common bar, I have to research if is it possible to add custom button to this bar...

damianavila commented 11 years ago

El 13/01/13 05:49, Bussonnier Matthias escribió:

Short from my phone.

Please wait for nbconvert template to land before tweeking nbviewer. Adding ui element is painfull and once templare are ready it will be easier to integrate a notebook inside a web page and you would be able to have all the bootstrap navbar etc... The more you add now, the more we will have to port to the future Ui and the more the user will complain that it has changed.

The idea was to have a 'quick/temporal' patch to facilitate the share of the links (like as the download notebook)... btw, this few lines of code are self-contained inside a div and easy to port to new UIs. Maybe, you prefer to use another service or navbar when nbconvert templating is done, in this case you are right about the fact of user complaining for changes... and your request seem reasonable.

damianavila commented 11 years ago

El 13/01/13 06:19, Bussonnier Matthias escribió:

Oh I should mention this, that I think we don't want to create
another separate domain for the slide
show stuff. It should just be links off the main nbviewer page for
each notebook.

The 2 are not exclusive.

The problem is just if you keep the same domain how do you pass the information that you want slide or not ? Moreover subdomain allow easy load balancing of application that are lighter.

Here, I am with Matthias... I do not imagine a simple way of using the same domain for plain notebooks and slideshow... maybe 2 buttons... but later you will add more services, such as pdf... etc... So, you will have a lot of button... or maybe a dropdown menu (Convert to...). It can be possible, although I like the idea of Matthias about having multiples domains.

Carreau commented 11 years ago

I will look in the url shortening issue...And you are right, it would be great to have a common bar, I have to research if is it possible to add custom button to this bar..

If notebook are simple template they can be embedded in any webpage easily. so they could be part of a wider website with a boostrap theme. The only problem right now is that is is painfull to get only part of the body of the converterHTML.

Otherwise it is straitforward.

damianavila commented 11 years ago

El 13/01/13 10:14, Bussonnier Matthias escribió:

If notebook are simple template they can be embedded in any webpage easily. so they could be part of a wider website with a boostrap theme. The only problem right now is that is is painfull to get only part of the body of the converterHTML.

Otherwise it is straitforward.

Yes, it will be easy to do a lot of enhancement after refactoring...

BTW, it was straightforward to include the download button inside the current bar... the UI is more pretty and consistent now: http://testviewer.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb

I understand if you do not want to include it, but it was nice to play with it and get it working... he he

Cheers.

ellisonbg commented 11 years ago

The problem with putting slides on a different domain is that slides are not the only format we will want to export from nbviewer:

Having a different domain for each of these simply doesn't make sense. It can't be that difficult to handle these through URLS:

http://nbviewer.ipython.org/urls/http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb [url]?format=slides

or

http://nbviewer.ipython.org/urls/http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb slides/[url]

I really think we want to standard static notebook view (the one currently on nbviewer) to be the starting point for all of the different formats for a notebook.

Cheers,

Brian

On Sun, Jan 13, 2013 at 6:58 AM, Damián Avila notifications@github.comwrote:

El 13/01/13 10:14, Bussonnier Matthias escribió:

If notebook are simple template they can be embedded in any webpage easily. so they could be part of a wider website with a boostrap theme. The only problem right now is that is is painfull to get only part of the body of the converterHTML.

Otherwise it is straitforward.

Yes, it will be easy to do a lot of enhancement after refactoring...

BTW, I was straightforward to include the download button inside the current bar... the UI is more pretty and consistent now:

http://testviewer.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb

I understand if you do not want to include it, but it was nice to play with it and get it working... he he

Cheers.

— Reply to this email directly or view it on GitHubhttps://github.com/Carreau/nbviewer/issues/5#issuecomment-12194622.

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

ellisonbg commented 11 years ago

but it does sounds like we should hold off on implementing the sharing stuff for real until the jinja template stuff is done.

On Sun, Jan 13, 2013 at 10:47 AM, Brian Granger ellisonbg@gmail.com wrote:

The problem with putting slides on a different domain is that slides are not the only format we will want to export from nbviewer:

  • pdf
  • slideshow pdf
  • reveal.js
  • etc.

Having a different domain for each of these simply doesn't make sense. It can't be that difficult to handle these through URLS:

http://nbviewer.ipython.org/urls/http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb [url]?format=slides

or

http://nbviewer.ipython.org/urls/http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb slides/[url]

I really think we want to standard static notebook view (the one currently on nbviewer) to be the starting point for all of the different formats for a notebook.

Cheers,

Brian

On Sun, Jan 13, 2013 at 6:58 AM, Damián Avila notifications@github.comwrote:

El 13/01/13 10:14, Bussonnier Matthias escribió:

If notebook are simple template they can be embedded in any webpage easily. so they could be part of a wider website with a boostrap theme. The only problem right now is that is is painfull to get only part of the body of the converterHTML.

Otherwise it is straitforward.

Yes, it will be easy to do a lot of enhancement after refactoring...

BTW, I was straightforward to include the download button inside the current bar... the UI is more pretty and consistent now:

http://testviewer.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb

I understand if you do not want to include it, but it was nice to play with it and get it working... he he

Cheers.

— Reply to this email directly or view it on GitHubhttps://github.com/Carreau/nbviewer/issues/5#issuecomment-12194622.

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

damianavila commented 11 years ago

This is what I understood from Matthias... do you think otherwise?

"Brian E. Granger" notifications@github.com escribió:

but it does sounds like we should hold off on implementing the sharing stuff for real until the jinja template stuff is done.

Enviado desde mi teléfono con K-9 Mail.

ellisonbg commented 11 years ago

Nope. just affirming what he said on the template stuff.

On Sun, Jan 13, 2013 at 1:29 PM, Damián Avila notifications@github.comwrote:

This is what I understood from Matthias... do you think otherwise?

"Brian E. Granger" notifications@github.com escribió:

but it does sounds like we should hold off on implementing the sharing stuff for real until the jinja template stuff is done.

Enviado desde mi teléfono con K-9 Mail.

— Reply to this email directly or view it on GitHubhttps://github.com/Carreau/nbviewer/issues/5#issuecomment-12200643.

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com

Carreau commented 11 years ago

I really think we want to standard static notebook view (the one currently on nbviewer) to be the starting point for all of the different formats for a notebook.

It does not prevent multiple subdomain. Instead of having a relative link, you just make a full link.

And it is a little more fault tolerant / it allows load balancing.

also [url]?format=slides Is IMHO difficult because you can't differentiate between the query string from the raw url and the query string passed to nbviewer.

Anyway those are detail about spinning off multiple instance of nbviewer and the url scheme.

ellisonbg commented 11 years ago

I agree that putting the format as a query argument in the URL would be difficult. We could put it at the beginning though. I also agree that ultimately using different domains is more or less equivalent from a linking perspective. But if we ever want to include features that require login's multiple domains will be a pain. For now though I am fine with using the subdomains though as I think user accounts are still a ways off for nbviewer.

On Sun, Jan 13, 2013 at 10:59 PM, Bussonnier Matthias < notifications@github.com> wrote:

I really think we want to standard static notebook view (the one currently on nbviewer) to be the starting point for all of the different formats for a notebook.

It does not prevent multiple subdomain. Instead of having a relative link, you just make a full link.

And it is a little more fault tolerant / it allows load balancing.

also [url]?format=slides Is IMHO difficult because you can't differentiate between the query string from the raw url and the query string passed to nbviewer.

Anyway those are detail about spinning off multiple instance of nbviewer and the url scheme.

— Reply to this email directly or view it on GitHubhttps://github.com/Carreau/nbviewer/issues/5#issuecomment-12208376.

Brian E. Granger Cal Poly State University, San Luis Obispo bgranger@calpoly.edu and ellisonbg@gmail.com