Ask Your Question
0

Track a sage worksheet in git

asked 2013-11-13 05:13:28 +0100

Kevin gravatar image

updated 2015-01-23 21:57:42 +0100

FrédéricC gravatar image

I would like to track the changes to a sage worksheet in git so I can collaborate with github/bitbucket with a group who typically does not have access to a centralized machine. Right now I have been copying the sage .sws files to the repository for each version, but they are binary so much of the utility of version control is lost (the comments, feature tracking, etc still work)

I suggest a split between text/code and binary data and maybe having 2 files per worksheet instead of 1. I have already played with uncompressing the sws and version tracking the worksheet.html, but that doesn't integrate as nicely into a workflow.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2013-11-13 06:12:28 +0100

tmonteil gravatar image

You can work with .rst (ReStructuredText) files since these can be imported in a notebook and that there are ways to convert from .sws to .rst in both directions:

sage -advanced

tells you:

File conversion:
  -rst2txt [...]      -- Generates Sage worksheet text file from standalone
                         reStructuredText source.
  -rst2sws [...]      -- Generates Sage worksheet (.sws) from standalone
                         reStructuredText source.
  -sws2rst <sws doc>  -- Generates a reStructuredText source file from
                         a Sage worksheet (.sws) document.

Also, all the documentation and tutorials are written in ReStructuredText, and can be used as worksheets. They can be a good source of example to start with.

edit flag offensive delete link more

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: 2013-11-13 05:13:28 +0100

Seen: 257 times

Last updated: Nov 13 '13