Skip to content

Commit

Permalink
more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed May 19, 2021
1 parent d29fee2 commit 1f40df6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ def example(content: Union[Element, str]):
t = ui.timer(interval=0.1, callback=lambda: clock.set_text(datetime.now().strftime("%X")))
ui.checkbox('active').bind_value(t.active)

with example(ui.label):

ui.label('some label')

with example(ui.markdown):

ui.markdown('### Headline\nWith hyperlink to [GitHub](https://github.com/zauberzeug/nicegui).')

with example(ui.button):

def button_increment():
Expand Down
6 changes: 6 additions & 0 deletions nicegui/elements/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ class Label(Element):
def __init__(self,
text: str = '',
typography: Union[str, List[str]] = []):
"""Label Element
Displays some text.
:param text: the content of the label
"""

if isinstance(typography, str):
typography = [typography]
Expand Down
6 changes: 6 additions & 0 deletions nicegui/elements/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
class Markdown(Html):

def __init__(self, content: str = '', classes: str = ''):
"""Markdown Element
Renders markdown onto the page.
:param content: the markdown to be displayed
"""

super().__init__(content, classes=classes)

Expand Down

0 comments on commit 1f40df6

Please sign in to comment.