The following code hides the definition of f(x) while allowing its use in the interact input box.
=================================== <HTML> <HEAD> <script src="https://sagecell.sagemath.org/static/embedded_sagecell.js"></script> <script>sagecell.makeSagecell({inputLocation: '.sage', template: sagecell.templates.minimal, autoeval:true, hide: ["evalButton"], });</script> </HEAD> <BODY> <div class="sage"> <script type="text/x-sage"> def f(x): return x^2 @interact def _(userinput=input_box(default="print(f(5))", label='', height=5), auto_update=false): exec(preparse(userinput)) </script> </div> </BODY> </HTML> ==================================== 1) It would be nice to have this incorporated into the native sagecell code. In particular, having a template sagecell.templates.hidden, and having the interact commands automatically appended would make this easier to use for those newly encountering sage cells. I'm guessing that some combination of the sagecell code and the interact input_box code could accomplish all this. I don't know enough about either to suggest how, but I'm happy to help where I can. 2) IMHO, having everything in a single html file makes customization easier (vs having to load code from github.) -- You received this message because you are subscribed to the Google Groups "sage-cell" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/13df0661-b26e-4d1b-9c44-b7ce43b80828n%40googlegroups.com.
