From 1f40df65c88ebf05e09f51ea1bb4e4af6c56dfed Mon Sep 17 00:00:00 2001 From: Rodja Trappe Date: Wed, 19 May 2021 13:48:16 +0200 Subject: [PATCH] more documentation --- main.py | 8 ++++++++ nicegui/elements/label.py | 6 ++++++ nicegui/elements/markdown.py | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/main.py b/main.py index dcb053343..1386d2446 100644 --- a/main.py +++ b/main.py @@ -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(): diff --git a/nicegui/elements/label.py b/nicegui/elements/label.py index 420212334..2fd3739da 100644 --- a/nicegui/elements/label.py +++ b/nicegui/elements/label.py @@ -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] diff --git a/nicegui/elements/markdown.py b/nicegui/elements/markdown.py index d210acc6c..ea97c98e1 100644 --- a/nicegui/elements/markdown.py +++ b/nicegui/elements/markdown.py @@ -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)