Can one change the default language of a sagecell with new instance?

asked 2015-08-13 07:04:36 -0500

Scott Dillery gravatar image

Suppose I wish to have multiple, linked sagecells and create them using:

// Make *any* div with class 'rCell' a Sage cell
sagecell.makeSagecell({inputLocation: 'div.rCell',
                       defaultLanguage: "r",
                       languages: sagecell.allLanguages,
                       linked: true});

Is it possible to change the default language later when the nth cell is created? That is, can I change the default language in the div class="rCell" block?

I tried redefining the class before the nth cell with a new default language, but that did not change default language. And, I can simply instruct a user to change the default language before evaluation, but I would like it to be more streamlined. The main thing is that I need to keep the cells linked.

Thanks for any help.

edit retag flag offensive close merge delete


I'm not a javascript expert, but my understanding is that js doesn't work this way. You'd probably need two different invocations - one with 'div.rCell' and maybe another with 'div.notrCell'. Hopefully they would still be linked, though, I think that is orthogonal to language. Try that and if it works I'll turn this into an answer so people can find it.

kcrisman gravatar imagekcrisman ( 2015-08-14 08:53:24 -0500 )edit