Luckily, the format of the sage notebook hasn't changed at all in 6
months -- You should
just be able to use all your Sage notebooks from any version of sage from
the last 6 months with any other one automatically.
If you want to make a copy or move a sage_notebook directory, just copy
or move it.
Apologies if I misunderstand your questions -- if so, please clarify.
William
Worksheets are stored in a the directory sage_notebook (or whatever you
called it). The state of the whole notebook and associated data files
is stored in that directory.
> I looked around (in the file system
> and in the documentation), but couldn't find where the worksheet data
> is stored. For instance, none of the following seem very promising:
E.g., if you do
cd my_favoriate_directory
then
sage -notebook
a directory
my_favoriate_directory/sage_notebook
is created and inside of that the notebook state is stored. I have
probably a dozen different sage_notebook directories just on my laptop.
E.g., if I'm working on a paper I often make a sage_notebook directory
in the same directory as the paper, and gather all relevant worksheets
there.
>
> jonhanke@[~/Documents/sage-2.8]: find . -name sage_notebook
> ./devel/doc-2.8/overviews/a_tour_of_sage/sage_notebook
> ./devel/doc-main/.hg/data/overviews/a_tour_of_sage/sage_notebook
> ./devel/doc-main/overviews/a_tour_of_sage/sage_notebook
>
> > Apologies if I misunderstand your questions -- if so, please clarify.
>
> I was also wondering if there was a way to allow for migrating
> worksheets in there were changes to the notebook format between
> versions.
You can take a sage_notebook directory from any version of the
notebook that I have ever released and type
sage -notebook
and it should work with no loss of data. There was exactly one format
change in the history of the notebook in I think June, and if your notebook
is older than this, it will be migrated and the old worksheets will appear
under "published".
> I assumed that the "save worksheet to file" option would
> automatically account for such format changes when importing a saved
> worksheet from an older version of Sage, so this would be the correct
> (i.e. safe) way of migrating worksheets. If this is true, then it
> would be nice to have a "save all worksheets to a file" option, and if
> not then I'm asking if there is a safe way of migrating worksheets
> between Sage versions.
You just don't have to worry about any of that -- Sage should (and does)
read old worksheets. By the way, worksheets themselves are just
stored as plain text files. E.g., if I do
cd /Users/was/sage_notebook/worksheets/admin/0
on my laptop, there is a file worksheet.txt with these contents:
justin
system:sage
{{{id=0|
def CompSum(a,b):
return a+b
}}}
{{{id=1|
CompSum(3,4)
///
7
}}}
{{{id=3|
2+2
///
4
}}}
{{{id=4|
Q.<i,j,k>=QuaternionAlgebra(QQ,-3,4)
...
}}}
So you needn't be afraid of worksheets being stored in some
weird internal database or binary file -- they're just in
the directory sage_notebook/worksheets/username/number/worksheet.txt
One nice benefit of this is if you want to find all worksheets on your computer
in any directory that contain "this worksheet proves the Riemann Hypothesis",
say, then you can just do a full text search and you'll find them.
William
Could you think back about when/how/where you might have looked or
thought to look in the documentation for this sort of information? It's of
course not anywhere in the documentation, but if you could explain where
you think it should have been, we could stick it here. Even better, you
could even put it there and submit a patch.
William
For the tutorial edit
SAGE_ROOT/devel/doc/tut/tut.tex
and for the programming guide edit
SAGE_ROOT/devel/doc/prog/prog.tex
Once you edit one of those files do
cd SAGE_ROOT/devel/doc/tut/
./build_dvi
to build the dvi version in the current directory, or ./build_pdf to
build a pdf.
Make sure it looks good. Then do hg_doc.ci(); hg_doc.export(...) or
hg_doc.send(...)
etc.
-- William