代码高亮开关
This commit is contained in:
parent
e371b82ea3
commit
476a174320
@ -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 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user