How to add syntax highlight to SQL line magic, cell magic and custom command in jupyter notebook? How to add syntax highlight to SQL line magic, cell magic and custom command in jupyter notebook? pandas pandas

How to add syntax highlight to SQL line magic, cell magic and custom command in jupyter notebook?


This will work even for assignments, as in the third cell. Currently multiple languages highlighting unavailable. So it will be either Python or SQL syntax, whatever comes first.

require(['notebook/js/codecell'], function (codecell) {    codecell.CodeCell.options_default.highlight_modes['magic_text/x-mssql'] = { 'reg': [/%?%sql/] };    Jupyter.notebook.events.one('kernel_ready.Kernel', function () {        Jupyter.notebook.get_cells().map(function (cell) {            if (cell.cell_type == 'code') { cell.auto_highlight(); }        });    });});

enter image description here