Skip to main content

Markdown / Data

Display dynamic formatted content using markdown.

import timefrom h2o_wave import site, ui
page = site['/demo']
beer_verse = '''{{before}} bottles of beer on the wall, {{before}} bottles of beer.
Take one down, pass it around, {{after}} bottles of beer on the wall...'''
beer_card = page.add('example', ui.markdown_card(    box='1 1 4 2',    title='99 Bottles of Beer',    content='=' + beer_verse,  # Make the verse a template expression by prefixing a '='.    data=dict(before='99', after='98'),))
for i in range(98, 2, -1):    time.sleep(1) = str(i) = str(i - 1)

Tags: โ€‚markdown