jupyter notebook字体、颜色配置
文章目录
- 问题
- 原理
- 解决方案
- 总结
问题
1、Windows系统 jupyter 字体不好看
2、jupyter 原始配色太 low
原理
思考 : 所有的驱动都是由配置文件加载完成,既然MAC可Windows上的效果不一样,那必然是可以设置的
不管安装在哪里,在系统盘一定会有留底,找到了初始化文件原始位置
"C:\Users\用户名\AppData\Roaming\Python\Python310(你的版本)\site-packages\nbclassic\static\components\codemirror\lib\codemirror.css"
ps:这里我是用 pip 安装的 Anaconda3 和 MiniAnaconda3 安装位置不详
解决方案
发现 jupyter 在 static 静态页已经为大家预留了 custom.css 文件可以直接自定义覆盖原始文件,而不会崩溃(血泪教训)
方法1:
修改自定义文件,直接实现配置
C:\Users\用户名\AppData\Roaming\Python\Python310(你的版本)\site-packages\nbclassic\static\custom\custom.css
方法2:
修改原始文件,直接实现配置
问题:我修改后出现了一个小时内核就会崩溃的情况,需要重启,很烦,不建议。
C:\Users\用户名\AppData\Roaming\Python\Python310(你的版本)\site-packages\nbclassic\static\components\codemirror\lib\codemirror.css
总结
建议大家去修改 custom.css 来自定义实现自己想要的,不会影响本身
这里我放我自己使用的效果, 我在里面加了一些注释,标注配置的地方
我只修改了 MD 和CELL 内部的样式,外部一样的都是圆滑字了,就看不清楚了,没设置
全部复制到 custom.css 即可
/* BASICS 基础设置 */.CodeMirror {/* Set height, width, borders, and global font properties here */font-family: 'Bahnschrift Light Condensed','隶书','Microsoft YaHei UI'; /*华文新魏,华文楷体,monospace;*/height: 300px;color: black;direction: ltr;
}/* PADDING 边缘 */.CodeMirror-lines {padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {padding: 0 4px; /* Horizontal padding of content */
}.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {background-color: white; /* The little square between H and V scrollbars */
}/* GUTTER */.CodeMirror-gutters {border-right: 1px solid #ddd;background-color: #f7f7f7;white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {padding: 0 3px 0 5px;min-width: 20px;text-align: right;color: #999;white-space: nowrap;
}.CodeMirror-guttermarker { color: black; }
.CodeMirror-guttermarker-subtle { color: #999; }/* CURSOR */.CodeMirror-cursor {border-left: 1px solid black;border-right: none;width: 0;
}
/* Shown when moving in bi-directional text 在双向文本中移动时显示 */
.CodeMirror div.CodeMirror-secondarycursor {border-left: 1px solid silver;
}
.cm-fat-cursor .CodeMirror-cursor {width: auto;border: 0 !important;background: #7e7;
}
.cm-fat-cursor div.CodeMirror-cursors {z-index: 1;
}
.cm-fat-cursor-mark {background-color: rgba(20, 255, 20, 0.5);-webkit-animation: blink 1.06s steps(1) infinite;-moz-animation: blink 1.06s steps(1) infinite;animation: blink 1.06s steps(1) infinite;
}
.cm-animate-fat-cursor {width: auto;border: 0;-webkit-animation: blink 1.06s steps(1) infinite;-moz-animation: blink 1.06s steps(1) infinite;animation: blink 1.06s steps(1) infinite;background-color: #7e7;
}
@-moz-keyframes blink {0% {}50% { background-color: transparent; }100% {}
}
@-webkit-keyframes blink {0% {}50% { background-color: transparent; }100% {}
}
@keyframes blink {0% {}50% { background-color: transparent; }100% {}
}/* Can style cursor different in overwrite (non-insert) mode 在覆盖(非插入)模式下,光标的样式可以不同*/
.CodeMirror-overwrite .CodeMirror-cursor {}.cm-tab { display: inline-block; text-decoration: inherit; }.CodeMirror-rulers {position: absolute;left: 0; right: 0; top: -50px; bottom: 0;overflow: hidden;
}
.CodeMirror-ruler {border-left: 1px solid #ccc;top: 0; bottom: 0;position: absolute;
}/* DEFAULT THEME 默认主题*/.cm-s-default .cm-header {color: brown;} /* MD标题颜色 */
.cm-s-default .cm-quote {color: #090;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #c17406;} /*#164*/
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
.cm-s-default .cm-comment {color: #a50;} /* 注释颜色 */
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;} /* 元组颜色 */
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;} /* 括号颜色 */
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #0074cc;} /*原始:#00c*/.cm-s-default .cm-error {color: #ff4900;} /*原始:#f00*/
.cm-invalidchar {color: #f00;}.CodeMirror-composing { border-bottom: 2px solid; }/* Default styles for common addons */div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}/* STOP *//* The rest of this file contains styles related to the mechanics ofthe editor. You probably shouldn't touch them. */.CodeMirror {position: relative;overflow: hidden;background: white;
}.CodeMirror-scroll {overflow: scroll !important; /* Things will break if this is overridden *//* 50px is the magic margin used to hide the element's real scrollbars *//* See overflow: hidden in .CodeMirror */margin-bottom: -50px; margin-right: -50px;padding-bottom: 50px;height: 100%;outline: none; /* Prevent dragging from highlighting the element */position: relative;
}
.CodeMirror-sizer {position: relative;border-right: 50px solid transparent;
}/* The fake, visible scrollbars. Used to force redraw during scrollingbefore actual scrolling happens, thus preventing shaking andflickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {position: absolute;z-index: 6;display: none;outline: none;
}
.CodeMirror-vscrollbar {right: 0; top: 0;overflow-x: hidden;overflow-y: scroll;
}
.CodeMirror-hscrollbar {bottom: 0; left: 0;overflow-y: hidden;overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {right: 0; bottom: 0;
}
.CodeMirror-gutter-filler {left: 0; bottom: 0;
}.CodeMirror-gutters {position: absolute; left: 0; top: 0;min-height: 100%;z-index: 3;
}
.CodeMirror-gutter {white-space: normal;height: 100%;display: inline-block;vertical-align: top;margin-bottom: -50px;
}
.CodeMirror-gutter-wrapper {position: absolute;z-index: 4;background: none !important;border: none !important;
}
.CodeMirror-gutter-background {position: absolute;top: 0; bottom: 0;z-index: 4;
}
.CodeMirror-gutter-elt {position: absolute;cursor: default;z-index: 4;
}
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }.CodeMirror-lines {cursor: text;min-height: 1px; /* prevents collapsing before first draw */
}
.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {/* Reset some styles that the rest of the page might have set 重置页面其余部分可能设置的某些样式*/-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;border-width: 0;background: transparent;font-family: Consolas, '隶书';/*"PingFangSC-Medium", "Microsoft YaHei";*//*font-family: inherit;*/font-size: inherit;margin: 0;white-space: pre;word-wrap: normal;line-height: inherit;color: inherit;z-index: 2;position: relative;overflow: visible;-webkit-tap-highlight-color: transparent;-webkit-font-variant-ligatures: contextual;font-variant-ligatures: contextual;
}
.CodeMirror-wrap pre.CodeMirror-line,
.CodeMirror-wrap pre.CodeMirror-line-like {word-wrap: break-word;white-space: pre-wrap;word-break: normal;
}.CodeMirror-linebackground {position: absolute;left: 0; right: 0; top: 0; bottom: 0;z-index: 0;
}.CodeMirror-linewidget {position: relative;z-index: 2;padding: 0.1px; /* Force widget margins to stay inside of the container */
}.CodeMirror-widget {}.CodeMirror-rtl pre { direction: rtl; }.CodeMirror-code {outline: none;
}/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {-moz-box-sizing: content-box;box-sizing: content-box;
}.CodeMirror-measure {position: absolute;width: 100%;height: 0;overflow: hidden;visibility: hidden;
}.CodeMirror-cursor {position: absolute;pointer-events: none;
}
.CodeMirror-measure pre { position: static; }div.CodeMirror-cursors {visibility: hidden;position: relative;z-index: 3;
}
div.CodeMirror-dragcursors {visibility: visible;
}.CodeMirror-focused div.CodeMirror-cursors {visibility: visible;
}.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }.cm-searching {background-color: #ffa;background-color: rgba(255, 255, 0, .4);
}/* Used to force a border model for a node 用于强制节点的边界模型 */
.cm-force-border { padding-right: .1px; }@media print {/* Hide the cursor when printing */.CodeMirror div.CodeMirror-cursors {visibility: hidden;}
}/* See issue #2901 */
.cm-tab-wrap-hack:after { content: ''; }/* Help users use markselection to safely style text background */
/* 帮助用户使用标记选择安全设置文本背景样式 */
span.CodeMirror-selectedtext { background: none; }
如果有人知道代码块怎么自动换行告诉我一声
jupyter notebook字体、颜色配置相关推荐
- jupyter notebook界面颜色jt_更改jupyter notebook主题颜色——步骤详解(Windows系统)...
问题提出:在用jupyter notebook时,其默认主题颜色为白色,长时间编程比较费眼,寻求可以改变jupyter notebook主体颜色的解决方案. 适用系统:Windows8 解决方案:使用 ...
- Visual Studio 2019字体颜色配置
比较喜欢的Visual Studio字体和颜色配置 本人用的是visual studio 2019版,字体和颜色配置方法是通用的: 工具-->选项-->环境:字体和颜色 字体 浅色背景,C ...
- 关于Jupyter Notebook的环境配置
目录 1.jupyter notebook更换默认目录 2.jupyter notebook配置虚拟Python环境 1.jupyter notebook更换默认目录 第一步,在CMD下使用下面的 ...
- secureCRT字体颜色配置
一.设置字体颜色 1 配置背景颜色 2 设置字体颜色 3 设置目录的颜色 4 设置具有写文件夹的背景颜色 5 设置压缩文件颜色 6 可执行文件颜色 7 设置图片文件字体颜色 8 设置软连接字体颜色 二 ...
- idea浅色主题及代码字体颜色配置
按照变量类型,方法,类等 用不同的颜色表示:阅读代码更清晰
- jupyter notebook / jupyter lab 深色主题下如何设置字体 及 如何设置绘图颜色
在安装了jupyter notebook / jupyter lab及其深色主题之后,需要进一步设置字体,和设置绘图的颜色.否则看起来界面会比较奇怪. 本文针对这几个问题作一些说明. 文章目录 1. ...
- jupyter notebook简明安装、配置、使用教程
1.jupyter notebook 安装 1.1 通过pip安装所需套件 pip3 install requests pip3 install BeautifulSoup4 pip3 install ...
- jupyter notebook配置
在装完jupyter notebook后可以配置一下notebook,可以设置密码,一些个性化设置. 产生配置文件 jupyter notebook --generate-configWriting ...
- Jupyter notebook 配置无问题 但就是无法远程访问,解决方法
关于Jupyter notebook远程访问的配置我就在这赘述了. 配置好之后可能还是访问不了!这时候需要建立个通道 ssh root@47.94.*.* -L127.0.0.1:1234:127.0 ...
最新文章
- Vitis-AI集成
- 【Android 性能优化】应用启动优化 ( 安卓应用启动分析 | Launcher 应用启用普通安卓应用 | 应用进程分析 )
- ios打包ipa的四种实用方法
- 屌丝逆袭高富帅之JAVA之路
- 计算机组成原理答案郑秋梅,计算机组成原理-郑秋梅_习题.docx
- inovance变频器说明书参数设置_变频器控制电机速度时,面板调速如何切换为电位器调速...
- 错误MSB4018 “ResolvePackageAssets”任务意外失败的解决方法
- 读《活着》----余华
- linux安装c++版本eclipse以及编译增加指定库
- C++——如何理解.h文件和.cpp文件
- php上传图片到远程服务器并返回图片地址到本地显示
- php引擎,php基于什么引擎
- 谈一谈我对于目前国人对于EXTJS的错误看法
- inotify+rsync实时双向同步文件
- linux 脚本map,shell中map的用法
- 实现类似shared_ptr的引用计数
- 运算放大器单电源设计
- WRF-Chem笔记——MOZBC边界场制作
- php 文字动画,CSS3绘制2018新年快乐文字动画特效
- 一文解读电压放大器(电压放大器原理)