elsie/box.py
def code(self, language, text, tabsize=4, line_numbers=False, style=None):
        """ Draw a code with syntax highlighting """

        text = text.replace("\t", " " * tabsize)
        if language:
            parsed_text = highlight_code(text, language)
        else:
            parsed_text = parse_text(text, escape_char=None)

        if line_numbers:
            parsed_text = add_line_numbers(parsed_text)

        if style:
            style = self._get_style(style)
        else:
            style = self._styles["code"]
        self._text_helper(parsed_text, style)
 Draw a code with syntax highlighting 
Draw a code with syntax highlighting
Draw a code with syntax highlighting
def code(self, language, text, tabsize=4, line_numbers=False, style=None):
        text = text.replace("\t", " " * tabsize)
        if language:
            parsed_text = highlight_code(text, language)
        else:
            parsed_text = parse_text(text, escape_char=None)
        if line_numbers:
            parsed_text = add_line_numbers(parsed_text)
        if style:
            style = self._get_style(style)
        else:
            style = self._styles["code"]
        self._text_helper(parsed_text, style)
def code ( self , language , text , tabsize = 4 , line_numbers = False , style = None ) : text = text . replace ( "\t" , " " * tabsize ) if language : parsed_text = highlight_code ( text , language ) else : parsed_text = parse_text ( text , escape_char = None ) if line_numbers : parsed_text = add_line_numbers ( parsed_text ) if style : style = self . _get_style ( style ) else : style = self . _styles [ "code" ] self . _text_helper ( parsed_text , style )
Draw a code with syntax highlighting
Draw a code with syntax highlighting
""" Draw a code with syntax highlighting """
self
language
text
tabsize
line_numbers
style