lookatme.render.pygments module¶
Pygments related rendering
- class lookatme.render.pygments.UrwidFormatter(**options)[source]¶
Bases:
Formatter
Formatter that returns [(text,attrspec), …], where text is a piece of text, and attrspec is an urwid.AttrSpec
- classmethod findclosest(colstr, colors=256)[source]¶
Takes a hex string and finds the nearest color to it.
Returns a string urwid will recognize.
- findclosestattr(fgcolstr=None, bgcolstr=None, othersettings='', colors=256)[source]¶
Takes two hex colstring (e.g. ‘ff00dd’) and returns the nearest urwid style.
- format(tokensource, outfile)[source]¶
This method must format the tokens from the tokensource iterable and write the formatted version to the file object outfile.
Formatter options can control how exactly the tokens are converted.
- formatgenerator(tokensource)[source]¶
Takes a token source, and generates (tokenstring, urwid.AttrSpec) pairs
- property style¶