Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nbconvert ipynb -> rst, via makefile support #579

Closed
arsenovic opened this issue Dec 14, 2013 · 6 comments
Closed

nbconvert ipynb -> rst, via makefile support #579

arsenovic opened this issue Dec 14, 2013 · 6 comments

Comments

@arsenovic
Copy link

some pages of my docs are made by converting ipython notebook files (ipynb) to rst.

so, the notebooks are in the git repo, and make is used to trigger the conversion to rst before sphinx build is called, ie the rst files are not committed.

is there a way to do this on RTD?

@arsenovic
Copy link
Author

Here is the Makefile directive i use to run and convert ipython notebooks to reST (followed by some minor sedding).

notebooks:
 for file in ./source/tutorials/*.ipynb; do\
   runipy -q --pylab -o $$file;\
 done
 cd ./source/tutorials;ipython nbconvert --to rst *.ipynb
 sed -i 's/``/`/g' ./source/tutorials/*.rst

I suspect that a lot of projects will start using ipython notebook-based docs, because of their ease.

a conversation about this can be found here
http://python.6.x6.nabble.com/IPython-User-usage-of-notebooks-in-sphinx-td5041731.html

@wraithan
Copy link
Contributor

We currently don't support make files, when we change our build system in
the future we likely will. Until then things like this either need to be
called out in your conf.py (since it is loaded before your docs are built)
or better yet, turned into a sphinx extension that will teach it to use
ipython stuff as a library rather than using the commandline interface. I
don't know if ipython offers as a library support but that is the direction
I'd try to go in before doing the conf.py hack.

On Fri, Dec 20, 2013 at 9:03 AM, alex arsenovic notifications@github.comwrote:

Here is the Makefile directive i use to run and convert ipython notebooks
to reST (followed by some minor sedding).

notebooks:
for file in ./source/tutorials/.ipynb; do
runipy -q --pylab -o $$file;
done
cd ./source/tutorials;ipython nbconvert --to rst *.ipynb
sed -i 's/``/`/g' ./source/tutorials/
.rst

I suspect that a lot of projects will start using ipython notebook-based
docs, because of their ease.

a conversation about this can be found here

http://python.6.x6.nabble.com/IPython-User-usage-of-notebooks-in-sphinx-td5041731.html


Reply to this email directly or view it on GitHubhttps://github.com//issues/579#issuecomment-31024516
.

@arsenovic
Copy link
Author

ok. there is a ipython notebook directive, which is described in the above nabble link.
however, that directive translates from ipynb-> html, so a lot of the things like css styling and cross-references dont work.
so.. i went with a hack in the conf.py for the time being.

however the ipython nbconvert requires pandoc which is not in pypi (its not a python package.)

is it possible to install this on RTD?

ericholscher added a commit that referenced this issue Jan 2, 2014
@ericholscher
Copy link
Member

Pandoc should now be on the build server.

@arsenovic
Copy link
Author

great !

i just ran into a similar problem. i would like to use more recent features of matplotlib than are provided by any release. i put a git line in the pip requirements
-e git://github.com/matplotlib/matplotlib.git#egg=matplotlib

but installing matplotlib from source requires more libraries outside of python, http://matplotlib.org/users/installing.html.

im not sure what the correct solution is...

@arsenovic
Copy link
Author

actually please ignore this last post. i was incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants