Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegexRemovePreprocessor not working with notebook output format #895

Open
DrDrij opened this issue Oct 10, 2018 · 2 comments
Open

RegexRemovePreprocessor not working with notebook output format #895

DrDrij opened this issue Oct 10, 2018 · 2 comments
Labels
format:Notebook pertains to exporting to the Notebook format Preprocessor:RegexRemove

Comments

@DrDrij
Copy link

DrDrij commented Oct 10, 2018

It appears the RegexRemovePreprocessor works with default output HTML, however, ignored when using -- to notebook

https://github.com/jupyter/nbconvert/blob/master/nbconvert/preprocessors/regexremove.py

Works correctly:

jupyter nbconvert --RegexRemovePreprocessor.patterns="['pattern']" file.ipynb
[NbConvertApp] Converting notebook file.ipynb to html
[NbConvertApp] Writing 275715 bytes to file.html

Creates duplicate notebook file:

jupyter nbconvert --to notebook --RegexRemovePreprocessor.patterns="['pattern']" file.ipynb
[NbConvertApp] WARNING | Config option `template_path` not recognized by `NotebookExporter`.
[NbConvertApp] Converting notebook file.ipynb to notebook
[NbConvertApp] Writing 20390 bytes to file.nbconvert.ipynb
@BKJackson
Copy link

I'm receiving the same warning when I try to clear notebook cell output

$ jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace $file
...
[NbConvertApp] WARNING | Config option `template_path` not recognized by `NotebookExporter`.

Does the jupyter_nbconvert_config.json file need to be changed? It shows the following:

{
  "Exporter": {
    "preprocessors": [
      "jupyter_contrib_nbextensions.nbconvert_support.CodeFoldingPreprocessor",
      "jupyter_contrib_nbextensions.nbconvert_support.PyMarkdownPreprocessor"
    ],
    "template_path": [
      ".",
      "~/Applications/miniconda3/envs/py36/lib/python3.6/site-packages/jupyter_contrib_nbextensions/templates",
      "~/Applications/miniconda3/envs/py35cycle/lib/python3.5/site-packages/jupyter_contrib_nbextensions/templates"
    ]
  },
  "version": 1
}

@BKJackson
Copy link

Update: Removing the "template_path" section from the jupyter_nbconvert_config.json file made the warning go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:Notebook pertains to exporting to the Notebook format Preprocessor:RegexRemove
Projects
None yet
Development

No branches or pull requests

3 participants