Ask Your Question
4

Personalizing the notebook

asked 13 years ago

mmarco gravatar image

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.

Preview: (hide)

Comments

I finally did it using javascript. It's not an elegant solution, but it works.

mmarco gravatar imagemmarco ( 13 years ago )

Can 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.

Jason Grout gravatar imageJason Grout ( 13 years ago )

2 Answers

Sort by » oldest newest most voted
2

answered 13 years ago

If you are using the flask notebook 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.

Preview: (hide)
link

Comments

Thanks. 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?

mmarco gravatar imagemmarco ( 13 years ago )

Before 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.

burcin gravatar imageburcin ( 13 years ago )

Where, in a recent sage release, is SAGENB_TEMPLATE_PATH set ? How is it set to sagenb/data/sage ?

Pedro gravatar imagePedro ( 13 years ago )

Pedro, 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.

burcin gravatar imageburcin ( 13 years ago )
0

answered 13 years ago

mmarco gravatar image

What 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.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 13 years ago

Seen: 1,147 times

Last updated: Sep 21 '11