jupyterlite/demo

Add step to `deploy.yml` Github Action to create `all.json`

psychemedia opened this issue · 7 comments

The current demo is hardwired to use a specific (fixed) all.json config file which itemises the files to be displayed in the file directory listing.

To make this repo more useful as a possible template repo, from which folk can deploy their own notebook seeded demo site, a new all.json file should be created that captures the files to be listed.

There is a fragment of Python code in JupyterLite conf.py that could be split out into a simple CLI command to achieve this: https://github.com/jtpio/jupyterlite/blob/695373748db6c5aa015224e94d4aa8679eb34ef2/docs/conf.py#L142

To make things conventional / easier to identify which files to copy over, it might be worth having something like a content directory into which the notebook files, image files, maybe python files etc etc intended for distribution are placed.

At the moment the Github Action only copies over *.csv and *.ipynb files: https://github.com/jtpio/jupyterlite-demo/blob/98eb9db9c3cd68e10caa0e265d9be38db9ecb30d/.github/workflows/deploy.yml#L28

jtpio commented

Thanks @psychemedia.

Yes absolutely, the jupyterlite tooling will likely improve to make copying content much easier.

Currently briefly mentioned in https://jupyterlite.readthedocs.io/en/latest/configuring.html#adding-content and tracked in https://github.com/jtpio/jupyterlite/issues/41.

jtpio commented

For now there could indeed be another step in the workflow as a temporary solution, until there is proper tooling upstream. This will at least serve as good documentation for folks who want to deploy to GitHub Pages.

Would you like to open a PR to add this step? Thanks!

Yep, will have a go...

Noting that the all.json generator will only list items at the top level of the content/ directory. jupyter_server.services.contents.filemanager.FileContentsManager() doesn't seem to generate a recursive listing of a directory's contents (content of subdirectories etc)?

jtpio commented

Indeed it's not great at the moment. There is a mention to this in https://jupyterlite.readthedocs.io/en/latest/configuring.html#adding-content

image

https://github.com/jtpio/jupyterlite/pull/147 will probably help a lot with this, and deployments in general.

Yeah, having now been down in the weeds for real of getting an arbitrary site to even build, it won't be reasonable to expect stuff like contents, etc. to be manually generated.

I don't yet have nested files under test.

@bollwyvl Ah, independently of your comment, I just added an issue suggesting a demo notebook in a subdir to test / demonstrate that sort of config and path resolution: https://github.com/jtpio/jupyterlite/issues/150