Csound Csound-dev Csound-tekno Search About

[Csnd] syntax highlighting in ctcsound jupyter notebooks not working

Date2019-08-30 15:57
Fromjoachim heintz
Subject[Csnd] syntax highlighting in ctcsound jupyter notebooks not working
syntax highlighting is not working for me in code cells in
https://github.com/fggp/ctcsound/blob/master/cookbook/06-csoundmagics.ipynb

1. i have the csoundmagics installed.
2. it is written in this notebook that
"%%csd, %%orc, and %%sco in the code cells above were syntax 
highlighted, thanks to the csound.js installed in the codemirror editor 
of Jupyter."
indeed there is the csound.js in
anaconda3/lib/python3.7/site-packages/notebook/static/components/codemirror/mode/csound/csound.js
so i think this should be fine.
3. javascript in the browser is enabled.
4. this is with firefox under linux.

does anyone have an idea what might be the reason?

thanks -
	joachim

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-08-30 17:01
FromGuillermo Senna
SubjectRe: [Csnd] syntax highlighting in ctcsound jupyter notebooks not working
Attachmentsscreenshot_2019-08-30-12:59:29.png  
>From that same link you posted? should it look like the attachment? This
was with firefox 68.0.1 and Ubuntu Studio.

On 30/8/19 11:57, joachim heintz wrote:
> syntax highlighting is not working for me in code cells in
> https://github.com/fggp/ctcsound/blob/master/cookbook/06-csoundmagics.ipynb
>
>
> 1. i have the csoundmagics installed.
> 2. it is written in this notebook that
> "%%csd, %%orc, and %%sco in the code cells above were syntax
> highlighted, thanks to the csound.js installed in the codemirror
> editor of Jupyter."
> indeed there is the csound.js in
> anaconda3/lib/python3.7/site-packages/notebook/static/components/codemirror/mode/csound/csound.js
>
> so i think this should be fine.
> 3. javascript in the browser is enabled.
> 4. this is with firefox under linux.
>
> does anyone have an idea what might be the reason?
>
> thanks -
>     joachim
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-08-30 17:51
FromFrancois PINOT
SubjectRe: [Csnd] syntax highlighting in ctcsound jupyter notebooks not working
Hello Joachim
you're right about the csound.js mode for codemirror, but it's not enough. custom.js has to be in the right place so that jupyter knows about it: see the code in installCsoundmagics.py
Regards
François.


Le ven. 30 août 2019 à 16:57, joachim heintz <jh@joachimheintz.de> a écrit :
syntax highlighting is not working for me in code cells in
https://github.com/fggp/ctcsound/blob/master/cookbook/06-csoundmagics.ipynb

1. i have the csoundmagics installed.
2. it is written in this notebook that
"%%csd, %%orc, and %%sco in the code cells above were syntax
highlighted, thanks to the csound.js installed in the codemirror editor
of Jupyter."
indeed there is the csound.js in
anaconda3/lib/python3.7/site-packages/notebook/static/components/codemirror/mode/csound/csound.js
so i think this should be fine.
3. javascript in the browser is enabled.
4. this is with firefox under linux.

does anyone have an idea what might be the reason?

thanks -
        joachim

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-08-31 08:54
Fromjoachim heintz
SubjectRe: [Csnd] syntax highlighting in ctcsound jupyter notebooks not working
ok i found the reason.  i am using jupyter lab, and from this i use 
jupyter notebooks.  although everything is at the right place, the 
javascript extension is not working.  obviously there are other ways 
jupyter lab handels this:
http://www.xavierdupre.fr/app/jyquickhelper/helpsphinx/blog/2018/2018-03-12_customjs.html

when i start jupyter-notebook instead of jupyter-lab in the anaconda bin 
directory, it works as it should.

by the way, i have sent a pull request to the ctcsound github repo (not 
about this).  and i am wondering why the ctcsound repo is not part of 
https://github.com/csound ?  i think this would be the best place.

	joachim


On 30/08/19 18:51, Francois PINOT wrote:
> Hello Joachim
> you're right about the csound.js mode for codemirror, but it's not
> enough. custom.js has to be in the right place so that jupyter knows
> about it: see the code in installCsoundmagics.py
> Regards
> François.
>
>
> Le ven. 30 août 2019 à 16:57, joachim heintz  > a écrit :
>
>     syntax highlighting is not working for me in code cells in
>     https://github.com/fggp/ctcsound/blob/master/cookbook/06-csoundmagics.ipynb
>
>     1. i have the csoundmagics installed.
>     2. it is written in this notebook that
>     "%%csd, %%orc, and %%sco in the code cells above were syntax
>     highlighted, thanks to the csound.js installed in the codemirror editor
>     of Jupyter."
>     indeed there is the csound.js in
>     anaconda3/lib/python3.7/site-packages/notebook/static/components/codemirror/mode/csound/csound.js
>     so i think this should be fine.
>     3. javascript in the browser is enabled.
>     4. this is with firefox under linux.
>
>     does anyone have an idea what might be the reason?
>
>     thanks -
>             joachim
>
>     Csound mailing list
>     Csound@listserv.heanet.ie 
>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     Send bugs reports to
>             https://github.com/csound/csound/issues
>     Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> 
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features
> can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-09-02 05:34
FromFrancois PINOT
SubjectRe: [Csnd] syntax highlighting in ctcsound jupyter notebooks not working
Hello Joachim,

thanks for the information about jupyter lab.
I merged your pull request and I deleted the lines

import csound
cs = ctcsound.Csound()

from the fifth cell, because this would create a new instance of Csound, while you write "that we can still access the Csound instance with other methods"

I'll ask Victor for transferring the ctcsound repo into https://github.com/csound.

Regards
François

Le sam. 31 août 2019 à 09:54, joachim heintz <jh@joachimheintz.de> a écrit :
ok i found the reason.  i am using jupyter lab, and from this i use
jupyter notebooks.  although everything is at the right place, the
javascript extension is not working.  obviously there are other ways
jupyter lab handels this:
http://www.xavierdupre.fr/app/jyquickhelper/helpsphinx/blog/2018/2018-03-12_customjs.html

when i start jupyter-notebook instead of jupyter-lab in the anaconda bin
directory, it works as it should.

by the way, i have sent a pull request to the ctcsound github repo (not
about this).  and i am wondering why the ctcsound repo is not part of
https://github.com/csound ?  i think this would be the best place.

        joachim


On 30/08/19 18:51, Francois PINOT wrote:
> Hello Joachim
> you're right about the csound.js mode for codemirror, but it's not
> enough. custom.js has to be in the right place so that jupyter knows
> about it: see the code in installCsoundmagics.py
> Regards
> François.
>
>
> Le ven. 30 août 2019 à 16:57, joachim heintz <jh@joachimheintz.de
> <mailto:jh@joachimheintz.de>> a écrit :
>
>     syntax highlighting is not working for me in code cells in
>     https://github.com/fggp/ctcsound/blob/master/cookbook/06-csoundmagics.ipynb
>
>     1. i have the csoundmagics installed.
>     2. it is written in this notebook that
>     "%%csd, %%orc, and %%sco in the code cells above were syntax
>     highlighted, thanks to the csound.js installed in the codemirror editor
>     of Jupyter."
>     indeed there is the csound.js in
>     anaconda3/lib/python3.7/site-packages/notebook/static/components/codemirror/mode/csound/csound.js
>     so i think this should be fine.
>     3. javascript in the browser is enabled.
>     4. this is with firefox under linux.
>
>     does anyone have an idea what might be the reason?
>
>     thanks -
>             joachim
>
>     Csound mailing list
>     Csound@listserv.heanet.ie <mailto:Csound@listserv.heanet.ie>
>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     Send bugs reports to
>             https://github.com/csound/csound/issues
>     Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto:Csound@listserv.heanet.ie>
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features
> can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-09-02 15:04
Fromjoachim heintz
SubjectRe: [Csnd] syntax highlighting in ctcsound jupyter notebooks not working
super, thanks!
best -
	joachim



On 02/09/19 06:34, Francois PINOT wrote:
> Hello Joachim,
>
> thanks for the information about jupyter lab.
> I merged your pull request and I deleted the lines
>
> import csound
> cs = ctcsound.Csound()
>
> from the fifth cell, because this would create a new instance of Csound,
> while you write "that we can still access the Csound instance with other
> methods"
>
> I'll ask Victor for transferring the ctcsound repo into
> https://github.com/csound.
>
> Regards
> François
>
> Le sam. 31 août 2019 à 09:54, joachim heintz  > a écrit :
>
>     ok i found the reason.  i am using jupyter lab, and from this i use
>     jupyter notebooks.  although everything is at the right place, the
>     javascript extension is not working.  obviously there are other ways
>     jupyter lab handels this:
>     http://www.xavierdupre.fr/app/jyquickhelper/helpsphinx/blog/2018/2018-03-12_customjs.html
>
>     when i start jupyter-notebook instead of jupyter-lab in the anaconda
>     bin
>     directory, it works as it should.
>
>     by the way, i have sent a pull request to the ctcsound github repo (not
>     about this).  and i am wondering why the ctcsound repo is not part of
>     https://github.com/csound ?  i think this would be the best place.
>
>             joachim
>
>
>     On 30/08/19 18:51, Francois PINOT wrote:
>     > Hello Joachim
>     > you're right about the csound.js mode for codemirror, but it's not
>     > enough. custom.js has to be in the right place so that jupyter knows
>     > about it: see the code in installCsoundmagics.py
>     > Regards
>     > François.
>     >
>     >
>     > Le ven. 30 août 2019 à 16:57, joachim heintz      
>     > >> a écrit :
>     >
>     >     syntax highlighting is not working for me in code cells in
>     >
>      https://github.com/fggp/ctcsound/blob/master/cookbook/06-csoundmagics.ipynb
>     >
>     >     1. i have the csoundmagics installed.
>     >     2. it is written in this notebook that
>     >     "%%csd, %%orc, and %%sco in the code cells above were syntax
>     >     highlighted, thanks to the csound.js installed in the
>     codemirror editor
>     >     of Jupyter."
>     >     indeed there is the csound.js in
>     >
>      anaconda3/lib/python3.7/site-packages/notebook/static/components/codemirror/mode/csound/csound.js
>     >     so i think this should be fine.
>     >     3. javascript in the browser is enabled.
>     >     4. this is with firefox under linux.
>     >
>     >     does anyone have an idea what might be the reason?
>     >
>     >     thanks -
>     >             joachim
>     >
>     >     Csound mailing list
>     >     Csound@listserv.heanet.ie 
>     >
>     >     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     >     Send bugs reports to
>     >             https://github.com/csound/csound/issues
>     >     Discussions of bugs and features can be posted here
>     >
>     > Csound mailing list Csound@listserv.heanet.ie
>     
>     > >
>     > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>     > https://github.com/csound/csound/issues Discussions of bugs and
>     features
>     > can be posted here
>
>     Csound mailing list
>     Csound@listserv.heanet.ie 
>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>     Send bugs reports to
>             https://github.com/csound/csound/issues
>     Discussions of bugs and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> 
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features
> can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here