File: utils.rst

package info (click to toggle)
sphinx-gallery 0.19.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,340 kB
  • sloc: python: 10,346; makefile: 216; lisp: 15; sh: 11; cpp: 9
file content (47 lines) | stat: -rw-r--r-- 1,547 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
========================
Sphinx-Gallery Utilities
========================

Convert Python scripts into Jupyter Notebooks
=============================================

Sphinx Gallery exposes its python source to Jupyter notebook converter
as a executable script too. To use this utility just call the script
and give the Python source file as argument:

.. code-block:: console

  $ python -m sphinx_gallery_py2jupyter python_script.py


Embedding Sphinx-Gallery inside your documentation script extensions
====================================================================

If you want to embed Sphinx-Gallery in your project instead of putting
it as a dependency you can call our embedding script inside your
Sphinx extensions folder:

.. code-block:: console

    # Script to do a local install of sphinx-gallery
    rm -rf tmp sphinx_gallery

    easy_install -Zeab tmp sphinx-gallery

    cp -vru tmp/sphinx-gallery/sphinx_gallery/ .

    echo "Remember to add sphinx_gallery to your version control"
    echo "Use in case of git:"
    echo "$ git add sphinx_gallery"

This will download directly from PyPI our latest released code and
save it to the current folder. This is a stripped version of the
Sphinx-Gallery module to incorporate in your project. You should also
add it to your version control system.

Minigallery directive
======================

Sphinx-Gallery provides the ``minigallery`` directive so you can easily add a reduced
version of the gallery to your documentation.
See :ref:`minigalleries_to_examples` for details.