Merge branch 'dev' of github.com:binary-husky/chatgpt_academic into dev
This commit is contained in:
		
						commit
						ce1cf491b6
					
				
							
								
								
									
										73
									
								
								theme.py
									
									
									
									
									
								
							
							
						
						
									
										73
									
								
								theme.py
									
									
									
									
									
								
							@ -153,4 +153,77 @@ advanced_css = """
 | 
				
			|||||||
    padding: 1em;
 | 
					    padding: 1em;
 | 
				
			||||||
    margin: 1em 2em 1em 0.5em;
 | 
					    margin: 1em 2em 1em 0.5em;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.hll { background-color: #ffffcc }
 | 
				
			||||||
 | 
					.c { color: #3D7B7B; font-style: italic } /* Comment */
 | 
				
			||||||
 | 
					.err { border: 1px solid #FF0000 } /* Error */
 | 
				
			||||||
 | 
					.k { color: #008000; font-weight: bold } /* Keyword */
 | 
				
			||||||
 | 
					.o { color: #666666 } /* Operator */
 | 
				
			||||||
 | 
					.ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
 | 
				
			||||||
 | 
					.cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
 | 
				
			||||||
 | 
					.cp { color: #9C6500 } /* Comment.Preproc */
 | 
				
			||||||
 | 
					.cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
 | 
				
			||||||
 | 
					.c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
 | 
				
			||||||
 | 
					.cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
 | 
				
			||||||
 | 
					.gd { color: #A00000 } /* Generic.Deleted */
 | 
				
			||||||
 | 
					.ge { font-style: italic } /* Generic.Emph */
 | 
				
			||||||
 | 
					.gr { color: #E40000 } /* Generic.Error */
 | 
				
			||||||
 | 
					.gh { color: #000080; font-weight: bold } /* Generic.Heading */
 | 
				
			||||||
 | 
					.gi { color: #008400 } /* Generic.Inserted */
 | 
				
			||||||
 | 
					.go { color: #717171 } /* Generic.Output */
 | 
				
			||||||
 | 
					.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
 | 
				
			||||||
 | 
					.gs { font-weight: bold } /* Generic.Strong */
 | 
				
			||||||
 | 
					.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
 | 
				
			||||||
 | 
					.gt { color: #0044DD } /* Generic.Traceback */
 | 
				
			||||||
 | 
					.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
 | 
				
			||||||
 | 
					.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
 | 
				
			||||||
 | 
					.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
 | 
				
			||||||
 | 
					.kp { color: #008000 } /* Keyword.Pseudo */
 | 
				
			||||||
 | 
					.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
 | 
				
			||||||
 | 
					.kt { color: #B00040 } /* Keyword.Type */
 | 
				
			||||||
 | 
					.m { color: #666666 } /* Literal.Number */
 | 
				
			||||||
 | 
					.s { color: #BA2121 } /* Literal.String */
 | 
				
			||||||
 | 
					.na { color: #687822 } /* Name.Attribute */
 | 
				
			||||||
 | 
					.nb { color: #008000 } /* Name.Builtin */
 | 
				
			||||||
 | 
					.nc { color: #0000FF; font-weight: bold } /* Name.Class */
 | 
				
			||||||
 | 
					.no { color: #880000 } /* Name.Constant */
 | 
				
			||||||
 | 
					.nd { color: #AA22FF } /* Name.Decorator */
 | 
				
			||||||
 | 
					.ni { color: #717171; font-weight: bold } /* Name.Entity */
 | 
				
			||||||
 | 
					.ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
 | 
				
			||||||
 | 
					.nf { color: #0000FF } /* Name.Function */
 | 
				
			||||||
 | 
					.nl { color: #767600 } /* Name.Label */
 | 
				
			||||||
 | 
					.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
 | 
				
			||||||
 | 
					.nt { color: #008000; font-weight: bold } /* Name.Tag */
 | 
				
			||||||
 | 
					.nv { color: #19177C } /* Name.Variable */
 | 
				
			||||||
 | 
					.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
 | 
				
			||||||
 | 
					.w { color: #bbbbbb } /* Text.Whitespace */
 | 
				
			||||||
 | 
					.mb { color: #666666 } /* Literal.Number.Bin */
 | 
				
			||||||
 | 
					.mf { color: #666666 } /* Literal.Number.Float */
 | 
				
			||||||
 | 
					.mh { color: #666666 } /* Literal.Number.Hex */
 | 
				
			||||||
 | 
					.mi { color: #666666 } /* Literal.Number.Integer */
 | 
				
			||||||
 | 
					.mo { color: #666666 } /* Literal.Number.Oct */
 | 
				
			||||||
 | 
					.sa { color: #BA2121 } /* Literal.String.Affix */
 | 
				
			||||||
 | 
					.sb { color: #BA2121 } /* Literal.String.Backtick */
 | 
				
			||||||
 | 
					.sc { color: #BA2121 } /* Literal.String.Char */
 | 
				
			||||||
 | 
					.dl { color: #BA2121 } /* Literal.String.Delimiter */
 | 
				
			||||||
 | 
					.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
 | 
				
			||||||
 | 
					.s2 { color: #BA2121 } /* Literal.String.Double */
 | 
				
			||||||
 | 
					.se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
 | 
				
			||||||
 | 
					.sh { color: #BA2121 } /* Literal.String.Heredoc */
 | 
				
			||||||
 | 
					.si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
 | 
				
			||||||
 | 
					.sx { color: #008000 } /* Literal.String.Other */
 | 
				
			||||||
 | 
					.sr { color: #A45A77 } /* Literal.String.Regex */
 | 
				
			||||||
 | 
					.s1 { color: #BA2121 } /* Literal.String.Single */
 | 
				
			||||||
 | 
					.ss { color: #19177C } /* Literal.String.Symbol */
 | 
				
			||||||
 | 
					.bp { color: #008000 } /* Name.Builtin.Pseudo */
 | 
				
			||||||
 | 
					.fm { color: #0000FF } /* Name.Function.Magic */
 | 
				
			||||||
 | 
					.vc { color: #19177C } /* Name.Variable.Class */
 | 
				
			||||||
 | 
					.vg { color: #19177C } /* Name.Variable.Global */
 | 
				
			||||||
 | 
					.vi { color: #19177C } /* Name.Variable.Instance */
 | 
				
			||||||
 | 
					.vm { color: #19177C } /* Name.Variable.Magic */
 | 
				
			||||||
 | 
					.il { color: #666666 } /* Literal.Number.Integer.Long */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
				
			|||||||
@ -260,7 +260,7 @@ def markdown_convertion(txt):
 | 
				
			|||||||
        # cat them together
 | 
					        # cat them together
 | 
				
			||||||
        return pre + convert_stage_2_1 + f'{split}' + convert_stage_2_2 + suf
 | 
					        return pre + convert_stage_2_1 + f'{split}' + convert_stage_2_2 + suf
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        return pre + markdown.markdown(txt, extensions=['fenced_code', 'tables', 'sane_lists']) + suf
 | 
					        return pre + markdown.markdown(txt, extensions=['fenced_code', 'codehilite', 'tables', 'sane_lists']) + suf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def close_up_code_segment_during_stream(gpt_reply):
 | 
					def close_up_code_segment_during_stream(gpt_reply):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user