Skip to content

allow configuring the path of the contents directory - #346

Merged
martinRenou merged 3 commits into
jupyterlite:mainfrom
keewis:contents-dir
Aug 11, 2026
Merged

allow configuring the path of the contents directory#346
martinRenou merged 3 commits into
jupyterlite:mainfrom
keewis:contents-dir

Conversation

@keewis

@keewis keewis commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This is the one remaining issue I have before being able to merge the PR that adds try_examples to the xarray docs.

Basically, I would run sphinx once and then retry again after making changes, and if the first run exited with a non-zero exit code the second run would try to execute all the notebooks in the _contents directory. However, if I were to add _contents to exclude_patterns jupyterlite wouldn't be able to find the notebooks in _contents.

As far as I can tell, changing the path from _contents to _build/contents (or _build/jupyterlite-contents) would always succeed, and wouldn't get confused by exclude_patterns. So what I did was:

  1. make the path configurable
  2. clean up before the next run instead of after the current run

cc @agriyakhetarpal

keewis and others added 3 commits July 28, 2026 14:56
This will make sure that timing problems will never arise, and if the
contents are at `_build/contents` (or rather,
`_build/jupyterlite-contents`) cleaning up after the end of the process
is not really required.
@keewis

keewis commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

reading the configuration docs, what contents refers to is quite confusing... on main there's jupyterlite_contents and jupyterlite_ignore_contents, as well as the hard-coded CONTENT_DIR that possibly is only used for try_examples? If so, I might rename the setting to try_examples_content_dir (or jupyterlite_try_examples_content_dir, not sure).

@agriyakhetarpal agriyakhetarpal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @keewis, sorry about the delay here; it's been conference season for me recently. And I've never gotten around to playing with your xarray PR (as unfortunate as that is, from my end, apologies) :D

My memory also eludes me, but if I remember correctly, the intermediary folder where the notebooks are stored was named contents – which should be something like jupyterlite_contents indeed.

clean up before the next run instead of after the current run

This makes sense to me. We could also escape a bit of this mess and make the intermediary folder a temporary directory per build...

@keewis

keewis commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

no worries, I've found a way to work around any delays: upload a conda package to a custom channel on prefix.dev, then use that until the PR has been resolved.

the intermediary folder where the notebooks are stored was named contents

it was _contents, which was by default adjacent to _build.

We could also escape a bit of this mess and make the intermediary folder a temporary

potentially, but I think it is nice to be able to check the generated notebooks in case anything went wrong. Another option would be to put it by default into _build/contents (or at least, below _build).

@agriyakhetarpal agriyakhetarpal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Yes, let's not touch that any further; I agree with your reasoning to be able to check the notebooks.

I had no clue about uploading conda packages to prefix.dev channels. Looks like this is so much more easier now. Thanks for sharing that tip :)

@agriyakhetarpal agriyakhetarpal added this to the 0.23.0 milestone Aug 6, 2026

@martinRenou martinRenou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@martinRenou
martinRenou merged commit 7daf879 into jupyterlite:main Aug 11, 2026
5 of 6 checks passed
@keewis
keewis deleted the contents-dir branch August 11, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants