##// END OF EJS Templates
Merge pull request #169 from jdfreder/master...
Matthias Bussonnier -
r10857:34b77601 merge
parent child Browse files
Show More
@@ -7,8 +7,8 b''
7 Overview
7 Overview
8 ========
8 ========
9
9
10 NbConvert provides a command line interface to convert to and from IPython
10 NbConvert provides a command line interface to convert from IPython
11 notebooks and standard formats.
11 notebooks to standard formats.
12
12
13 - ReST
13 - ReST
14 - Markdown
14 - Markdown
@@ -21,65 +21,84 b' notebooks and standard formats.'
21 As these functions mature, they will be merged into IPython.
21 As these functions mature, they will be merged into IPython.
22
22
23
23
24 Quick Start
25 ===========
24
26
25 Requirements
27 Dependencies
26 ============
28 ~~~~~~~~~~~~
27
29
28 Jinja2
30 To install the necessary dependencies on a **Linux** machine:
29 ~~~~~~
30 All of the exporters rely on the Jinja2 templating language.
31
31
32 ::
32
33
33 Markdown
34 pip install jinja2
34 ~~~~~~~~
35 pip install markdown
35 You will need the `python markdown module
36 curl http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/?view=tar > docutils.tgz
36 <http://pypi.python.org/pypi/Markdown>`_ ::
37 pip install -U docutils.tgz
38 pip install pygments
39 sudo easy_install -U sphinx
40 sudo apt-get install texlive-full
41 sudo apt-get install pandoc
37
42
43 If you're on a **Mac**, the last two commands are executed in a different manner (since apt-get doesn't exist.)
38
44
39 $ pip install markdown
45 ::
40
46
47 Install PanDoc via the installer http://code.google.com/p/pandoc/downloads/list
48 Install MacTex via the .pkg http://www.tug.org/mactex/
41
49
42 Docutils
50 Exporting
43 ~~~~~~~~
51 ~~~~~~~~~
44 nbconvert requires the latest development version of docutils. This can be installed
45 via ::
46
52
47 $ curl http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/?view=tar > docutils.tgz
53 Now, to export a notebook you can call
48 $ pip install -U docutils.tgz
49
54
50
55
51 Sphinx-Latex
52 ~~~~~~~~~~~~
53 We are trying to require as little as possible, but for now, compiling the generated Tex file requires texlive-full.
54 ::
56 ::
55
57
56 sudo apt-get install texlive-full
58 python nbconvert.py sphinx_howto book.ipynb
59
60 Where **book.ipynb** *is the name of the notebook* you'd like to convert
61 and **sphinx_howto** *is the output template name*. See */nbconvert/templates/* and
62 */nbconvert/templates/sphinx/* for more. NOTE: the template
63 extension should **not** be included in the template name.
57
64
58
65
59 *See http://jimmyg.org/blog/2009/sphinx-pdf-generation-with-latex.html for more information*
66 This will create a file.ext (converted file) and /book_files/ directory with all of the output figures.
60
67
68 Latex Only
69 ~~~~~~~~~~
61
70
62 Pandoc
71 If you want to compile a PDF from LaTeX output, move the file.tex (conversion results)
63 ~~~~~~
72 into the directory with all the figures /book_files/. The You can then run
64 Nbconvert also needs the `pandoc multiformat converter
65 <http://johnmacfarlane.net/pandoc>`_ to do the actual text conversions. Pandoc
66 is included in most Linux distribution's package managers, and the author's
67 website contains links to Mac OS X and Windows installers.
68
73
69 Pandoc, to convert markdown into latex
70 ::
74 ::
71
75
72 sudo apt-get install pandoc
76 cd book_files
77 PdfLatex file.tex
73
78
79 Reveal-powered slideshows
80 ~~~~~~~~~~~~~~~~~~~~~~~~~
81
82 If you want to convert a notebook to a reveal-powered slideshow, you have to call
74
83
75 Pygment
76 ~~~~~~~
77 For conversion to HTML/LaTeX, pygments is also required for syntax highlighting
78 ::
84 ::
79
85
80 $ pip install pygments
86 python nbconvert.py reveal your_slideshow.ipynb
87
88 and then, you will get a your_slideshow.reveal.html file.
89
90 But the slideshow will not be rendered correctly if you do not download and unzip the reveal.js library
91 in the same folder where your_slideshow.reveal.html file is located.
81
92
93 **Note**: You can get the reveal.js library from this link: https://github.com/hakimel/reveal.js/archive/2.4.0.zip
82
94
95 Finally, to see the slideshow, just serve it
96
97 ::
98
99 python -m SimpleHTTPServer 8000
100
101 and point your browser to http://localhost:8000.
83
102
84 Running Tests
103 Running Tests
85 =============
104 =============
@@ -90,19 +109,3 b' Please try to run the tests to avoid regression when committing a patch, and cre'
90 $ pip install nose
109 $ pip install nose
91 $ nosetests
110 $ nosetests
92
111
93
94
95 Using nbconvert
96 ===============
97
98 You will need to either put the source repository in your ``$PATH`` or symlink
99 the ``nbconvert.py`` script to a directory in your ``$PATH``, e.g.::
100
101 $ ln -s /usr/local/bin/nbconvert "$PWD/nbconvert.py"
102
103 Once this is done, you can call it as::
104
105 $ nbconvert <FORMAT> notebook.ipynb
106
107 Use ``nbconvert -h`` for up to date help on the available formats.
108
General Comments 0
You need to be logged in to leave comments. Login now