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

Can I setup the NotebookApp.contents_manager_class using a json diff? #4419

Closed
mwouts opened this issue Feb 22, 2019 · 1 comment
Closed

Comments

@mwouts
Copy link

mwouts commented Feb 22, 2019

Hello here, and thanks for the great work on Jupyter!

Recently I have developed Jupytext, a contents manager for Jupyter, and I would now like to configure Jupyter to use Jupytext' contents manager when Jupytext is installed.

The contents manager works well when I install a etc/jupyter/jupyter_notebook_config.json file with content

{
  "NotebookApp": {
    "contents_manager_class": "jupytext.TextFileContentsManager"
  }
}

But I would much prefer to use the json diff configuration files, and write the same content into etc/jupyter/jupyter_notebook_config.d/jupytext.json. Yet, only the NotebookApp.nbserver_extensions part of these diff files are actually loaded by Jupyter (cf. the code).

I have therefore developed a server extension that replaces the contents manager. What I like in this approach is that the user can choose to enable or disable the server extension with e.g. jupyter serverextension disable jupytext.

But unfortunately, the server extension is loaded a bit too late, and I have to re-run a few of the initialization step of the NotebookApp (code). It works in simple cases, but in others it does not - cf. mwouts/jupytext#185. May I ask therefore if you have a recommendation on how to best offer a defaut (and removable) configuration that activates Jupytext's contents manager?

@mwouts
Copy link
Author

mwouts commented Feb 27, 2019

The current approach in jupytext 1.0.1 seems to work well

  • we change the contents manager to the desired one in a serverextension for jupyter
  • but instead of re-running every init step, we only modify the contents managers, and references to it in other objects, cf. the code

@mwouts mwouts closed this as completed Feb 27, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant