[IPython-dev] Including javascript from a static library
TARUN GABA
tarun.gaba7 at gmail.com
Tue Jun 4 15:04:45 EDT 2013
Thanks, it works like a charm,
But just after I call my three.js library, in the next line I am trying to
display my javascript which uses functions from the library, but I get a
not defined javascript error.
Am I missing something here?
Javascript(""" var a = new THREE.geometry();""")
// error: THREE is not defined
On Jun 4, 2013 11:59 PM, <ipython-dev-request at scipy.org> wrote:
> Send IPython-dev mailing list submissions to
> ipython-dev at scipy.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mail.scipy.org/mailman/listinfo/ipython-dev
> or, via email, send a message with subject or body 'help' to
> ipython-dev-request at scipy.org
>
> You can reach the person managing the list at
> ipython-dev-owner at scipy.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of IPython-dev digest..."
>
>
> Today's Topics:
>
> 1. Re: A good CSS snippet for better talk-style notebooks?
> (Aron Ahmadia)
> 2. Re: A good CSS snippet for better talk-style notebooks?
> (Fernando Perez)
> 3. Including javascript from static library (TARUN GABA)
> 4. Re: Including javascript from static library (Satrajit Ghosh)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 4 Jun 2013 13:08:25 -0400
> From: Aron Ahmadia <aron at ahmadia.net>
> Subject: Re: [IPython-dev] A good CSS snippet for better talk-style
> notebooks?
> To: IPython developers list <ipython-dev at scipy.org>
> Message-ID:
> <
> CAPhiW4hXjJ2Xdz0XJD4ovf3kPhmvCHRWLiOF2-+531sDWa4_Ww at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I posted my slideshow profile to here:
> https://plus.google.com/105827017409315158569/posts/ErYVSBu6DEz
>
> A
>
>
> On Tue, Jun 4, 2013 at 12:30 PM, Matthias BUSSONNIER <
> bussonniermatthias at gmail.com> wrote:
>
> >
> > Le 4 juin 2013 ? 18:18, Abraham D. Flaxman a ?crit :
> >
> > I've got something similar to this that just got me through my slides for
> > spring quarter. It is "presentation" in this gist:
> > https://gist.github.com/aflaxman/5707238. This is based on some ideas
> > from the Slender Means blog:
> >
> http://healthyalgorithms.com/2013/02/01/better-typography-for-ipython-notebooks-now/
> >
> >
> > May I suggest "how to write an IPython notebook css selector" that I
> > wrote ?
> >
> >
> >
> http://nbviewer.ipython.org/urls/raw.github.com/Carreau/posts/master/02-css-selector.ipynb
> >
> > It avoid relying on displaying css through python.
> > --
> > Matthias
> >
> >
> >
> > The pres2 method in the gist renders Fernando's css below.
> >
> > --Abie
> >
> >
> > -----Original Message-----
> > From: ipython-dev-bounces at scipy.org [mailto:
> ipython-dev-bounces at scipy.org]
> > On Behalf Of Fernando Perez
> > Sent: Tuesday, June 04, 2013 1:22 AM
> > To: IPython developers list
> > Subject: Re: [IPython-dev] A good CSS snippet for better talk-style
> > notebooks?
> >
> > Thanks, that got me on track.
> >
> > For the record, this is what I used:
> >
> > <style>.rendered_html {
> > font-size: 150%;
> > line-height: 1.3;
> > }</style>
> >
> > <style>.rendered_html li {
> > line-height: 2;
> > }</style>
> >
> > <style>.rendered_html h1{
> > margin: 0.5em 0;
> > line-height: 1.3;
> > }</style>
> >
> > <style>.rendered_html h2{
> > margin: 0.15em 0;
> > line-height: 1.2;
> > }</style>
> >
> > <style>.input_prompt {
> > font-size: 120%;
> > font-family: Consolas;
> > }</style>
> >
> > <style>.CodeMirror-lines {
> > font-size: 120%;
> > font-family: Consolas;
> > }</style>
> >
> > <style>.output_area {
> > font-size: 120%;
> > font-family: Consolas;
> > }</style>
> >
> > I actually think we should in general change some of the vertical spacing
> > of our headings even for the defaults, as it's in general too big. But
> > these changes gave me reasonable layout at 1024x768 projector-ese for
> > headings, text and bullet lists, as well as good font sizes for code.
> >
> > Cheers,
> >
> > f
> >
> > On Mon, Jun 3, 2013 at 6:23 PM, klo uo <klonuo at gmail.com> wrote:
> >
> > Fernando, I'm not sure if this would help, but a year ago I posted
> >
> > about tweaking Notebook css:
> >
> > http://mail.scipy.org/pipermail/ipython-user/2012-July/010533.html and
> >
> > it's even included in wiki:
> >
> > https://github.com/ipython/ipython/wiki/Cookbook:-Styling-Notebook
> >
> >
> > Don't know if it works with current theme, and if it does you can use
> >
> > Theme Roller editor to customize the style.
> >
> >
> > However, I know you guys are busy and Notebook is complex, but perhaps
> >
> > you could make default IPython Notebook CSS more accessible. As it is
> >
> > now (if it is as I saw it last year) don't mind me saying that it's
> >
> > just terrible place hardly anyone would like to tweak
> >
> >
> > On Tue, Jun 4, 2013 at 2:45 AM, Fernando Perez <fperez.net at gmail.com>
> > wrote:
> >
> > Hi folks,
> >
> >
> > I've already given a bunch of talks with the notebook, but always
> >
> > using just the defaults and at most zooming in for readability.
> >
> >
> > Does any of you have a little snippet of CSS you like that styles a
> >
> > notebook a little better for a presentation (fonts, sizes, maybe even
> >
> > color, etc). If you have a favorte, send it my way!
> >
> >
> > Thanks in advance!
> >
> >
> >
> > f
> >
> >
> > --
> >
> > Fernando Perez (@fperez_org; http://fperez.org)
> >
> > fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> >
> > fernando.perez-at-berkeley: contact me here for any direct mail
> >
> > _______________________________________________
> >
> > IPython-dev mailing list
> >
> > IPython-dev at scipy.org
> >
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> > _______________________________________________
> >
> > IPython-dev mailing list
> >
> > IPython-dev at scipy.org
> >
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> >
> >
> >
> > --
> > Fernando Perez (@fperez_org; http://fperez.org)
> > fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> > fernando.perez-at-berkeley: contact me here for any direct mail
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> >
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.scipy.org/pipermail/ipython-dev/attachments/20130604/b3b67327/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Tue, 4 Jun 2013 10:43:55 -0700
> From: Fernando Perez <fperez.net at gmail.com>
> Subject: Re: [IPython-dev] A good CSS snippet for better talk-style
> notebooks?
> To: IPython developers list <ipython-dev at scipy.org>
> Message-ID:
> <
> CAHAreOrZVLu-9XoF-Mrgaeg3gUyv0ywQeP+eYmTV_cSXhHbB5A at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Do you have a version updated to work with the new layout of the
> js/css as Matthias updated his? I can't seem to get the slideshow
> button to load with yours so I can play with your nicer CSS :)
>
> On Tue, Jun 4, 2013 at 10:08 AM, Aron Ahmadia <aron at ahmadia.net> wrote:
> > I posted my slideshow profile to here:
> > https://plus.google.com/105827017409315158569/posts/ErYVSBu6DEz
> >
> > A
> >
> >
> > On Tue, Jun 4, 2013 at 12:30 PM, Matthias BUSSONNIER
> > <bussonniermatthias at gmail.com> wrote:
> >>
> >>
> >> Le 4 juin 2013 ? 18:18, Abraham D. Flaxman a ?crit :
> >>
> >> I've got something similar to this that just got me through my slides
> for
> >> spring quarter. It is "presentation" in this gist:
> >> https://gist.github.com/aflaxman/5707238. This is based on some ideas
> from
> >> the Slender Means blog:
> >>
> http://healthyalgorithms.com/2013/02/01/better-typography-for-ipython-notebooks-now/
> >>
> >>
> >> May I suggest "how to write an IPython notebook css selector" that I
> >> wrote ?
> >>
> >>
> >>
> http://nbviewer.ipython.org/urls/raw.github.com/Carreau/posts/master/02-css-selector.ipynb
> >>
> >> It avoid relying on displaying css through python.
> >> --
> >> Matthias
> >>
> >>
> >>
> >> The pres2 method in the gist renders Fernando's css below.
> >>
> >> --Abie
> >>
> >>
> >> -----Original Message-----
> >> From: ipython-dev-bounces at scipy.org [mailto:
> ipython-dev-bounces at scipy.org]
> >> On Behalf Of Fernando Perez
> >> Sent: Tuesday, June 04, 2013 1:22 AM
> >> To: IPython developers list
> >> Subject: Re: [IPython-dev] A good CSS snippet for better talk-style
> >> notebooks?
> >>
> >> Thanks, that got me on track.
> >>
> >> For the record, this is what I used:
> >>
> >> <style>.rendered_html {
> >> font-size: 150%;
> >> line-height: 1.3;
> >> }</style>
> >>
> >> <style>.rendered_html li {
> >> line-height: 2;
> >> }</style>
> >>
> >> <style>.rendered_html h1{
> >> margin: 0.5em 0;
> >> line-height: 1.3;
> >> }</style>
> >>
> >> <style>.rendered_html h2{
> >> margin: 0.15em 0;
> >> line-height: 1.2;
> >> }</style>
> >>
> >> <style>.input_prompt {
> >> font-size: 120%;
> >> font-family: Consolas;
> >> }</style>
> >>
> >> <style>.CodeMirror-lines {
> >> font-size: 120%;
> >> font-family: Consolas;
> >> }</style>
> >>
> >> <style>.output_area {
> >> font-size: 120%;
> >> font-family: Consolas;
> >> }</style>
> >>
> >> I actually think we should in general change some of the vertical
> spacing
> >> of our headings even for the defaults, as it's in general too big. But
> these
> >> changes gave me reasonable layout at 1024x768 projector-ese for
> headings,
> >> text and bullet lists, as well as good font sizes for code.
> >>
> >> Cheers,
> >>
> >> f
> >>
> >> On Mon, Jun 3, 2013 at 6:23 PM, klo uo <klonuo at gmail.com> wrote:
> >>
> >> Fernando, I'm not sure if this would help, but a year ago I posted
> >>
> >> about tweaking Notebook css:
> >>
> >> http://mail.scipy.org/pipermail/ipython-user/2012-July/010533.html and
> >>
> >> it's even included in wiki:
> >>
> >> https://github.com/ipython/ipython/wiki/Cookbook:-Styling-Notebook
> >>
> >>
> >> Don't know if it works with current theme, and if it does you can use
> >>
> >> Theme Roller editor to customize the style.
> >>
> >>
> >> However, I know you guys are busy and Notebook is complex, but perhaps
> >>
> >> you could make default IPython Notebook CSS more accessible. As it is
> >>
> >> now (if it is as I saw it last year) don't mind me saying that it's
> >>
> >> just terrible place hardly anyone would like to tweak
> >>
> >>
> >> On Tue, Jun 4, 2013 at 2:45 AM, Fernando Perez <fperez.net at gmail.com>
> >> wrote:
> >>
> >> Hi folks,
> >>
> >>
> >> I've already given a bunch of talks with the notebook, but always
> >>
> >> using just the defaults and at most zooming in for readability.
> >>
> >>
> >> Does any of you have a little snippet of CSS you like that styles a
> >>
> >> notebook a little better for a presentation (fonts, sizes, maybe even
> >>
> >> color, etc). If you have a favorte, send it my way!
> >>
> >>
> >> Thanks in advance!
> >>
> >>
> >>
> >> f
> >>
> >>
> >> --
> >>
> >> Fernando Perez (@fperez_org; http://fperez.org)
> >>
> >> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> >>
> >> fernando.perez-at-berkeley: contact me here for any direct mail
> >>
> >> _______________________________________________
> >>
> >> IPython-dev mailing list
> >>
> >> IPython-dev at scipy.org
> >>
> >> http://mail.scipy.org/mailman/listinfo/ipython-dev
> >>
> >> _______________________________________________
> >>
> >> IPython-dev mailing list
> >>
> >> IPython-dev at scipy.org
> >>
> >> http://mail.scipy.org/mailman/listinfo/ipython-dev
> >>
> >>
> >>
> >>
> >> --
> >> Fernando Perez (@fperez_org; http://fperez.org)
> >> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> >> fernando.perez-at-berkeley: contact me here for any direct mail
> >> _______________________________________________
> >> IPython-dev mailing list
> >> IPython-dev at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/ipython-dev
> >> _______________________________________________
> >> IPython-dev mailing list
> >> IPython-dev at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/ipython-dev
> >>
> >>
> >>
> >> _______________________________________________
> >> IPython-dev mailing list
> >> IPython-dev at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/ipython-dev
> >>
> >
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
>
>
>
> --
> Fernando Perez (@fperez_org; http://fperez.org)
> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> fernando.perez-at-berkeley: contact me here for any direct mail
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 4 Jun 2013 23:56:22 +0530
> From: TARUN GABA <tarun.gaba7 at gmail.com>
> Subject: [IPython-dev] Including javascript from static library
> To: ipython-dev at scipy.org
> Message-ID:
> <
> CAHAono2BsLgSECaE1f0Ty_eG4217XvyZB0ObLNYFUS18oBpWDg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> Again for the same project, I have been working on,
> I need to include three.js and a few other javascript libraries for it to
> work.
> I am trying to include these js using ...
>
> HTML("'""<script src="full path to/three.js"></script>""")
>
> At the developers console of my browser I am getting a 503 (service
> unavailable error)
>
> I also tried using ..
>
> HTML("""<script src="js/three.js"></script>""")
>
> But got a 404( not found) at developer console.
>
> Any suggestions on how to efficiently include the js in ipython notebooks
>
> P.S. : I would prefer js files residing in my repo, rather than ipython
> configuration directory(alongwith custom.js)
>
> Thanks
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.scipy.org/pipermail/ipython-dev/attachments/20130604/8f59f250/attachment-0001.html
>
> ------------------------------
>
> Message: 4
> Date: Tue, 4 Jun 2013 14:28:36 -0400
> From: Satrajit Ghosh <satra at mit.edu>
> Subject: Re: [IPython-dev] Including javascript from static library
> To: IPython developers list <ipython-dev at scipy.org>
> Message-ID:
> <
> CA+A4wOnYTjN16kJ6ByWoAKDnJw1czBMwGX6CfuyW-0hLRcibwQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> if your js directory is in the same location as the notebook try:
>
> src="files/js/three.js"
>
> cheers,
>
> satra
>
> On Tue, Jun 4, 2013 at 2:26 PM, TARUN GABA <tarun.gaba7 at gmail.com> wrote:
>
> > Hi,
> >
> > Again for the same project, I have been working on,
> > I need to include three.js and a few other javascript libraries for it to
> > work.
> > I am trying to include these js using ...
> >
> > HTML("'""<script src="full path to/three.js"></script>""")
> >
> > At the developers console of my browser I am getting a 503 (service
> > unavailable error)
> >
> > I also tried using ..
> >
> > HTML("""<script src="js/three.js"></script>""")
> >
> > But got a 404( not found) at developer console.
> >
> > Any suggestions on how to efficiently include the js in ipython notebooks
> >
> > P.S. : I would prefer js files residing in my repo, rather than ipython
> > configuration directory(alongwith custom.js)
> >
> > Thanks
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.scipy.org/pipermail/ipython-dev/attachments/20130604/2dea886f/attachment.html
>
> ------------------------------
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
> End of IPython-dev Digest, Vol 113, Issue 9
> *******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130605/aaa29757/attachment.html>
More information about the IPython-dev
mailing list