Comments (5)
This extension is outdated. Thanks for bringing this up.
Try adding this to you custom.js
file:
var add_edit_shortcuts = {
'Alt-c' : {
help : 'toggle comments',
help_index : 'eb',
handler : function (event) {
var cm=IPython.notebook.get_selected_cell().code_mirror
var from = cm.getCursor("start"), to = cm.getCursor("end");
cm.uncomment(from, to) || cm.lineComment(from, to);
return false;
}
},
};
IPython.keyboard_manager.edit_shortcuts.add_shortcuts(add_edit_shortcuts);
from jupyter_contrib_nbextensions.
Thanks for looking this up. I tried your suggestion, but I stll get errors on the console:
Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead jquery.min.js:1
TypeError: IPython.keyboard_manager is undefined custom.js:123
"Default extension for cell metadata editing loaded." default.js:48
"Raw Cell Format toolbar preset loaded." rawcell.js:82
"Slideshow extension for metadata editing loaded." slideshow.js:43
"Session: kernel_created (9fe531c4-50d8-4cb3-943a-e085be4ff18a)" session.js:52
"Starting WebSockets:" "ws://localhost:8888/api/kernels/88c3ab91-e1d0-4655-b1a9-4a7aa7e3e93d" kernel.js:440
"Loaded extension: usability/codefolding/codefolding" utils.js:26
TypeError: string is undefined codemirror.js:7300
Use of getPreventDefault() is deprecated. Use defaultPrevented instead. jquery.min.js:5
"Kernel: kernel_connected (88c3ab91-e1d0-4655-b1a9-4a7aa7e3e93d)" kernel.js:102
"Kernel: kernel_starting (88c3ab91-e1d0-4655-b1a9-4a7aa7e3e93d)" kernel.js:102
"Kernel: kernel_ready (88c3ab91-e1d0-4655-b1a9-4a7aa7e3e93d)" kernel.js:102
from jupyter_contrib_nbextensions.
From your console output, this looks might be related to something else.
Ttry executing the above lines in a notebook cell using:
%%javascript
...
This will execute the cell as javascript code.
from jupyter_contrib_nbextensions.
You're right, it works when executed from a cell. That's something! At least I can enable commenting and uncommenting from within a notebook until I find out what's wrong. Maybe in one of the previous attempts I left something...
Thanks again!
from jupyter_contrib_nbextensions.
I re-created my profile, added the javascript code you posted above to custom.js, and now it's working. One thing, I think, that was getting in the way from the beginning was the IPython's security feature for the notebook. Unless I did something stupid when I checked this, it is only after trusting the notebook I am using that the comment shorcut starts working. I guess I can close this issue now. Thanks for your help
from jupyter_contrib_nbextensions.
Related Issues (20)
- failed building wheel for jupyter_nbextensions_configurator HOT 2
- Endless fail to get nbextensions to appear on M2 Mac HOT 3
- Support for python 3.11 HOT 3
- nbextensions compatibility with notebook-6.5.3. HOT 4
- Error [jupyter_nbextensions_configurator] error loading toggle_all_line_numbers/mainf
- python-markdown new install fails to render {{var}}. Browser error 'TypeError: marked is not a function ' HOT 10
- Is this project on stand-by or near to being abandoned in front of new versions of conda or jupyter notebook? HOT 1
- [collapsible_headings] When using jupyter_server + nbclassic, collapsible headings not working
- Linux installation issues: nbconvert version
- install nbextensions in \site-packages\jupyter_contrib_nbextensions HOT 1
- extensions does not work or only work once
- jupyter_contrib_nbextenions appears to be incompatible with Jupyter Notebook v7. HOT 6
- all the extensions are failed loading HOT 2
- Installation fails on up-to-date JupyterLab installed with `conda -c conda-forge`
- TOC extension is hiding below toolbar HOT 5
- Autoscroll from NBEXTENSIONS not working
- Code Font Size donβt work
- nbextensions conda installation problem HOT 1
- Python markdown not getting variables values
- '"...\MyEnv\Scripts\jupyter-nbextension.exe"' is not recognized as an internal or external command, operable program or batch file.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyter_contrib_nbextensions.