Spaces:
Paused
Paused
Merge branch 'dev' of github.com:binary-husky/chatgpt_academic into dev
Browse files- theme.py +73 -0
- toolbox.py +1 -1
theme.py
CHANGED
@@ -153,4 +153,77 @@ advanced_css = """
|
|
153 |
padding: 1em;
|
154 |
margin: 1em 2em 1em 0.5em;
|
155 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
"""
|
|
|
153 |
padding: 1em;
|
154 |
margin: 1em 2em 1em 0.5em;
|
155 |
}
|
156 |
+
|
157 |
+
|
158 |
+
|
159 |
+
|
160 |
+
.hll { background-color: #ffffcc }
|
161 |
+
.c { color: #3D7B7B; font-style: italic } /* Comment */
|
162 |
+
.err { border: 1px solid #FF0000 } /* Error */
|
163 |
+
.k { color: #008000; font-weight: bold } /* Keyword */
|
164 |
+
.o { color: #666666 } /* Operator */
|
165 |
+
.ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
|
166 |
+
.cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
|
167 |
+
.cp { color: #9C6500 } /* Comment.Preproc */
|
168 |
+
.cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
|
169 |
+
.c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
|
170 |
+
.cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
171 |
+
.gd { color: #A00000 } /* Generic.Deleted */
|
172 |
+
.ge { font-style: italic } /* Generic.Emph */
|
173 |
+
.gr { color: #E40000 } /* Generic.Error */
|
174 |
+
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
175 |
+
.gi { color: #008400 } /* Generic.Inserted */
|
176 |
+
.go { color: #717171 } /* Generic.Output */
|
177 |
+
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
178 |
+
.gs { font-weight: bold } /* Generic.Strong */
|
179 |
+
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
180 |
+
.gt { color: #0044DD } /* Generic.Traceback */
|
181 |
+
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
|
182 |
+
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
|
183 |
+
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
|
184 |
+
.kp { color: #008000 } /* Keyword.Pseudo */
|
185 |
+
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
|
186 |
+
.kt { color: #B00040 } /* Keyword.Type */
|
187 |
+
.m { color: #666666 } /* Literal.Number */
|
188 |
+
.s { color: #BA2121 } /* Literal.String */
|
189 |
+
.na { color: #687822 } /* Name.Attribute */
|
190 |
+
.nb { color: #008000 } /* Name.Builtin */
|
191 |
+
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
|
192 |
+
.no { color: #880000 } /* Name.Constant */
|
193 |
+
.nd { color: #AA22FF } /* Name.Decorator */
|
194 |
+
.ni { color: #717171; font-weight: bold } /* Name.Entity */
|
195 |
+
.ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
|
196 |
+
.nf { color: #0000FF } /* Name.Function */
|
197 |
+
.nl { color: #767600 } /* Name.Label */
|
198 |
+
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
|
199 |
+
.nt { color: #008000; font-weight: bold } /* Name.Tag */
|
200 |
+
.nv { color: #19177C } /* Name.Variable */
|
201 |
+
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
|
202 |
+
.w { color: #bbbbbb } /* Text.Whitespace */
|
203 |
+
.mb { color: #666666 } /* Literal.Number.Bin */
|
204 |
+
.mf { color: #666666 } /* Literal.Number.Float */
|
205 |
+
.mh { color: #666666 } /* Literal.Number.Hex */
|
206 |
+
.mi { color: #666666 } /* Literal.Number.Integer */
|
207 |
+
.mo { color: #666666 } /* Literal.Number.Oct */
|
208 |
+
.sa { color: #BA2121 } /* Literal.String.Affix */
|
209 |
+
.sb { color: #BA2121 } /* Literal.String.Backtick */
|
210 |
+
.sc { color: #BA2121 } /* Literal.String.Char */
|
211 |
+
.dl { color: #BA2121 } /* Literal.String.Delimiter */
|
212 |
+
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
|
213 |
+
.s2 { color: #BA2121 } /* Literal.String.Double */
|
214 |
+
.se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
|
215 |
+
.sh { color: #BA2121 } /* Literal.String.Heredoc */
|
216 |
+
.si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
|
217 |
+
.sx { color: #008000 } /* Literal.String.Other */
|
218 |
+
.sr { color: #A45A77 } /* Literal.String.Regex */
|
219 |
+
.s1 { color: #BA2121 } /* Literal.String.Single */
|
220 |
+
.ss { color: #19177C } /* Literal.String.Symbol */
|
221 |
+
.bp { color: #008000 } /* Name.Builtin.Pseudo */
|
222 |
+
.fm { color: #0000FF } /* Name.Function.Magic */
|
223 |
+
.vc { color: #19177C } /* Name.Variable.Class */
|
224 |
+
.vg { color: #19177C } /* Name.Variable.Global */
|
225 |
+
.vi { color: #19177C } /* Name.Variable.Instance */
|
226 |
+
.vm { color: #19177C } /* Name.Variable.Magic */
|
227 |
+
.il { color: #666666 } /* Literal.Number.Integer.Long */
|
228 |
+
|
229 |
"""
|
toolbox.py
CHANGED
@@ -260,7 +260,7 @@ def markdown_convertion(txt):
|
|
260 |
# cat them together
|
261 |
return pre + convert_stage_2_1 + f'{split}' + convert_stage_2_2 + suf
|
262 |
else:
|
263 |
-
return pre + markdown.markdown(txt, extensions=['fenced_code', 'tables', 'sane_lists']) + suf
|
264 |
|
265 |
|
266 |
def close_up_code_segment_during_stream(gpt_reply):
|
|
|
260 |
# cat them together
|
261 |
return pre + convert_stage_2_1 + f'{split}' + convert_stage_2_2 + suf
|
262 |
else:
|
263 |
+
return pre + markdown.markdown(txt, extensions=['fenced_code', 'codehilite', 'tables', 'sane_lists']) + suf
|
264 |
|
265 |
|
266 |
def close_up_code_segment_during_stream(gpt_reply):
|