eric6/QScintilla/Exporters/ExporterHTML.py

changeset 8259
2bbec88047dd
parent 8243
cc717c2ae956
child 8273
698ae46f40a4
equal deleted inserted replaced
8258:82b608e352ec 8259:2bbec88047dd
120 '''//-->\n''' 120 '''//-->\n'''
121 '''</script>\n''' 121 '''</script>\n'''
122 ) 122 )
123 123
124 lex = self.editor.getLexer() 124 lex = self.editor.getLexer()
125 if lex: 125 bgColour = (
126 bgColour = lex.paper(QsciScintilla.STYLE_DEFAULT).name() 126 lex.paper(QsciScintilla.STYLE_DEFAULT).name()
127 else: 127 if lex else
128 bgColour = self.editor.paper().name() 128 self.editor.paper().name()
129 )
129 130
130 html += '''<style type="text/css">\n''' 131 html += '''<style type="text/css">\n'''
131 if lex: 132 if lex:
132 istyle = 0 133 istyle = 0
133 while istyle <= QsciScintilla.STYLE_MAX: 134 while istyle <= QsciScintilla.STYLE_MAX:
645 mermaid_initialize = "" 646 mermaid_initialize = ""
646 647
647 htmlFormat = Preferences.getEditor("PreviewMarkdownHTMLFormat").lower() 648 htmlFormat = Preferences.getEditor("PreviewMarkdownHTMLFormat").lower()
648 body = markdown.markdown(text, extensions=extensions, 649 body = markdown.markdown(text, extensions=extensions,
649 output_format=htmlFormat) 650 output_format=htmlFormat)
650 if useDarkScheme: 651 style = (
651 style = ( 652 (PreviewerHTMLStyles.css_markdown_dark +
652 PreviewerHTMLStyles.css_markdown_dark + 653 PreviewerHTMLStyles.css_pygments_dark)
653 PreviewerHTMLStyles.css_pygments_dark 654 if useDarkScheme else
654 ) 655 (PreviewerHTMLStyles.css_markdown_light +
655 else: 656 PreviewerHTMLStyles.css_pygments_light)
656 style = ( 657 )
657 PreviewerHTMLStyles.css_markdown_light +
658 PreviewerHTMLStyles.css_pygments_light
659 )
660 658
661 if htmlFormat == "xhtml1": 659 if htmlFormat == "xhtml1":
662 head = ( 660 head = (
663 '''<!DOCTYPE html PUBLIC "-//W3C//DTD''' 661 '''<!DOCTYPE html PUBLIC "-//W3C//DTD'''
664 ''' XHTML 1.0 Transitional//EN"\n''' 662 ''' XHTML 1.0 Transitional//EN"\n'''

eric ide

mercurial