File: nb_to_doc.py

package info (click to toggle)
seaborn 0.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,896 kB
  • ctags: 1,183
  • sloc: python: 8,372; makefile: 181
file content (20 lines) | stat: -rwxr-xr-x 419 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/env python
"""
Convert empty IPython notebook to a sphinx doc page.

"""
import os
import sys


def convert_nb(nbname):

    os.system("runipy --o %s.ipynb --matplotlib --quiet" % nbname)
    os.system("ipython nbconvert --to rst %s.ipynb" % nbname)
    os.system("tools/nbstripout %s.ipynb" % nbname)


if __name__ == "__main__":

    for nbname in sys.argv[1:]:
        convert_nb(nbname.strip(".ipynb"))