From d4befe6964cda95bc42e052723befd83f5b91ad2 Mon Sep 17 00:00:00 2001 From: w_xiaolizu Date: Thu, 15 Jun 2023 12:48:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96isay=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E8=80=83=E8=99=91=E4=BB=A3=E7=A0=81=E5=9D=97=E5=86=85?= =?UTF-8?q?=E6=9C=89```=E5=92=8C=E6=9C=89=E5=88=B6=E8=A1=A8=E7=AC=A6?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5,=20=E4=BC=98=E5=8C=96=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functions/KDOCS_轻文档分析.py | 5 ++++ crazy_functions/crazy_box.py | 5 ++++ docs/assets/custom.css | 5 ++++ theme.py | 3 +++ toolbox.py | 37 +++++++++++++++++++++-------- 5 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 crazy_functions/KDOCS_轻文档分析.py create mode 100644 crazy_functions/crazy_box.py diff --git a/crazy_functions/KDOCS_轻文档分析.py b/crazy_functions/KDOCS_轻文档分析.py new file mode 100644 index 0000000..e186214 --- /dev/null +++ b/crazy_functions/KDOCS_轻文档分析.py @@ -0,0 +1,5 @@ +#! .\venv\ +# encoding: utf-8 +# @Time : 2023/6/15 +# @Author : Spike +# @Descr : \ No newline at end of file diff --git a/crazy_functions/crazy_box.py b/crazy_functions/crazy_box.py new file mode 100644 index 0000000..d01891e --- /dev/null +++ b/crazy_functions/crazy_box.py @@ -0,0 +1,5 @@ +#! .\venv\ +# encoding: utf-8 +# @Time : 2023/6/14 +# @Author : Spike +# @Descr : \ No newline at end of file diff --git a/docs/assets/custom.css b/docs/assets/custom.css index f942c6a..6e53450 100644 --- a/docs/assets/custom.css +++ b/docs/assets/custom.css @@ -8,6 +8,7 @@ --message-bot-background-color-light: #FFFFFF; --message-bot-background-color-dark: #2C2C2C; } + #debug_mes { position: absolute; bottom: 0; @@ -136,6 +137,10 @@ footer { transition: height 0.3s ease; } +span.svelte-1gfkn6j { + background: unset !important; +} + .wrap.svelte-18telvq.svelte-18telvq { padding: var(--block-padding) !important; height: 100% !important; diff --git a/theme.py b/theme.py index 7f42811..30ef8d5 100644 --- a/theme.py +++ b/theme.py @@ -135,6 +135,9 @@ def adjust_theme(): return set_theme +with open("docs/assets/custom.css", "r", encoding="utf-8") as f: + customCSS = f.read() +custom_css = customCSS advanced_css = """ #debug_mes { position: absolute; diff --git a/toolbox.py b/toolbox.py index 98a280e..82c4cf0 100644 --- a/toolbox.py +++ b/toolbox.py @@ -259,19 +259,36 @@ def report_execption(chatbot, history, a, b): def text_divide_paragraph(input_str): - """ - 将文本按照段落分隔符分割开,生成带有段落标签的HTML代码。 - """ if input_str: - code_blocks = re.findall('```.*?```', input_str, re.DOTALL) - for block in code_blocks: - input_str = input_str.replace(block, f'{{{{{{{{{{{code_blocks.index(block)}}}}}}}}}}}') - # 将除了三个反引号之间的文本块以外的 "\n" 替换为 "\n\n" + # 提取所有的代码块 + code_blocks = re.findall(r'```[\s\S]*?```', input_str) - input_str = re.sub(r'(?!```)(?