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

Diff-web output to file #471

Closed
nickurak opened this issue Apr 17, 2019 · 2 comments
Closed

Diff-web output to file #471

nickurak opened this issue Apr 17, 2019 · 2 comments

Comments

@nickurak
Copy link

Apologies if I've missed if this is already an option.

I'd like to be able to output nbdime diff-web to a file, from the command line without a UI.

Specifically, I'm hoping to script out the generation of nbdime diff outputs for each commit in a range -- ie, for a pull request touching notebooks, to show the changes commit-by-commit.

Context:

Changing code is hard, reading code is harder, reading diffs is pretty hard, and reading .ipynb diffs is even harder :) That's why 'nbdime diff' is compelling. Another strategy that helps is to break up even slightly complicated changes in to a series of smaller commits, each of which (as much as possible) do just one atomic thing. Unfortunately it's a little tricky to take advantage of both nbdime diff and a large number of small commits together. That's what's led me to want to script around (headlessly) collecting processed notebook diffs for a sequence of commits.

@vidartf
Copy link
Collaborator

vidartf commented Apr 18, 2019

Hi, and thanks for your feedback!

It is not currently possible to write the HTML output from nbdime-web directly to a file from the CLI. It is definitely a relevant feature request to consider. The current implementation of having a button on the page to save the static HTML was a simple fix for this at the time.

To implement this, two current steps would need to be considered:

  1. Once the diff is calculated, it is sent to the browser as JSON.
  2. The JS code of nbdime is responsible for converting this JSON representation of the diff into HTML DOM (together with the jinja templates used).

As you can see, this current process relies on the browser environment to generate the HTML, which would need to be taken into account if we wanted to be able to generate this directly from the CLI. Not impossible, but a bit of work.

@vidartf
Copy link
Collaborator

vidartf commented Aug 2, 2019

I think this is a duplicate of #468. If you disagree, please comment with what separates the two, and I will reopen.

@vidartf vidartf closed this as completed Aug 2, 2019
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

2 participants