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

Convert jupyter notebook to handout #33

Open
smith01s opened this issue Aug 14, 2019 · 5 comments
Open

Convert jupyter notebook to handout #33

smith01s opened this issue Aug 14, 2019 · 5 comments
Labels

Comments

@smith01s
Copy link

A tool or method to convert an .ipynb file into handout equivalent .py would be great.

@danijar
Copy link
Owner

danijar commented Aug 14, 2019

Good idea. This would allow people to prototype in an interactive environment and switch to Handout once they need something more reproducible or want to run locally. I don't see this as part of the Handout Library, maybe better as an input and output format in nbconvert. What do you think?

@epogrebnyak
Copy link
Contributor

On a sentiment level, Handout is seems to gain ground with people who are using it as lightweight alternative to Jupiter, often as as a one-directional tool.

As for conversion possibility, I think we should take note we might need a bit more formal specification of Handout format, including an internal representation of the report as a list of blocks and some description of script code parsing rules (would be useful for #34 as well).

@danijar
Copy link
Owner

danijar commented Aug 16, 2019

Good point. The formal specification is the API that's described in the readme:

  • Markdown cells translate into triple-quoted comments at top level.
  • Calls to print() translate into doc.add_text() (could be optional).
  • IPython.display.{Image,Video,HTML} translate into doc.add_{image,video,html}().
  • Matplotlib figures translate into doc.add_figure(). I'm not sure what logic Jupyter uses to detect figures and whether this logic is available into nbconvert?
  • The end of a code cell translates into doc.show().

@gdahia
Copy link

gdahia commented Oct 27, 2020

Reviving this thread because I think this would be a very nice feature. Is there anyone working on it?

@epogrebnyak
Copy link
Contributor

epogrebnyak commented Oct 27, 2020 via email

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

No branches or pull requests

4 participants