Ver Fonte

more documentation

Rodja Trappe há 4 anos atrás
pai
commit
1f40df65c8
3 ficheiros alterados com 20 adições e 0 exclusões
  1. 8 0
      main.py
  2. 6 0
      nicegui/elements/label.py
  3. 6 0
      nicegui/elements/markdown.py

+ 8 - 0
main.py

@@ -69,6 +69,14 @@ with example(ui.timer):
     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():

+ 6 - 0
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]

+ 6 - 0
nicegui/elements/markdown.py

@@ -5,6 +5,12 @@ import re
 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)