Skip to content

Commit

Permalink
Add examples for frame cards h2oai/q#1157
Browse files Browse the repository at this point in the history
  • Loading branch information
lo5 committed Aug 7, 2020
1 parent 94d1327 commit 26a02de
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
23 changes: 23 additions & 0 deletions py/examples/frame.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Frame
# Use a frame card to display HTML content.
# ---
from h2o_q import site, ui

html = '''
<!DOCTYPE html>
<html>
<body>
<h1>Hello World!</h1>
</body>
</html>
'''

page = site['/demo']

page['example'] = ui.frame_card(
box='1 1 2 2',
title='Example',
content=html,
)

page.save()
14 changes: 14 additions & 0 deletions py/examples/frame_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Frame / Path
# Use a frame card to display external web pages.
# ---
from h2o_q import site, ui

page = site['/demo']

page['example'] = ui.frame_card(
box='1 1 6 5',
title='Example',
path='https://example.com',
)

page.save()
2 changes: 2 additions & 0 deletions py/examples/tour.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ separator.py
file_upload.py
form_frame.py
form_frame_path.py
frame.py
frame_path.py
list.py
grid.py
flex.py
Expand Down

0 comments on commit 26a02de

Please sign in to comment.