sagemath/sagecell — pull request #366 by shoibalc (2012-09-23 12:58:33+00:00)
Title: Sphinx extension for sagecell

This is a sphinx extension that takes an rst snippet like this one and converts it to a sagecell in html, thanks to the similar plugin for moinmoin wiki.

USAGE:

.. sagemath::

1+1
print "hello world"

https://gist.github.com/3768246 takes a slightly different approach which modifies highlighting.py in the Sphinx base code so it'll likely to break with a new sphinx release.
It adds a 'sagecell' language to the code-block or sourcecode directive's language options. sagecell is exactly equivalent to python except when html output is produced. In the case of html output the
regular Pygments highlighting + HTML output workflow is bypassed and it uses html_sagecell
instead to produce a sagecell.