Currently, whenever you create a new cell in an iPython notebook, it defaults to a opening up a cell for Python code. I can then change it to markdown by hitting the keyboard shortcut ctrl m m
Is there any method or any setting I can tweak so that new cells default to being in "markdown mode"?
I did find this question which appears to ask the same thing, but it was erroneously flagged as a duplicate and wasn't answered.
Create New Cells You can change the cell type of any cell in Jupyter Notebook using the Toolbar. The default cell type is Code. To use the Keyboard Shortcuts, hit the esc key. After that, you can change a cell to Markdown by hitting the m key, or you can change a cell to Code by hitting the y key.
Just add <br> where you would like to make the new line.
Enable autocomplete feature To enable code autocomplete in Jupyter Notebook or JupyterLab, you just need to hit the Tab key while writing code. Jupyter will suggest a few completion options. Navigate to the one you want with the arrow keys, and hit Enter to choose the suggestion.
I was just reading the IPython notebook js code, and found the insert_cell_below method at https://github.com/ipython/ipython/blob/master/IPython/html/static/notebook/js/notebook.js#L849 .
If you want to do this programatically, it would simply be a case of doing something like:
from IPython.display import display, Javascript
def markdown_below():
display(Javascript("""
IPython.notebook.insert_cell_below('markdown')
"""));
markdown_below()
This would be fairly early to turn into a button on the toolbar in a similar way to the gist button in https://github.com/minrk/ipython_extensions.
HTH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With