jupyter notebook 美化
简介#
由于 jupyter notebook 的界面不是很好看,所以抽时间折腾了修改了一下。
效果图#
更改方法#
修改 jupyter notebook 以下位置的样式文件:
python根目录/lib/site-packages/notebook/static/custom/custom.css
将样式修改为如下
/*
Placeholder for custom user CSS
mainly to be overridden in profile/static/custom/custom.css
This will always be an empty file
*/
/* body宽度 */
#notebook-container {
width: 100%;
}
/* 头部拉宽 */
#header div#menubar-container,
#header div#header-container {
width: 99%;
padding: 0;
}
/* 代码块和头部之间的距离 */
div#notebook{
padding-top: 0;
}
/* 输入代码框圆角并显示偏向于中间 */
div.input_area {
border-radius: 10px;
width: 93%;
}
/* 消除选中代码块的边框 */
div.cell.selected, div.cell.selected.jupyter-soft-selected {
border: none;
}
/* 给选中代码块的右侧添加左侧相同提示 */
div.cell.selected:after, div.cell.selected.jupyter-soft-selected:after {
position: absolute;
display: block;
top: -1px;
right: -1px;
width: 5px;
height: calc(100% + 2px);
content: '';
background: #42A5F5;
}
/* 输出信息的宽度 */
div.output_area pre {
width: 93%;
}
/* Markdown */
div#notebook {
font-family: san francisco, "PingFangSC-Medium", "Microsoft YaHei";
line-height: 20px;
-webkit-font-smoothing: antialiased !important;
}
div#notebook h1 {
color: #9900ff;
}
div#notebook h2 {
color: #007aff;
}
div#notebook h3 {
color: #ff9900;
}
div#notebook h4 {
color: #ffee00;
}
div#notebook h5 {
color: #00ff2f;
}
/* Markdown - quote */
div#notebook blockquote{
background-color: #f8f8f8;
color: #505050;
padding: 8.5px;
margin: 0.5em -0.5em 0.5em -0.4em;
}
/* Markdown - code in paragraph */
div#notebook p code, div#notebook li code {
font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
font-size: 1em !important;
color: #111111;
border: 0.5px solid #cfcfcf;
border-radius: 2px;
background-color: #f7f7f7;
padding: .1em .2em;
margin: 0px 2px;
}
/* Markdown - code */
div.text_cell_render pre {
border: 1px solid #cfcfcf;
border-radius: 2px;
background: #f7f7f7;
line-height: 1.21429em;
padding: 8.5px;
margin: 0.5em -0.5em 0.5em -0.4em;
}
div.text_cell_render code {
background: #f7f7f7;
}
/* Code */
div.CodeMirror-code {
font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
font-size: 13pt;
line-height: 145%;
-webkit-font-smoothing: antialiased !important;
}
/* Code - output */
div.output pre {
font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
line-height: 20px;
-webkit-font-smoothing: antialiased !important;
}
/* Code - comment */
span.cm-comment {
font-family: san francisco, "PingFangSC-Medium", "Microsoft YaHei" !important;
font-style: normal !important;
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通