</filler> <script> import urwid def init(self, opts): import urwid self.name = opts['name'] def answer(self, edit, text): self.name = text </script> </sig> """, ) style = """ .highlight { foreground: default,bold; background: default; mono: bold; } """ root = convert_string_to_node("<sig></sig>") mount(root, "sig", "sig", {"name": "Default"}) app = parse_tag_from_node(root) run_tag(app, parse_style(style))
<custom> <filler class="bg"> <pile> <div class="outside"></div> <div class="inside"></div> <text align="center" class="streak"> <span class="banner">hello world</span> </text> <div class="inside"></div> <div class="outside"></div> </pile> </filler> </custom> ''' tag = ''' <solidfill class="bg"></solidfill> ''' run_tag( parse_tag_from_node( riot_mount( convert_string_to_node(tag), 'solidfill.bg', convert_string_to_node(custom) ) ), parse_style(style), unhandled_input=lambda key: key in ('Q', 'q') and quit_app() )
</todo>''') root = convert_string_to_node('<filler><todo></todo></filler>') mount( root, 'todo', 'todo', { 'title': 'TODO list', 'items': [{ 'title': 'Avoid excessive coffeine', 'done': True, 'hidden': False }, { 'title': 'Hidden item', 'done': True, 'hidden': True }, { 'title': 'Be less provocative', 'done': False, 'hidden': False }, { 'title': 'Be nice to people', 'done': False, 'hidden': False }] }) app = parse_tag_from_node(root) run_tag(app)
foreground-high: g7; background-high: #d06; } ''' custom = ''' <custom> <filler class="bg"> <pile> <div class="outside"></div> <div class="inside"></div> <text align="center" class="streak"> <span class="banner">hello world</span> </text> <div class="inside"></div> <div class="outside"></div> </pile> </filler> </custom> ''' tag = ''' <solidfill class="bg"></solidfill> ''' run_tag(parse_tag_from_node( riot_mount(convert_string_to_node(tag), 'solidfill.bg', convert_string_to_node(custom))), parse_style(style), unhandled_input=lambda key: key in ('Q', 'q') and quit_app())