Extension: making an alternate notebook?

I’d like to build an extension that includes a notebook that (1) uses a modified CodeCell and (2) has custom keyboard shortcuts & menus. I’ve extended the CodeCell and now I’d like to put it into a new notebook extension that would be available alongside the official notebook, i.e., I don’t want to overwrite the official notebook.

Right now, I’ve made a copy of the notebook-extension package that I’m installing as an extension alongside the official notebook, but the modified notebook seems to still be entangled with the official notebook through the context menu and shortcuts. I see multiple errors in the console like this:

Shortcut skipped due to collision. {command: "notebook:change-cell-to-code", keys: Array(1), selector: ".jp-Notebook:focus"}

I can’t seem to find where these commands are defined. I see those strings in the context menu additions and the schema, but modifying the strings to “modifiednotebook:change-cell-to-code” doesn’t seem to help.

My questions:

  1. How do I modify the shortcuts & commands for the new notebook without changing anything for the original notebook, and

  2. Is this the right approach to create a new parallel notebook, or is there a better way to inherit from the official notebook extension?

1 Like