浏览代码

add documentation

Falko Schindler 1 年之前
父节点
当前提交
c0a567fb43

+ 3 - 1
nicegui/functions/page_title.py

@@ -2,7 +2,9 @@ from .. import context, json
 
 
 def page_title(title: str) -> None:
-    """Set the page title for the current client.
+    """Page title
+
+    Set the page title for the current client.
 
     :param title: page title
     """

+ 8 - 0
website/documentation/content/page_title_documentation.py

@@ -0,0 +1,8 @@
+from nicegui import ui
+
+from . import doc
+
+
+@doc.demo(ui.page_title)
+def main_demo() -> None:
+    ui.button('Change page title', on_click=lambda: ui.page_title('New Title'))

+ 2 - 1
website/documentation/content/section_pages_routing.py

@@ -2,7 +2,7 @@ import uuid
 
 from nicegui import app, ui
 
-from . import doc, download_documentation, open_documentation, page_documentation
+from . import doc, download_documentation, open_documentation, page_documentation, page_title_documentation
 
 CONSTANT_UUID = str(uuid.uuid4())
 
@@ -79,6 +79,7 @@ def parameter_demo():
     ui.link('Water', '/icon/water_drop?amount=3')
 
 
+doc.intro(page_title_documentation)
 doc.intro(open_documentation)
 doc.intro(download_documentation)