python - 如何在 JupyterHub 新环境中高亮 SQL?
问题描述
我正在寻找一种在 Jupyterlab 中突出显示我的 SQL 代码的方法, .
另外,我看到Jupyterlab 提出了一个高级设置编辑器,但我没有找到任何信息。
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(); }
});
});
});
我的环境版本:
jupyter core : 4.6.1
jupyter-notebook : 6.0.0
qtconsole : not installed
ipython : 7.10.1
ipykernel : 5.1.3
jupyter client : 5.3.3
jupyter lab : 1.2.1
nbconvert : 5.6.1
ipywidgets : 7.5.1
nbformat : 4.4.0
traitlets : 4.3.3
有没有办法得到这种结果?用魔法细胞?还是扩展?
另外,我看到Jupyterlab 提出了一个高级设置编辑器
谢谢 !!!
解决方案
推荐阅读
- database - 数据洞察:计算字段显示当前值
- javascript - 尝试使用 JQuery 和 AJAX 提交表单时超出最大调用堆栈大小
- python - 从 api 到 csv 文件的 json 数据问题 - 看到现有答案但不相关
- apache-spark-sql - spark csv输出:获取空引号而不是空格或空格
- javascript - SyntaxError:意外的标识符节点 js
- c++ - 有没有办法从 std::istream 获取 pcl 点云而不是文件名
- excel - CTRL F 函数并引用找到的单元格整行
- wordpress - 无法获取所选类别 - ACF
- docker - Dockerfile Cassandra - /usr/bin/env: 'python3\r': 没有这样的文件或目录
- php - 输出多个数组php(laravel)