镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 14:36:48 +00:00
代码高亮开关
这个提交包含在:
@@ -24,6 +24,9 @@ else:
|
|||||||
# 对话窗的高度
|
# 对话窗的高度
|
||||||
CHATBOT_HEIGHT = 1115
|
CHATBOT_HEIGHT = 1115
|
||||||
|
|
||||||
|
# 代码高亮
|
||||||
|
CODE_HIGHLIGHT = True
|
||||||
|
|
||||||
# 窗口布局
|
# 窗口布局
|
||||||
LAYOUT = "LEFT-RIGHT" # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局)
|
LAYOUT = "LEFT-RIGHT" # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局)
|
||||||
|
|
||||||
|
|||||||
6
theme.py
6
theme.py
@@ -1,5 +1,6 @@
|
|||||||
import gradio as gr
|
import gradio as gr
|
||||||
|
from toolbox import get_conf
|
||||||
|
CODE_HIGHLIGHT, = get_conf('CODE_HIGHLIGHT')
|
||||||
# gradio可用颜色列表
|
# gradio可用颜色列表
|
||||||
# gr.themes.utils.colors.slate (石板色)
|
# gr.themes.utils.colors.slate (石板色)
|
||||||
# gr.themes.utils.colors.gray (灰色)
|
# gr.themes.utils.colors.gray (灰色)
|
||||||
@@ -155,7 +156,8 @@ advanced_css = """
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
advanced_css += """
|
if CODE_HIGHLIGHT:
|
||||||
|
advanced_css += """
|
||||||
.hll { background-color: #ffffcc }
|
.hll { background-color: #ffffcc }
|
||||||
.c { color: #3D7B7B; font-style: italic } /* Comment */
|
.c { color: #3D7B7B; font-style: italic } /* Comment */
|
||||||
.err { border: 1px solid #FF0000 } /* Error */
|
.err { border: 1px solid #FF0000 } /* Error */
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户