Skip to main content

The Sphinx extension embedding a Sage cell into a webpage

Project description

Installation

Install the sphinx-sagecell-ext from PyPI

$ sudo pip install sphinx-sagecell-ext

Install the sphinx-sagecell-ext from GitHub

$ sudo pip install git+git://github.com/korniichuk/sphinx-sagecell-ext#egg=sphinx-sagecell-ext

Upgrade the sphinx-sagecell-ext from PyPI

$ sudo pip install -U sphinx-sagecell-ext

or:

$ sudo pip install --upgrade sphinx-sagecell-ext

Uninstall the sphinx-sagecell-ext

$ sudo pip uninstall sphinx-sagecell-ext

Development installation

$ git clone git://github.com/korniichuk/sphinx-sagecell-ext.git
$ cd sphinx-sagecell-ext
$ sudo pip install .

Quickstart

First, add sphinx-sagecell-ext.sagecell extension to conf.py documentation file::

extensions = [
    'sphinx-sagecell-ext.sagecell'
]

Second, copy layout.html file to _templates documentation directory:

$ wget -P DEST https://raw.githubusercontent.com/korniichuk/sphinx-sagecell-ext/master/layout.html

Where:

  • DEST – a path to _templates documentation directory.

Example:

$ wget -P ~/sphinx-sagecell-ext/source/_templates https://raw.githubusercontent.com/korniichuk/sphinx-sagecell-ext/master/layout.html

Usage

The following is some example usage:

.. sagecellserver::

   sphere()

Options

The key/value pairs serve as the configuration of the created Sage Cell instance. The following options can be set when embedding:

Linked cells

When multiple input locations are given, this sets whether the code from these cells is to be executed from the same kernel, so that code executed in one will affect the execution of code from another cell:

.. sagecellserver::
   :linked: true

.. sagecellserver::
   :linked: false

For changing the default value. First, open the /usr/local/lib/python2.7/dist-packages/sphinx-sagecell-ext/sagecell.py file:

$ sudo gedit /usr/local/lib/python2.7/dist-packages/sphinx-sagecell-ext/sagecell.py

Second, change the next code from:

linked = True

to:

linked = False

Example

.. sagecellserver::
   :linked: true

   x = "first cell"

.. sagecellserver::
   :linked: false

   x = "second cell"

.. sagecellserver::
   :linked: true

   x
options: linked_cells [prtscn]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

sphinx-sagecell-ext-0.1rc4.zip (43.8 kB view details)

Uploaded Source

sphinx-sagecell-ext-0.1rc4.tar.gz (41.1 kB view details)

Uploaded Source

File details

Details for the file sphinx-sagecell-ext-0.1rc4.zip.

File metadata

File hashes

Hashes for sphinx-sagecell-ext-0.1rc4.zip
Algorithm Hash digest
SHA256 ba47acc94191f600654f58c4d910652f47d346516a8d18b7c8370d373a2769f2
MD5 0747eb2774f7e5769ba95bb4cd82fd80
BLAKE2b-256 791e32bf9489c3069472ed3851740806a8dd73ae5c5498c28e62ff644a4d0fa0

See more details on using hashes here.

File details

Details for the file sphinx-sagecell-ext-0.1rc4.tar.gz.

File metadata

File hashes

Hashes for sphinx-sagecell-ext-0.1rc4.tar.gz
Algorithm Hash digest
SHA256 88d90bc1ce9dd62f7ef0b27dc0ee0494b20837b060778e7312eb92c34d2dfbee
MD5 6be00e404ecba9e405f656f7be962525
BLAKE2b-256 94242107eaade558b70f48be007b2a50180a3779728b3f4c6aa81bba862bc793

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page