kynan / nbstripout

strip output from Jupyter and IPython notebooks
Other
1.19k stars 94 forks source link

`git config filter.nbstripout.extrakeys ` support for `attachments`? #187

Closed ystoneman closed 6 months ago

ystoneman commented 9 months ago

It seems like when I run the following command in my project directory:

git config filter.nbstripout.extrakeys '
  metadata.celltoolbar
  metadata.kernelspec
  metadata.language_info.codemirror_mode.version
  metadata.language_info.pygments_lexer
  metadata.language_info.version
  metadata.toc
  metadata.notify_time
  metadata.varInspector
  cell.metadata.heading_collapsed
  cell.metadata.hidden
  cell.metadata.code_folding
  cell.metadata.tags
  cell.metadata.init_cell
  attachments
  metadata'

attachments and metadata changes still show up in my git diff on my .ipynb file:

Like:

  "cells": [
   {
-   "attachments": {},
    "cell_type": "markdown",

and

    "cell_type": "markdown",
    "id": "c6c14d81-e230-4a7b-bb9c-6aae36d23740",
-   "metadata": {
-    "jp-MarkdownHeadingCollapsed": true
-   },
+   "metadata": {},
    "source": [

Is this not supported by nbstripout yet or do I just need to edit my command somehow?

kynan commented 8 months ago

Only metadata or cell metadata fields are currently supported. You are entirely correct to point out that the documentation is insufficiently clear about this. I'll push a documentation improvement and I'd appreciate if you could let me know if that clarifies.

kynan commented 8 months ago

@ystoneman Does 7b065ef help?

kynan commented 7 months ago

@ystoneman Does the documentation update help? Anything more you think that needs to be done here?

kynan commented 6 months ago

@ystoneman Marking this fixed, please reopen if you disagree :)