jupyter / help

:sparkles: Need some help or have some questions? Please visit our Discourse page.
https://discourse.jupyter.org
291 stars 97 forks source link

Want to raise a warning if a pre-defined set of code (template) has been changed in a jupyter notebook #429

Open srishtis opened 5 years ago

srishtis commented 5 years ago

I have created an application which uses the jupyter notebook (both R and Python kernels). Now these notebooks have a template of the functions that need to be followed. The user can only write his code within the function body. If the template (name of methods/ classes or any other structural change) is modified, I want to raise a warning or alert. How can I do this?

minrk commented 5 years ago

To do this, you would need an nbextension that looks at change events on the notebook and compares with the template document. This would be written in Javascript.

If it is whole cells that you are after, then it can be a bit easier, because you can mark entire cells with editable: false in metadata, in which case the notebook will not allow editing them.