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

IPython versions of chapters #8

Closed
Robinlovelace opened this issue Mar 2, 2022 · 9 comments
Closed

IPython versions of chapters #8

Robinlovelace opened this issue Mar 2, 2022 · 9 comments

Comments

@Robinlovelace
Copy link
Contributor

  • You can convert from qmd to ipynb with quarto convert test.qmd
  • Should we do that automatically in the CI?
  • Plan: have unevaluated ipynb versions of every chapter to be format agnostic and as accessible as possible
  • May make it easier when making Binder
@michaeldorman
Copy link
Collaborator

Maybe it's obvious but just to note - quarto convert test.qmd should already result in an unevaluated .ipynb file, because the qmd does not store any output.

No idea how to do the conversion in the CI, you have much more experience with that :-)

In any case, once we have the ipynb files, we only need to add a link to download the respective ipynb file in each chapter's header.

@Robinlovelace
Copy link
Contributor Author

For reference: mwouts/jupytext#202 (comment) can go to .py and quarto convert can go to .ipynb. See quarto-dev/quarto-cli#389 also.

@Robinlovelace
Copy link
Contributor Author

This is now done, as can be seen in this commit that was pushed on actions: 4e7d8c9

Question is: where to put the content? I guess the code will be well placed in a code (or code/chapters?) folder but what about the .ipynb files, a ipynb folder? Thoughts on these questions please...

@michaeldorman
Copy link
Collaborator

Sounds great to me, there could be an ipynb folder with .ipynb versions of the chapters (which can be created with quarto convert *.qmd

@michaeldorman
Copy link
Collaborator

I'm seeing that there are .ipynb files in the main directory, should they be moved to an ipynb directory? Otherwise it may be confusing, which ones are the source, qmd or ipynb?

@Robinlovelace
Copy link
Contributor Author

I'm seeing that there are .ipynb files in the main directory, should they be moved to an ipynb directory? Otherwise it may be confusing, which ones are the source, qmd or ipynb?

Agreed. Can be changed in the yml GitHub workflow file.

@Robinlovelace
Copy link
Contributor Author

Same with the .Py files which can go in code or code/chapters directory right? Put there as a proof of concept.

@Robinlovelace
Copy link
Contributor Author

Problem: the data folder doesn't exist in the ipynb or python directories. Proposed solution: download and unzip a folder containing the input data if it doesn't exist, e.g. using solutions mentioned here: https://stackoverflow.com/questions/9419162/download-returned-zip-file-from-url

@Robinlovelace
Copy link
Contributor Author

Closed in fe5c344 and other commits above. Any follow-up comments on how we've done this and where to keep the files, welcome!

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