QuantEcon / sphinxcontrib-jupyter

A Sphinx Extension for Generating Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
76 stars 23 forks source link

FEAT: Add slideshow option into the metadata #112

Closed FelipeMaldonado closed 5 years ago

FelipeMaldonado commented 6 years ago

This PR aims to include the slideshow option into the metadata of the Jupyter notebooks (when this option is desired).

jlperla commented 5 years ago

Hi guys, what is the timeline for this functionality?

FelipeMaldonado commented 5 years ago

Hi guys, what is the timeline for this functionality?

Hi,ideally by the end of this week I should have it implemented, I'm still trying to find out the best way to modify the metadata of each cell, probably this will be done through the jupyter directive that we created.

jlperla commented 5 years ago

Perfect, thanks! When you get it up and running, I would love to give it a shot.

FelipeMaldonado commented 5 years ago

Great , I'll let you know.

So far what we have is the activation of the celltoolbar:Slideshow which activate on each cell a drop down menu where you can choose (in the jupyter notebook) the type of slide that you want, the idea is to include that decision directly into the .rst with a command like

.. jupyter::
   :type: Sub-slide
mmcky commented 5 years ago

hey @FelipeMaldonado for the general slide option (enabled through conf.py) I think the easiest approach will be to set the global boolean through the config (see translate_code.py) to self.slide and then check this whenever a cell of type code, markdown etc. is first constructed using nbformat and then append the metadata.

You will need to make amendments to translate_all.py and translate_code.py

or are you referring to control of the slide options for a specific cell (such as sub-slide)? If that is the case then I think we need use:

.. jupyter::
   :slide: sub-slide {slide related options}
FelipeMaldonado commented 5 years ago

Hey @mmcky, I'm talking about a little of both, how is implemented in the translate_code and how we can control it in the .rst. And I believe you're right about the syntax, as we will reserve type for code, markdown,..

FelipeMaldonado commented 5 years ago

@jlperla in the last commit I've made I modified the metadata for each cell setting it by default as a slide, that's working fine, so you could try it now (slideshow.ipynb is the test case). The next goal is using the jupyter directive, change the type of slide to the other available options.

jlperla commented 5 years ago

Sounds great. @arnavs and I can test it once we have the jupyter stuff generated.

FelipeMaldonado commented 5 years ago

@mmcky I was precisely trying to work on that, my idea was activate a boolean value in the .rst for the ones we want with the slideshow option, without affecting the rest. For that I'm using the jupyter directive to have something like

.. jupyter:: :metadata:

that needs to be included at the beginning of the document. I'll tell you if that works.

FelipeMaldonado commented 5 years ago

@mmcky

  1. I followed your suggestion. The current version has the option :slide: enable to activate the slide metadata in the selected notebook.
  2. I added in docs the documentation for the jupyter directive and how to use it with the slide option activated.
mmcky commented 5 years ago

@FelipeMaldonado this PR is looking great. Looking forward to merging.

mmcky commented 5 years ago

@FelipeMaldonado happy for me to review this again today?

FelipeMaldonado commented 5 years ago

@mmcky yes, I did a small modification on Friday, everything should be ok now. After you merge it I'll work with the activation of solutions on top of that.

mmcky commented 5 years ago

thanks @FelipeMaldonado I think this is now ready to be merged.

What do you mean by activation of solutions? Don't follow.

FelipeMaldonado commented 5 years ago

@mmcky a way around to replace :class: solution and the modifications in the conf.py, using just the jupyter directive (can be controlled just from the .rst file).

mmcky commented 5 years ago

just to confirm the solution code isn't in this PR right?

FelipeMaldonado commented 5 years ago

just to confirm the solution code isn't in this PR right?

it isn't (I was working in a separated branch)