kynan / nbstripout

strip output from Jupyter and IPython notebooks
Other
1.21k stars 95 forks source link

custom blacklist metadata fields #92

Closed casperdcl closed 5 years ago

casperdcl commented 5 years ago

Complements #86

This is configurable via git config (--global) filter.nbstripout.extrakeys. An example would be:

git config --global filter.nbstripout.extrakeys \
  'metadata.toc cell.metadata.heading_collapsed cell.metadata.hidden cell.metadata.code_folding'
kynan commented 5 years ago

Python 3 tests are failing now, however I can't quite see how that's related to your changes.

dnhuizen commented 5 years ago

This is a much needed feature, thanks for jumping on this: With Papermill gaining in popularity it is great to be able to strip out Papermill related metadata

casperdcl commented 5 years ago

OK @kynan @dnhuizen I think this is ready for merge. Should really bump the version number when that's done.

kynan commented 5 years ago

Thanks for your contribution!

amard33p commented 4 years ago

Is it possible to filter the key nbformat_minor with this feature?

kynan commented 4 years ago

@amard33p yes, should be. Is this a per-cell key? A "global" key?

amard33p commented 4 years ago

@amard33p yes, should be. Is this a per-cell key? A "global" key?

Not sure about that...but you can see it in the diff here: https://github.com/kynan/nbstripout/issues/110#issuecomment-580836467

kynan commented 4 years ago

Turns out nbformat_minor is actually a "top level" key and required, so stripping it would likely break the notebook.