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

Reduce duplication by including modular text components across notebooks #367

Open
danielfromearth opened this issue Dec 5, 2024 · 1 comment

Comments

@danielfromearth
Copy link

In co-working today, @ateucher, @jules32, @mjami00, and I discussed ways that we might reduce the duplication of text blocks that describe common resources (such as Harmony, earthaccess, Earthdata Search). We started experimenting in the ASDC tutorials repository (nasa/ASDC_Data_and_User_Services#14), and had a few ideas but still some challenges.

@ateucher
Copy link
Member

ateucher commented Dec 5, 2024

From the discussion:

  • If tutorial developers use includes in their .ipynb notebooks, that include code ({{< include _snippets/harmony.qmd >}}) will be visible to people who are working from the notebooks (as the include is rendered when the site is rendered). Users will see this and it might be confusing. And whole point of a Jupyter Notebook is to have text and code together, this approach is breaking that.

  • 3 use cases:

    1. Use during a workshop (user clones repo and works through notebook)
    2. Download .ipynb file and run yourself
    3. Read through rendered page on website - maybe this is most-used case

Use-cases 1&2 will display the include code rather than the content from the file which is to be included.

There is a possible path of writing the tutorial in a .qmd document, and also create a .ipynb file when rendering to html. This requires setting in the yaml header:

format:
   html: default
   ipynb: default

This still has two problems:

  • It is asking tutorial developers to write their tutorials in qmd docs instead of Jupyter notebooks, which is a big change
  • We would need to ensure that the ipynb file is committed in the main branch so that when tutorial participants clone the repo, they can find it. If rendered in an action, would need some intervention to commit it to the main branch... very annoying from a maintenance standpoint.

Writing in .qmd, but using keep-ipynb: true is also an option, but it creates a file with .quarto_ipynb extension, so manual renaming would be necessary...

Relevant issue: quarto-dev/quarto-cli#8533

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