jckantor / nbpages

Command line tool to maintain a repository of Jupyter notebooks.
https://jckantor.github.io/nbpages/
MIT License
3 stars 4 forks source link

How should --publish handle /data and /figures #34

Closed jckantor closed 4 years ago

jckantor commented 4 years ago

Should there be a destination directory for /data and /figures which, if specified, causes --publish to copy those, too?

jckantor commented 4 years ago

There a few ways this could work. For example, suppose there are data_src_dir and data-dst_dir in nbpages.cfg.

Option 1. If data_dst_dir is specified and different from data_src_dir, then make new copy, overwriting after permission. The user could maintain a second data-private directory if there is data that shouldn't be copied.

Option 2. Add a data-ignore file. Adds complexity, and another file to edit.

jckantor commented 4 years ago

Have now figured out that figures and data should be subdirectories of notebooks folder to enable relative reference of figures and data from notebooks. This has a number of good effects ...

  1. No need to change links to figures when moving from local development to remote hosting of html pages. Figures will display correctly.
  2. When publishing, can omit any figure and data files that are not referenced in the html files.

So --publish now needs to publish html, figures, and data files.

adowling2 commented 4 years ago

I like putting /data and /figures in the /notebook directory. This means a user could use /notebook-sandbox (also containing /figures and /data) to develop notebooks (without them being published).

jckantor commented 4 years ago

This is now implemented. data and figures are now subdirectories of notebooks. Upon publish, only figures which actually appear in the notebooks after stripping tags, etc., are copied to the destination directory. This will be implemented for data, too. So closing this issue.