ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 18 Jan 2012 04:43:42 +0100Personalizing the notebookhttps://ask.sagemath.org/question/8328/personalizing-the-notebook/I am running two notebook servers in the same machine and i want to personalize them (mainly the login screen, and maybe also some translation). I have seen that putting a notebook.css in the $HOME/.sage/ directory i can customize the colors. Also, editing the files in /devel/sagenb-main/sagenb/data/sage/html/ i can personalize the login screen and so on.
My question is: can i do it on a per-notebook basis? Is there some location in the $HOME/.sage/sage_notebook-sagenb/ directory where i can copy the modified files in order to affect that specific notebook?.
I know that, in the worst case, i would do it by copying the whole sage instalation and making the different changes in the two directories, but i would prefear to find a solution that doesn't imply duplicating the instalation.Sun, 18 Sep 2011 14:16:51 +0200https://ask.sagemath.org/question/8328/personalizing-the-notebook/Comment by Jason Grout for <p>I am running two notebook servers in the same machine and i want to personalize them (mainly the login screen, and maybe also some translation). I have seen that putting a notebook.css in the $HOME/.sage/ directory i can customize the colors. Also, editing the files in /devel/sagenb-main/sagenb/data/sage/html/ i can personalize the login screen and so on.</p>
<p>My question is: can i do it on a per-notebook basis? Is there some location in the $HOME/.sage/sage_notebook-sagenb/ directory where i can copy the modified files in order to affect that specific notebook?.</p>
<p>I know that, in the worst case, i would do it by copying the whole sage instalation and making the different changes in the two directories, but i would prefear to find a solution that doesn't imply duplicating the instalation.</p>
https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=21227#post-id-21227Can you post your "answer", or a bit more details about how you did it, as an actual answer? Also, can you open a trac ticket to add this feature? I think it would be great if we could customize each notebook by putting something in the sage_notebook.sagenb directory.Tue, 20 Sep 2011 11:33:54 +0200https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=21227#post-id-21227Comment by mmarco for <p>I am running two notebook servers in the same machine and i want to personalize them (mainly the login screen, and maybe also some translation). I have seen that putting a notebook.css in the $HOME/.sage/ directory i can customize the colors. Also, editing the files in /devel/sagenb-main/sagenb/data/sage/html/ i can personalize the login screen and so on.</p>
<p>My question is: can i do it on a per-notebook basis? Is there some location in the $HOME/.sage/sage_notebook-sagenb/ directory where i can copy the modified files in order to affect that specific notebook?.</p>
<p>I know that, in the worst case, i would do it by copying the whole sage instalation and making the different changes in the two directories, but i would prefear to find a solution that doesn't imply duplicating the instalation.</p>
https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=21231#post-id-21231I finally did it using javascript. It's not an elegant solution, but it works.Tue, 20 Sep 2011 10:06:07 +0200https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=21231#post-id-21231Answer by mmarco for <p>I am running two notebook servers in the same machine and i want to personalize them (mainly the login screen, and maybe also some translation). I have seen that putting a notebook.css in the $HOME/.sage/ directory i can customize the colors. Also, editing the files in /devel/sagenb-main/sagenb/data/sage/html/ i can personalize the login screen and so on.</p>
<p>My question is: can i do it on a per-notebook basis? Is there some location in the $HOME/.sage/sage_notebook-sagenb/ directory where i can copy the modified files in order to affect that specific notebook?.</p>
<p>I know that, in the worst case, i would do it by copying the whole sage instalation and making the different changes in the two directories, but i would prefear to find a solution that doesn't imply duplicating the instalation.</p>
https://ask.sagemath.org/question/8328/personalizing-the-notebook/?answer=12675#post-id-12675What i did was basically include this:
<script type="text/javascript">
if (location.href=='url1')
{
document.write('content1');
}
if (location.href=='url2')
{
document.write('content2');
}
</script>
in /devel/sagenb-main/sagenb/data/sage/html/login.html, where url1 and url2 are the complete urls of each notebook, and content1 and content2 the contents you want the paage to show in each case.Wed, 21 Sep 2011 18:49:20 +0200https://ask.sagemath.org/question/8328/personalizing-the-notebook/?answer=12675#post-id-12675Answer by burcin for <p>I am running two notebook servers in the same machine and i want to personalize them (mainly the login screen, and maybe also some translation). I have seen that putting a notebook.css in the $HOME/.sage/ directory i can customize the colors. Also, editing the files in /devel/sagenb-main/sagenb/data/sage/html/ i can personalize the login screen and so on.</p>
<p>My question is: can i do it on a per-notebook basis? Is there some location in the $HOME/.sage/sage_notebook-sagenb/ directory where i can copy the modified files in order to affect that specific notebook?.</p>
<p>I know that, in the worst case, i would do it by copying the whole sage instalation and making the different changes in the two directories, but i would prefear to find a solution that doesn't imply duplicating the instalation.</p>
https://ask.sagemath.org/question/8328/personalizing-the-notebook/?answer=12676#post-id-12676If you are using [the flask notebook](http://code.google.com/r/rkirov-flask/) you can use the SAGENB_TEMPLATE_PATH environment variable to specify the directory to search for the html templates and stylesheets.
Here is [the changeset](http://code.google.com/r/rkirov-flask/source/detail?r=0e36b193bd4001562cbe524a086262b81ea2fff9).Wed, 21 Sep 2011 19:50:18 +0200https://ask.sagemath.org/question/8328/personalizing-the-notebook/?answer=12676#post-id-12676Comment by burcin for <p>If you are using <a href="http://code.google.com/r/rkirov-flask/">the flask notebook</a> you can use the SAGENB_TEMPLATE_PATH environment variable to specify the directory to search for the html templates and stylesheets.</p>
<p>Here is <a href="http://code.google.com/r/rkirov-flask/source/detail?r=0e36b193bd4001562cbe524a086262b81ea2fff9">the changeset</a>.</p>
https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=20511#post-id-20511Pedro, the patch with SAGENB_TEMPLATE_PATH was only merged in the flask notebook AFAIK. There is still ongoing work to include this in Sage-5.0.Wed, 18 Jan 2012 04:43:42 +0100https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=20511#post-id-20511Comment by burcin for <p>If you are using <a href="http://code.google.com/r/rkirov-flask/">the flask notebook</a> you can use the SAGENB_TEMPLATE_PATH environment variable to specify the directory to search for the html templates and stylesheets.</p>
<p>Here is <a href="http://code.google.com/r/rkirov-flask/source/detail?r=0e36b193bd4001562cbe524a086262b81ea2fff9">the changeset</a>.</p>
https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=21217#post-id-21217Before starting Sage, you should set SAGENB_TEMPLATE_PATH to a directory which contains a customized version of the contents of the sagenb/data/sage dir from the notebook repository.Thu, 22 Sep 2011 09:23:53 +0200https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=21217#post-id-21217Comment by Pedro for <p>If you are using <a href="http://code.google.com/r/rkirov-flask/">the flask notebook</a> you can use the SAGENB_TEMPLATE_PATH environment variable to specify the directory to search for the html templates and stylesheets.</p>
<p>Here is <a href="http://code.google.com/r/rkirov-flask/source/detail?r=0e36b193bd4001562cbe524a086262b81ea2fff9">the changeset</a>.</p>
https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=20586#post-id-20586Where, in a recent sage release, is SAGENB_TEMPLATE_PATH set ? How is it set to sagenb/data/sage ?Thu, 05 Jan 2012 09:44:37 +0100https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=20586#post-id-20586Comment by mmarco for <p>If you are using <a href="http://code.google.com/r/rkirov-flask/">the flask notebook</a> you can use the SAGENB_TEMPLATE_PATH environment variable to specify the directory to search for the html templates and stylesheets.</p>
<p>Here is <a href="http://code.google.com/r/rkirov-flask/source/detail?r=0e36b193bd4001562cbe524a086262b81ea2fff9">the changeset</a>.</p>
https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=21218#post-id-21218Thanks. Is the flask notebook ready for real use already? When is it expected to substitute the traditional one? And finally: where does the SAGENB_TEMPLATE_PATH must be set?Thu, 22 Sep 2011 06:39:55 +0200https://ask.sagemath.org/question/8328/personalizing-the-notebook/?comment=21218#post-id-21218