These are chat archives for ipython/ipython

12th
Jun 2015
Matthias Bussonnier
@Carreau
Jun 12 2015 00:56
:-)
@jdfreder
the type of Promise.resolve(comm)
is Comm not Promise<Comm> or is it ?
Thomas Kluyver
@takluyver
Jun 12 2015 01:01
IIRC it's Promise<Comm>
Jonathan Frederic
@jdfreder
Jun 12 2015 17:20
It's Promise<Comm> definitely
Jessica B. Hamrick
@jhamrick
Jun 12 2015 17:20
Yay I have nbgrader docs up on RTD now too! http://nbgrader.readthedocs.org/en/latest/index.html
@ellisonbg @jdfreder I know you are working on some docs infrastructure and I figured some stuff out in the process of building the nbgrader docs that might be helpful
In particular, I needed to be able to include raw html files as examples notebooks (e.g. see the example links in http://nbgrader.readthedocs.org/en/latest/user_guide/03_generating_assignments.html )
Which isn’t super straightforward to do with sphinx out of the box but I managed to figure out a way to make it work
Jonathan Frederic
@jdfreder
Jun 12 2015 17:27
How?
Jessica B. Hamrick
@jhamrick
Jun 12 2015 17:42
You can set the html_extra_files variable in the sphinx conf.py
And it will copy those files directly to the root of the build directory
So if you use nbconvert to convert the notebooks to html and the save them to a new directory in source (e.g. source/extra_files) in the hierarchy that you want them, and then tell sphinx about that location, it will copy them over for you
Then, I wanted to be able to link to the notebooks normally, so I additionally added a hacky regexp to replace links ending with .ipynb to .html after converting notebooks to .rst
(There is probably a better way to do that with a filter or something)
So the entire setup I ended up having is:
Min RK
@minrk
Jun 12 2015 17:45
Yeah, a filter to do it during nbconvert shouldn't be too bad.
Jessica B. Hamrick
@jhamrick
Jun 12 2015 17:46
Set up a “docs” build on travis, which converts the .ipynb files that are documentation to .rst, and also converts the example notebooks to .html and places them in the appropriate location. It then commits all these changes to the docs branch in the nbgrader repo and pushes. RTD then builds off of the docs branch and doesn’t really have to do much heavy lifting itself since all the notebooks have already been converted to the appropriate .html/.rst form
Min RK
@minrk
Jun 12 2015 17:47
Probably the best thing is a hook into mistune, so it easily operates only on links, but I don't think that's as easy with nbconvert config.
Jessica B. Hamrick
@jhamrick
Jun 12 2015 17:49
Can mistune convert to rst? It looks to me like the markdown to rst conversion is being done with pandoc
Min RK
@minrk
Jun 12 2015 17:54
oh, right. No.
But I thought you were doing the replacement on HTML?
Jessica B. Hamrick
@jhamrick
Jun 12 2015 18:02
No — it’s that there are notebooks as docs (which get converted to rst) which link to example notebooks (which get converted to html), so the links in the rst files need to point to html files rather than ipynb files
Min RK
@minrk
Jun 12 2015 18:03
ah, I see. Thank.
Thomas Kluyver
@takluyver
Jun 12 2015 21:24
Does anyone know of any code using the This traitlet type? I can't see any, but it's rather hard to search for.
Sylvain Corlay
@SylvainCorlay
Jun 12 2015 21:33
no idea. Althoughthe docstring is a bit mysterious
Min RK
@minrk
Jun 12 2015 21:48
I'm not aware of any, but I have a vague recollection that @ssanderson might.
Scott Sanderson
@ssanderson
Jun 12 2015 21:48
I don't think I'm using This. I've used ForwardDeclaredInstance/ForwardDeclaredType for a few miscellaneous side-projects
I was using them at oine point to express links in DockORM
Min RK
@minrk
Jun 12 2015 21:49
ok
That's probably what I'm remembering.
Scott Sanderson
@ssanderson
Jun 12 2015 21:49
apparently they rely on the same machinery that made @takluyver want to kill This though...
FWIW, I'm not deeply attached to that functionality. It makes it slightly nicer to express recursive data structure constraints with Traitlets, but that's a fairly niche use-case, and you can get around it with Instance + some manual string-hackery