Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def produce_headers(self):
return '<style type="text/css">\n%(style)s\n</style>\n' % {
'style' : "\n".join(map(str, get_styles(self.dark_bg)))
}
escaped=True,
markup_lines=False,
output_encoding='utf-8',
):
self.inline = inline
self.dark_bg = dark_bg
self.font_size = font_size
self.linkify = linkify
self.escaped = escaped
self.markup_lines = markup_lines
self.output_encoding = output_encoding
self._attrs = None
if inline:
self.styles = dict([(item.klass.strip('.'), item) for item in get_styles(self.dark_bg)])
self.ansi_codes_prog = re.compile('\033\\[' '([\\d;]*)' '([a-zA-z])')
escaped=True,
markup_lines=False,
output_encoding='utf-8',
):
self.inline = inline
self.dark_bg = dark_bg
self.font_size = font_size
self.linkify = linkify
self.escaped = escaped
self.markup_lines = markup_lines
self.output_encoding = output_encoding
self._attrs = None
if inline:
self.styles = dict([(item.klass.strip('.'), item) for item in get_styles(self.dark_bg)])
self.ansi_codes_prog = re.compile('\033\\[' '([\\d;]*)' '([a-zA-z])')
def convert(self, ansi, full=True):
attrs = self.prepare(ansi)
if not full:
return attrs["body"]
else:
return _template.format(
style="\n".join(map(str, get_styles(self.dark_bg))),
font_size=self.font_size,
content=attrs["body"],
output_encoding=self.output_encoding,
)
):
self.latex = latex
self.inline = inline
self.dark_bg = dark_bg
self.font_size = font_size
self.linkify = linkify
self.escaped = escaped
self.markup_lines = markup_lines
self.output_encoding = output_encoding
self.scheme = scheme
self.title = title
self._attrs = None
if inline:
self.styles = dict([(item.klass.strip('.'), item) for item in get_styles(self.dark_bg, self.scheme)])
self.ansi_codes_prog = re.compile('\033\\[' '([\\d;]*)' '([a-zA-z])')
def produce_headers(self):
return '<style type="text/css">\n%(style)s\n</style>\n' % {
'style' : "\n".join(map(str, get_styles(self.dark_bg, self.scheme)))
}
def produce_headers(self):
return '<style type="text/css">\n{style}\n</style>\n'.format(
style="\n".join(map(str, get_styles(self.dark_bg)))
)
def convert(self, ansi, full=True, ensure_trailing_newline=False):
attrs = self.prepare(ansi, ensure_trailing_newline=ensure_trailing_newline)
if not full:
return attrs["body"]
else:
if self.latex:
_template = _latex_template
else:
_template = _html_template
return _template % {
'style' : "\n".join(map(str, get_styles(self.dark_bg, self.scheme))),
'title' : self.title,
'font_size' : self.font_size,
'content' : attrs["body"],
'output_encoding' : self.output_encoding,
}