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

Adds dejavu #1599

Merged
merged 7 commits into from Jul 19, 2021
Merged

Adds dejavu #1599

merged 7 commits into from Jul 19, 2021

Conversation

marimeireles
Copy link
Contributor

@marimeireles marimeireles commented Jun 29, 2021

This is the first PR to introduce the Dejavu feature.
Dejavu intends to be a tool to facilitate for the Jupyter user to generate static pdf outputs for their notebooks mimicking the behavior of voilà. So, with one command line you get all the presets configured for you, generating a pdf presentation:

jupyter dejavu notebook.ipynb

I'm trying to mimic voila's results with this. For future PRs we'll probably have to change or add a new template configuration so we can have a correct pagination.
Please let me know what you think of it!

cc: @SylvainCorlay

@marimeireles
Copy link
Contributor Author

I also have an example notebook in case you're interested in starting an example session. =)

Copy link
Contributor

@MSeal MSeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! So the intend is to mimic voila default behavior? Should we make this a template extension of reveal rather than a new App to avoid command confusion maybe?

@SylvainCorlay @maartenbreddels would like your input

@SylvainCorlay
Copy link
Member

Voilà is really just nbconvert + live kernel and widgets except that by default, inputs and prompt numbers are hidden.

The goal of déjàvu is to provide a shortcut for nbconvert that has the same defaults as Voilà.

TemplateExporter.exclude_input = True            # Hide inputs
TemplateExporter.exclude_output_prompt = True    # Hide prompts
TemplateExporter.exclude_input_prompt = True     # Hide prompts
ExecutePreprocessor.enabled = True               # Execute notebook
WebPDFExporter.paginate = False                  # Prevent WebPDF pagination

We could not make it an alias because one should be able to overwrite these options (like in the case of Voilà).

I am not sure if we should default to HTML or WebPDF.

@marimeireles
Copy link
Contributor Author

I am not sure if we should default to HTML or WebPDF.

So Sylvain and I were talking about this and we got in an agreement that's better to generate an html file so it exhibits the exact same result as voila. Even though pdf seems like a more useful format it produces a different less elegant result than when converted to html.

Copy link
Contributor

@MSeal MSeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright sounds reasonable to me. There's a doc build issue seems unrelated to this PR. There's been some issues with the new version of Sphinx that were unresolved last time I checked that we were working around.

@MSeal MSeal merged commit 14e3ab6 into jupyter:main Jul 19, 2021
@marimeireles
Copy link
Contributor Author

Thanks @MSeal, soon I'll also be publishing a blog post that talks a bit about it + nbconvert! :)

@MSeal
Copy link
Contributor

MSeal commented Jul 20, 2021

Great! I think if we can also address #1401 this week we should do a patch release with the changes this weekend so they're available to others.

@jasongrout jasongrout added this to the 6.2 milestone Sep 13, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants