qingxu99 commited on
Commit
b6b4ba6
2 Parent(s): 2281a5c 081acc6

Merge branch 'master' into huggingface

Browse files
Files changed (2) hide show
  1. README.md +8 -0
  2. theme.py +179 -68
README.md CHANGED
@@ -11,6 +11,14 @@ pinned: false
11
  ---
12
 
13
  # ChatGPT 学术优化
 
 
 
 
 
 
 
 
14
 
15
  **如果喜欢这个项目,请给它一个Star;如果你发明了更好用的快捷键或函数插件,欢迎发issue或者pull requests**
16
 
 
11
  ---
12
 
13
  # ChatGPT 学术优化
14
+ > **Note**
15
+ >
16
+ > 本项目依赖的Gradio组件的新版pip包(Gradio 3.26~3.27)有严重bug。所以,请在安装时严格选择requirements.txt中**指定的版本**。
17
+ >
18
+ > `pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/`
19
+ >
20
+
21
+ # <img src="docs/logo.png" width="40" > ChatGPT 学术优化
22
 
23
  **如果喜欢这个项目,请给它一个Star;如果你发明了更好用的快捷键或函数插件,欢迎发issue或者pull requests**
24
 
theme.py CHANGED
@@ -137,6 +137,16 @@ advanced_css = """
137
 
138
  /* 行内代码的背景设为淡灰色,设定圆角和间距. */
139
  .markdown-body code {
 
 
 
 
 
 
 
 
 
 
140
  display: inline;
141
  white-space: break-spaces;
142
  border-radius: 6px;
@@ -144,8 +154,19 @@ advanced_css = """
144
  padding: .2em .4em .1em .4em;
145
  background-color: rgba(175,184,193,0.2);
146
  }
 
147
  /* 设定代码块的样式,包括背景颜色、内、外边距、圆角。 */
