linking sage cells with different templates (to "hide" code)

asked 2021-03-24 19:31:18 +0100

millermj gravatar image

I'm setting up a sage cell that requires some front-end code to define functions. Rather than requiring my users to scroll through that code, I'd like to "hide" it.

One possibility would be to autoeval the front-end code in a cell with a minimal template and hidden editor, then have my users work in a second (linked) cell with a normal template and editor. But defining cells with different templates seems to require using different div classes, and linked:true seems to work only within a class.

1) Is there a better way to "hide" code?

2) Is there a way to link cells that have different templates?

Thanks!

edit retag flag offensive close merge delete

Comments

As far as I understand it, this question addresses the existence of some Jupyter features, and has nothing Sagemath-specific.

It could be better answered if asked in a more relevant place ; a tiny boit of Googling seems to suggest that the Jupyter Discourse forum might be adequate...

HTH,

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2021-03-24 20:28:21 +0100 )edit

The question is probably about SageCell rather than about Jupyter.

If so, another place it could be asked is the sage-cell mailing list.

slelievre gravatar imageslelievre ( 2021-03-25 01:31:49 +0100 )edit

In a Jupyter notebook, one can install hide-code jupyter extension to allow this.

Sébastien gravatar imageSébastien ( 2021-03-26 09:24:31 +0100 )edit