(self)
return '\n'.join(text) + '\n'
Get css.
Get css.
Get css .
def get_css(self):
        """Get css."""

        # Intialize colors with the global foreground, background, and fake html_border
        colors = OrderedDict()
        colors['.foreground'] = OrderedDict([('color', self.fground)])
        colors['.background'] = OrderedDict([('background-color', self.bground)])

        # Assemble the rest of the CSS
        for tscope in sorted(all_scopes):
            scope = self.guess_style(tscope, explicit_background=True)
            key_scope = '.' + tscope
            color = scope.fg_simulated
            bgcolor = scope.bg_simulated
            if color or bgcolor:
                colors[key_scope] = OrderedDict()
                if color:
                    colors[key_scope]['color'] = color
                if bgcolor:
                    colors[key_scope]['background-color'] = bgcolor

                for s in scope.style.split(' '):
                    if "bold" in s:
                        colors[key_scope]['font-weight'] = 'bold'
                    if "italic" in s:
                        colors[key_scope]['font-style'] = 'italic'
                    if "underline" in s and False:  # disabled
                        colors[key_scope]['text-decoration'] = 'underline'

        text = []
        css_entry = '%s { %s}'
        for k, v in colors.items():
            text.append(css_entry % (k, ''.join(['%s: %s;' % (k1, v1) for k1, v1 in v.items()])))

        return '\n'.join(text) + '\n'
def get_css ( self ) : # Intialize colors with the global foreground, background, and fake html_border colors = OrderedDict ( ) colors [ '.foreground' ] = OrderedDict ( [ ( 'color' , self . fground ) ] ) colors [ '.background' ] = OrderedDict ( [ ( 'background-color' , self . bground ) ] ) # Assemble the rest of the CSS for tscope in sorted ( all_scopes ) : scope = self . guess_style ( tscope , explicit_background = True ) key_scope = '.' + tscope color = scope . fg_simulated bgcolor = scope . bg_simulated if color or bgcolor : colors [ key_scope ] = OrderedDict ( ) if color : colors [ key_scope ] [ 'color' ] = color if bgcolor : colors [ key_scope ] [ 'background-color' ] = bgcolor for s in scope . style . split ( ' ' ) : if "bold" in s : colors [ key_scope ] [ 'font-weight' ] = 'bold' if "italic" in s : colors [ key_scope ] [ 'font-style' ] = 'italic' if "underline" in s and False : # disabled colors [ key_scope ] [ 'text-decoration' ] = 'underline' text = [ ] css_entry = '%s { %s}' for k , v in colors . items ( ) : text . append ( css_entry % ( k , '' . join ( [ '%s: %s;' % ( k1 , v1 ) for k1 , v1 in v . items ( ) ] ) ) ) return '\n' . join ( text ) + '\n'