148
  .markdown-body pre code {
 
 
 
 
 
 
 
 
 
 
149
  display: block;
150
  overflow: auto;
151
  white-space: pre;
@@ -160,72 +181,162 @@ advanced_css = """
160
  if CODE_HIGHLIGHT:
161
  advanced_css += """
162
 
163
- .hll { background-color: #ffffcc }
164
- .c { color: #3D7B7B; font-style: italic } /* Comment */
165
- .err { border: 1px solid #FF0000 } /* Error */
166
- .k { color: hsl(197, 94%, 51%); font-weight: bold } /* Keyword */
167
- .o { color: #666666 } /* Operator */
168
- .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
169
- .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
170
- .cp { color: #9C6500 } /* Comment.Preproc */
171
- .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
172
- .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
173
- .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
174
- .gd { color: #A00000 } /* Generic.Deleted */
175
- .ge { font-style: italic } /* Generic.Emph */
176
- .gr { color: #E40000 } /* Generic.Error */
177
- .gh { color: #000080; font-weight: bold } /* Generic.Heading */
178
- .gi { color: #008400 } /* Generic.Inserted */
179
- .go { color: #717171 } /* Generic.Output */
180
- .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
181
- .gs { font-weight: bold } /* Generic.Strong */
182
- .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
183
- .gt { color: #a9dd00 } /* Generic.Traceback */
184
- .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
185
- .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
186
- .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
187
- .kp { color: #008000 } /* Keyword.Pseudo */
188
- .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
189
- .kt { color: #B00040 } /* Keyword.Type */
190
- .m { color: #666666 } /* Literal.Number */
191
- .s { color: #BA2121 } /* Literal.String */
192
- .na { color: #687822 } /* Name.Attribute */
193
- .nb { color: #e5f8c3 } /* Name.Builtin */
194
- .nc { color: #ffad65; font-weight: bold } /* Name.Class */
195
- .no { color: #880000 } /* Name.Constant */
196
- .nd { color: #AA22FF } /* Name.Decorator */
197
- .ni { color: #717171; font-weight: bold } /* Name.Entity */
198
- .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
199
- .nf { color: #f9f978 } /* Name.Function */
200
- .nl { color: #767600 } /* Name.Label */
201
- .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
202
- .nt { color: #008000; font-weight: bold } /* Name.Tag */
203
- .nv { color: #19177C } /* Name.Variable */
204
- .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
205
- .w { color: #bbbbbb } /* Text.Whitespace */
206
- .mb { color: #666666 } /* Literal.Number.Bin */
207
- .mf { color: #666666 } /* Literal.Number.Float */
208
- .mh { color: #666666 } /* Literal.Number.Hex */
209
- .mi { color: #666666 } /* Literal.Number.Integer */
210
- .mo { color: #666666 } /* Literal.Number.Oct */
211
- .sa { color: #BA2121 } /* Literal.String.Affix */
212
- .sb { color: #BA2121 } /* Literal.String.Backtick */
213
- .sc { color: #BA2121 } /* Literal.String.Char */
214
- .dl { color: #BA2121 } /* Literal.String.Delimiter */
215
- .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
216
- .s2 { color: #2bf840 } /* Literal.String.Double */
217
- .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
218
- .sh { color: #BA2121 } /* Literal.String.Heredoc */
219
- .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
220
- .sx { color: #008000 } /* Literal.String.Other */
221
- .sr { color: #A45A77 } /* Literal.String.Regex */
222
- .s1 { color: #BA2121 } /* Literal.String.Single */
223
- .ss { color: #19177C } /* Literal.String.Symbol */
224
- .bp { color: #008000 } /* Name.Builtin.Pseudo */
225
- .fm { color: #0000FF } /* Name.Function.Magic */
226
- .vc { color: #19177C } /* Name.Variable.Class */
227
- .vg { color: #19177C } /* Name.Variable.Global */
228
- .vi { color: #19177C } /* Name.Variable.Instance */
229
- .vm { color: #19177C } /* Name.Variable.Magic */
230
- .il { color: #666666 } /* Literal.Number.Integer.Long */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  """
 
137
 
138
  /* 行内代码的背景设为淡灰色,设定圆角和间距. */
139
  .markdown-body code {
140
+ display: inline;
141
+ white-space: break-spaces;
142
+ border-radius: 6px;
143
+ margin: 0 2px 0 2px;
144
+ padding: .2em .4em .1em .4em;
145
+ background-color: rgba(13, 17, 23, 0.95);
146
+ color: #c9d1d9;
147
+ }
148
+
149
+ .dark .markdown-body code {
150
  display: inline;
151
  white-space: break-spaces;
152
  border-radius: 6px;
 
154
  padding: .2em .4em .1em .4em;
155
  background-color: rgba(175,184,193,0.2);
156
  }
157
+
158
  /* 设定代码块的样式,包括背景颜色、内、外边距、圆角。 */
159
  .markdown-body pre code {
160
+ display: block;
161
+ overflow: auto;
162
+ white-space: pre;
163
+ background-color: rgba(13, 17, 23, 0.95);
164
+ border-radius: 10px;
165
+ padding: 1em;
166
+ margin: 1em 2em 1em 0.5em;
167
+ }
168
+
169
+ .dark .markdown-body pre code {
170
  display: block;
171
  overflow: auto;
172
  white-space: pre;
 
181
  if CODE_HIGHLIGHT:
182
  advanced_css += """
183
 
184
+ .codehilite .hll { background-color: #6e7681 }
185
+ .codehilite .c { color: #8b949e; font-style: italic } /* Comment */
186
+ .codehilite .err { color: #f85149 } /* Error */
187
+ .codehilite .esc { color: #c9d1d9 } /* Escape */
188
+ .codehilite .g { color: #c9d1d9 } /* Generic */
189
+ .codehilite .k { color: #ff7b72 } /* Keyword */
190
+ .codehilite .l { color: #a5d6ff } /* Literal */
191
+ .codehilite .n { color: #c9d1d9 } /* Name */
192
+ .codehilite .o { color: #ff7b72; font-weight: bold } /* Operator */
193
+ .codehilite .x { color: #c9d1d9 } /* Other */
194
+ .codehilite .p { color: #c9d1d9 } /* Punctuation */
195
+ .codehilite .ch { color: #8b949e; font-style: italic } /* Comment.Hashbang */
196
+ .codehilite .cm { color: #8b949e; font-style: italic } /* Comment.Multiline */
197
+ .codehilite .cp { color: #8b949e; font-weight: bold; font-style: italic } /* Comment.Preproc */
198
+ .codehilite .cpf { color: #8b949e; font-style: italic } /* Comment.PreprocFile */
199
+ .codehilite .c1 { color: #8b949e; font-style: italic } /* Comment.Single */
200
+ .codehilite .cs { color: #8b949e; font-weight: bold; font-style: italic } /* Comment.Special */
201
+ .codehilite .gd { color: #ffa198; background-color: #490202 } /* Generic.Deleted */
202
+ .codehilite .ge { color: #c9d1d9; font-style: italic } /* Generic.Emph */
203
+ .codehilite .gr { color: #ffa198 } /* Generic.Error */
204
+ .codehilite .gh { color: #79c0ff; font-weight: bold } /* Generic.Heading */
205
+ .codehilite .gi { color: #56d364; background-color: #0f5323 } /* Generic.Inserted */
206
+ .codehilite .go { color: #8b949e } /* Generic.Output */
207
+ .codehilite .gp { color: #8b949e } /* Generic.Prompt */
208
+ .codehilite .gs { color: #c9d1d9; font-weight: bold } /* Generic.Strong */
209
+ .codehilite .gu { color: #79c0ff } /* Generic.Subheading */
210
+ .codehilite .gt { color: #ff7b72 } /* Generic.Traceback */
211
+ .codehilite .g-Underline { color: #c9d1d9; text-decoration: underline } /* Generic.Underline */
212
+ .codehilite .kc { color: #79c0ff } /* Keyword.Constant */
213
+ .codehilite .kd { color: #ff7b72 } /* Keyword.Declaration */
214
+ .codehilite .kn { color: #ff7b72 } /* Keyword.Namespace */
215
+ .codehilite .kp { color: #79c0ff } /* Keyword.Pseudo */
216
+ .codehilite .kr { color: #ff7b72 } /* Keyword.Reserved */
217
+ .codehilite .kt { color: #ff7b72 } /* Keyword.Type */
218
+ .codehilite .ld { color: #79c0ff } /* Literal.Date */
219
+ .codehilite .m { color: #a5d6ff } /* Literal.Number */
220
+ .codehilite .s { color: #a5d6ff } /* Literal.String */
221
+ .codehilite .na { color: #c9d1d9 } /* Name.Attribute */
222
+ .codehilite .nb { color: #c9d1d9 } /* Name.Builtin */
223
+ .codehilite .nc { color: #f0883e; font-weight: bold } /* Name.Class */
224
+ .codehilite .no { color: #79c0ff; font-weight: bold } /* Name.Constant */
225
+ .codehilite .nd { color: #d2a8ff; font-weight: bold } /* Name.Decorator */
226
+ .codehilite .ni { color: #ffa657 } /* Name.Entity */
227
+ .codehilite .ne { color: #f0883e; font-weight: bold } /* Name.Exception */
228
+ .codehilite .nf { color: #d2a8ff; font-weight: bold } /* Name.Function */
229
+ .codehilite .nl { color: #79c0ff; font-weight: bold } /* Name.Label */
230
+ .codehilite .nn { color: #ff7b72 } /* Name.Namespace */
231
+ .codehilite .nx { color: #c9d1d9 } /* Name.Other */
232
+ .codehilite .py { color: #79c0ff } /* Name.Property */
233
+ .codehilite .nt { color: #7ee787 } /* Name.Tag */
234
+ .codehilite .nv { color: #79c0ff } /* Name.Variable */
235
+ .codehilite .ow { color: #ff7b72; font-weight: bold } /* Operator.Word */
236
+ .codehilite .pm { color: #c9d1d9 } /* Punctuation.Marker */
237
+ .codehilite .w { color: #6e7681 } /* Text.Whitespace */
238
+ .codehilite .mb { color: #a5d6ff } /* Literal.Number.Bin */
239
+ .codehilite .mf { color: #a5d6ff } /* Literal.Number.Float */
240
+ .codehilite .mh { color: #a5d6ff } /* Literal.Number.Hex */
241
+ .codehilite .mi { color: #a5d6ff } /* Literal.Number.Integer */
242
+ .codehilite .mo { color: #a5d6ff } /* Literal.Number.Oct */
243
+ .codehilite .sa { color: #79c0ff } /* Literal.String.Affix */
244
+ .codehilite .sb { color: #a5d6ff } /* Literal.String.Backtick */
245
+ .codehilite .sc { color: #a5d6ff } /* Literal.String.Char */
246
+ .codehilite .dl { color: #79c0ff } /* Literal.String.Delimiter */
247
+ .codehilite .sd { color: #a5d6ff } /* Literal.String.Doc */
248
+ .codehilite .s2 { color: #a5d6ff } /* Literal.String.Double */
249
+ .codehilite .se { color: #79c0ff } /* Literal.String.Escape */
250
+ .codehilite .sh { color: #79c0ff } /* Literal.String.Heredoc */
251
+ .codehilite .si { color: #a5d6ff } /* Literal.String.Interpol */
252
+ .codehilite .sx { color: #a5d6ff } /* Literal.String.Other */
253
+ .codehilite .sr { color: #79c0ff } /* Literal.String.Regex */
254
+ .codehilite .s1 { color: #a5d6ff } /* Literal.String.Single */
255
+ .codehilite .ss { color: #a5d6ff } /* Literal.String.Symbol */
256
+ .codehilite .bp { color: #c9d1d9 } /* Name.Builtin.Pseudo */
257
+ .codehilite .fm { color: #d2a8ff; font-weight: bold } /* Name.Function.Magic */
258
+ .codehilite .vc { color: #79c0ff } /* Name.Variable.Class */
259
+ .codehilite .vg { color: #79c0ff } /* Name.Variable.Global */
260
+ .codehilite .vi { color: #79c0ff } /* Name.Variable.Instance */
261
+ .codehilite .vm { color: #79c0ff } /* Name.Variable.Magic */
262
+ .codehilite .il { color: #a5d6ff } /* Literal.Number.Integer.Long */
263
+
264
+ .dark .codehilite .hll { background-color: #2C3B41 }
265
+ .dark .codehilite .c { color: #79d618; font-style: italic } /* Comment */
266
+ .dark .codehilite .err { color: #FF5370 } /* Error */
267
+ .dark .codehilite .esc { color: #89DDFF } /* Escape */
268
+ .dark .codehilite .g { color: #EEFFFF } /* Generic */
269
+ .dark .codehilite .k { color: #BB80B3 } /* Keyword */
270
+ .dark .codehilite .l { color: #C3E88D } /* Literal */
271
+ .dark .codehilite .n { color: #EEFFFF } /* Name */
272
+ .dark .codehilite .o { color: #89DDFF } /* Operator */
273
+ .dark .codehilite .p { color: #89DDFF } /* Punctuation */
274
+ .dark .codehilite .ch { color: #79d618; font-style: italic } /* Comment.Hashbang */
275
+ .dark .codehilite .cm { color: #79d618; font-style: italic } /* Comment.Multiline */
276
+ .dark .codehilite .cp { color: #79d618; font-style: italic } /* Comment.Preproc */
277
+ .dark .codehilite .cpf { color: #79d618; font-style: italic } /* Comment.PreprocFile */
278
+ .dark .codehilite .c1 { color: #79d618; font-style: italic } /* Comment.Single */
279
+ .dark .codehilite .cs { color: #79d618; font-style: italic } /* Comment.Special */
280
+ .dark .codehilite .gd { color: #FF5370 } /* Generic.Deleted */
281
+ .dark .codehilite .ge { color: #89DDFF } /* Generic.Emph */
282
+ .dark .codehilite .gr { color: #FF5370 } /* Generic.Error */
283
+ .dark .codehilite .gh { color: #C3E88D } /* Generic.Heading */
284
+ .dark .codehilite .gi { color: #C3E88D } /* Generic.Inserted */
285
+ .dark .codehilite .go { color: #79d618 } /* Generic.Output */
286
+ .dark .codehilite .gp { color: #FFCB6B } /* Generic.Prompt */
287
+ .dark .codehilite .gs { color: #FF5370 } /* Generic.Strong */
288
+ .dark .codehilite .gu { color: #89DDFF } /* Generic.Subheading */
289
+ .dark .codehilite .gt { color: #FF5370 } /* Generic.Traceback */
290
+ .dark .codehilite .kc { color: #89DDFF } /* Keyword.Constant */
291
+ .dark .codehilite .kd { color: #BB80B3 } /* Keyword.Declaration */
292
+ .dark .codehilite .kn { color: #89DDFF; font-style: italic } /* Keyword.Namespace */
293
+ .dark .codehilite .kp { color: #89DDFF } /* Keyword.Pseudo */
294
+ .dark .codehilite .kr { color: #BB80B3 } /* Keyword.Reserved */
295
+ .dark .codehilite .kt { color: #BB80B3 } /* Keyword.Type */
296
+ .dark .codehilite .ld { color: #C3E88D } /* Literal.Date */
297
+ .dark .codehilite .m { color: #F78C6C } /* Literal.Number */
298
+ .dark .codehilite .s { color: #C3E88D } /* Literal.String */
299
+ .dark .codehilite .na { color: #BB80B3 } /* Name.Attribute */
300
+ .dark .codehilite .nb { color: #82AAFF } /* Name.Builtin */
301
+ .dark .codehilite .nc { color: #FFCB6B } /* Name.Class */
302
+ .dark .codehilite .no { color: #EEFFFF } /* Name.Constant */
303
+ .dark .codehilite .nd { color: #82AAFF } /* Name.Decorator */
304
+ .dark .codehilite .ni { color: #89DDFF } /* Name.Entity */
305
+ .dark .codehilite .ne { color: #FFCB6B } /* Name.Exception */
306
+ .dark .codehilite .nf { color: #82AAFF } /* Name.Function */
307
+ .dark .codehilite .nl { color: #82AAFF } /* Name.Label */
308
+ .dark .codehilite .nn { color: #FFCB6B } /* Name.Namespace */
309
+ .dark .codehilite .nx { color: #EEFFFF } /* Name.Other */
310
+ .dark .codehilite .py { color: #FFCB6B } /* Name.Property */
311
+ .dark .codehilite .nt { color: #FF5370 } /* Name.Tag */
312
+ .dark .codehilite .nv { color: #89DDFF } /* Name.Variable */
313
+ .dark .codehilite .ow { color: #89DDFF; font-style: italic } /* Operator.Word */
314
+ .dark .codehilite .pm { color: #89DDFF } /* Punctuation.Marker */
315
+ .dark .codehilite .w { color: #EEFFFF } /* Text.Whitespace */
316
+ .dark .codehilite .mb { color: #F78C6C } /* Literal.Number.Bin */
317
+ .dark .codehilite .mf { color: #F78C6C } /* Literal.Number.Float */
318
+ .dark .codehilite .mh { color: #F78C6C } /* Literal.Number.Hex */
319
+ .dark .codehilite .mi { color: #F78C6C } /* Literal.Number.Integer */
320
+ .dark .codehilite .mo { color: #F78C6C } /* Literal.Number.Oct */
321
+ .dark .codehilite .sa { color: #BB80B3 } /* Literal.String.Affix */
322
+ .dark .codehilite .sb { color: #C3E88D } /* Literal.String.Backtick */
323
+ .dark .codehilite .sc { color: #C3E88D } /* Literal.String.Char */
324
+ .dark .codehilite .dl { color: #EEFFFF } /* Literal.String.Delimiter */
325
+ .dark .codehilite .sd { color: #79d618; font-style: italic } /* Literal.String.Doc */
326
+ .dark .codehilite .s2 { color: #C3E88D } /* Literal.String.Double */
327
+ .dark .codehilite .se { color: #EEFFFF } /* Literal.String.Escape */
328
+ .dark .codehilite .sh { color: #C3E88D } /* Literal.String.Heredoc */
329
+ .dark .codehilite .si { color: #89DDFF } /* Literal.String.Interpol */
330
+ .dark .codehilite .sx { color: #C3E88D } /* Literal.String.Other */
331
+ .dark .codehilite .sr { color: #89DDFF } /* Literal.String.Regex */
332
+ .dark .codehilite .s1 { color: #C3E88D } /* Literal.String.Single */
333
+ .dark .codehilite .ss { color: #89DDFF } /* Literal.String.Symbol */
334
+ .dark .codehilite .bp { color: #89DDFF } /* Name.Builtin.Pseudo */
335
+ .dark .codehilite .fm { color: #82AAFF } /* Name.Function.Magic */
336
+ .dark .codehilite .vc { color: #89DDFF } /* Name.Variable.Class */
337
+ .dark .codehilite .vg { color: #89DDFF } /* Name.Variable.Global */
338
+ .dark .codehilite .vi { color: #89DDFF } /* Name.Variable.Instance */
339
+ .dark .codehilite .vm { color: #82AAFF } /* Name.Variable.Magic */
340
+ .dark .codehilite .il { color: #F78C6C } /* Literal.Number.Integer.Long */
341
+
342
  """