Pārlūkot izejas kodu

invert "skip" argument for examples

Falko Schindler 2 gadi atpakaļ
vecāks
revīzija
6eb20e1a39
2 mainītis faili ar 60 papildinājumiem un 60 dzēšanām
  1. 59 59
      website/api_docs_and_examples.py
  2. 1 1
      website/example.py

+ 59 - 59
website/api_docs_and_examples.py

@@ -8,7 +8,7 @@ def create_intro() -> None:
     @example('''#### Hello, World!
     @example('''#### Hello, World!
 
 
 Creating a user interface with NiceGUI is as simple as writing a single line of code.
 Creating a user interface with NiceGUI is as simple as writing a single line of code.
-''', tight=True, skip=False)
+''', tight=True)
     def hello_world_example():
     def hello_world_example():
         ui.label('Hello, world!')
         ui.label('Hello, world!')
         ui.markdown('Have a look at the full <br/> [API reference](reference)!')
         ui.markdown('Have a look at the full <br/> [API reference](reference)!')
@@ -16,7 +16,7 @@ Creating a user interface with NiceGUI is as simple as writing a single line of
     @example('''#### Common UI Elements
     @example('''#### Common UI Elements
 
 
 NiceGUI comes with a collection of commonly used UI elements.
 NiceGUI comes with a collection of commonly used UI elements.
-''', tight=True, skip=False)
+''', tight=True)
     def common_elements_example():
     def common_elements_example():
         ui.button('Button', on_click=lambda: ui.notify('Click'))
         ui.button('Button', on_click=lambda: ui.notify('Click'))
         ui.checkbox('Checkbox', on_change=lambda e: ui.notify('Checked' if e.value else 'Unchecked'))
         ui.checkbox('Checkbox', on_change=lambda e: ui.notify('Checked' if e.value else 'Unchecked'))
@@ -29,7 +29,7 @@ NiceGUI comes with a collection of commonly used UI elements.
     @example('''#### Value Binding
     @example('''#### Value Binding
 
 
 Binding values between UI elements or [to data models](http://127.0.0.1:8080/reference#bindings) is built into NiceGUI.
 Binding values between UI elements or [to data models](http://127.0.0.1:8080/reference#bindings) is built into NiceGUI.
-''', tight=True, skip=False)
+''', tight=True)
     def binding_example():
     def binding_example():
         slider = ui.slider(min=0, max=100, value=50)
         slider = ui.slider(min=0, max=100, value=50)
         ui.number('Value').bind_value(slider, 'value').classes('fit')
         ui.number('Value').bind_value(slider, 'value').classes('fit')
@@ -41,58 +41,58 @@ def create_full() -> None:
 
 
     h3('Basic Elements')
     h3('Basic Elements')
 
 
-    @example(ui.label, skip=False)
+    @example(ui.label)
     def label_example():
     def label_example():
         ui.label('some label')
         ui.label('some label')
 
 
-    @example(ui.icon, skip=False)
+    @example(ui.icon)
     def icon_example():
     def icon_example():
         ui.icon('thumb_up')
         ui.icon('thumb_up')
 
 
-    @example(ui.link, skip=False)
+    @example(ui.link)
     def link_example():
     def link_example():
         ui.link('NiceGUI on GitHub', 'https://github.com/zauberzeug/nicegui')
         ui.link('NiceGUI on GitHub', 'https://github.com/zauberzeug/nicegui')
 
 
-    @example(ui.button, skip=False)
+    @example(ui.button)
     def button_example():
     def button_example():
         ui.button('Click me!', on_click=lambda: ui.notify(f'You clicked me!'))
         ui.button('Click me!', on_click=lambda: ui.notify(f'You clicked me!'))
 
 
-    @example(ui.badge, skip=False)
+    @example(ui.badge)
     def badge_example():
     def badge_example():
         with ui.button('Click me!', on_click=lambda: badge.set_text(int(badge.text) + 1)):
         with ui.button('Click me!', on_click=lambda: badge.set_text(int(badge.text) + 1)):
             badge = ui.badge('0', color='red').props('floating')
             badge = ui.badge('0', color='red').props('floating')
 
 
-    @example(ui.toggle, skip=False)
+    @example(ui.toggle)
     def toggle_example():
     def toggle_example():
         toggle1 = ui.toggle([1, 2, 3], value=1)
         toggle1 = ui.toggle([1, 2, 3], value=1)
         toggle2 = ui.toggle({1: 'A', 2: 'B', 3: 'C'}).bind_value(toggle1, 'value')
         toggle2 = ui.toggle({1: 'A', 2: 'B', 3: 'C'}).bind_value(toggle1, 'value')
 
 
-    @example(ui.radio, skip=False)
+    @example(ui.radio)
     def radio_example():
     def radio_example():
         radio1 = ui.radio([1, 2, 3], value=1).props('inline')
         radio1 = ui.radio([1, 2, 3], value=1).props('inline')
         radio2 = ui.radio({1: 'A', 2: 'B', 3: 'C'}).props('inline').bind_value(radio1, 'value')
         radio2 = ui.radio({1: 'A', 2: 'B', 3: 'C'}).props('inline').bind_value(radio1, 'value')
 
 
-    @example(ui.select, skip=False)
+    @example(ui.select)
     def select_example():
     def select_example():
         select1 = ui.select([1, 2, 3], value=1)
         select1 = ui.select([1, 2, 3], value=1)
         select2 = ui.select({1: 'One', 2: 'Two', 3: 'Three'}).bind_value(select1, 'value')
         select2 = ui.select({1: 'One', 2: 'Two', 3: 'Three'}).bind_value(select1, 'value')
 
 
-    @example(ui.checkbox, skip=False)
+    @example(ui.checkbox)
     def checkbox_example():
     def checkbox_example():
         checkbox = ui.checkbox('check me')
         checkbox = ui.checkbox('check me')
         ui.label('Check!').bind_visibility_from(checkbox, 'value')
         ui.label('Check!').bind_visibility_from(checkbox, 'value')
 
 
-    @example(ui.switch, skip=False)
+    @example(ui.switch)
     def switch_example():
     def switch_example():
         switch = ui.switch('switch me')
         switch = ui.switch('switch me')
         ui.label('Switch!').bind_visibility_from(switch, 'value')
         ui.label('Switch!').bind_visibility_from(switch, 'value')
 
 
-    @example(ui.slider, skip=False)
+    @example(ui.slider)
     def slider_example():
     def slider_example():
         slider = ui.slider(min=0, max=100, value=50).props('label')
         slider = ui.slider(min=0, max=100, value=50).props('label')
         ui.label().bind_text_from(slider, 'value')
         ui.label().bind_text_from(slider, 'value')
 
 
-    @example(ui.joystick, skip=False)
+    @example(ui.joystick)
     def joystick_example():
     def joystick_example():
         ui.joystick(color='blue', size=50,
         ui.joystick(color='blue', size=50,
                     on_move=lambda msg: coordinates.set_text(f"{msg['args']['data']['vector']['x']:.3f}, " +
                     on_move=lambda msg: coordinates.set_text(f"{msg['args']['data']['vector']['x']:.3f}, " +
@@ -100,47 +100,47 @@ def create_full() -> None:
                     on_end=lambda msg: coordinates.set_text('0, 0'))
                     on_end=lambda msg: coordinates.set_text('0, 0'))
         coordinates = ui.label('0, 0')
         coordinates = ui.label('0, 0')
 
 
-    @example(ui.input, skip=False)
+    @example(ui.input)
     def input_example():
     def input_example():
         ui.input(label='Text', placeholder='start typing',
         ui.input(label='Text', placeholder='start typing',
                  on_change=lambda e: input_result.set_text('you typed: ' + e.value))
                  on_change=lambda e: input_result.set_text('you typed: ' + e.value))
         input_result = ui.label()
         input_result = ui.label()
 
 
-    @example(ui.number, skip=False)
+    @example(ui.number)
     def number_example():
     def number_example():
         ui.number(label='Number', value=3.1415927, format='%.2f',
         ui.number(label='Number', value=3.1415927, format='%.2f',
                   on_change=lambda e: number_result.set_text(f'you entered: {e.value}'))
                   on_change=lambda e: number_result.set_text(f'you entered: {e.value}'))
         number_result = ui.label()
         number_result = ui.label()
 
 
-    @example(ui.color_input, skip=False)
+    @example(ui.color_input)
     def color_input_example():
     def color_input_example():
         color_label = ui.label('Change my color!')
         color_label = ui.label('Change my color!')
         ui.color_input(label='Color', value='#000000',
         ui.color_input(label='Color', value='#000000',
                        on_change=lambda e: color_label.style(f'color:{e.value}'))
                        on_change=lambda e: color_label.style(f'color:{e.value}'))
 
 
-    @example(ui.color_picker, skip=False)
+    @example(ui.color_picker)
     def color_picker_example():
     def color_picker_example():
         picker = ui.color_picker(on_pick=lambda e: button.style(f'background-color:{e.color}!important'))
         picker = ui.color_picker(on_pick=lambda e: button.style(f'background-color:{e.color}!important'))
         button = ui.button(on_click=picker.open).props('icon=colorize')
         button = ui.button(on_click=picker.open).props('icon=colorize')
 
 
-    @example(ui.upload, skip=False)
+    @example(ui.upload)
     def upload_example():
     def upload_example():
         ui.upload(on_upload=lambda e: ui.notify(f'{e.files[0].size} bytes'))
         ui.upload(on_upload=lambda e: ui.notify(f'{e.files[0].size} bytes'))
 
 
     h3('Markdown and HTML')
     h3('Markdown and HTML')
 
 
-    @example(ui.markdown, skip=False)
+    @example(ui.markdown)
     def markdown_example():
     def markdown_example():
         ui.markdown('''This is **Markdown**.''')
         ui.markdown('''This is **Markdown**.''')
 
 
-    @example(ui.html, skip=False)
+    @example(ui.html)
     def html_example():
     def html_example():
         ui.html('This is <strong>HTML</strong>.')
         ui.html('This is <strong>HTML</strong>.')
 
 
     @example('''#### SVG
     @example('''#### SVG
 
 
 You can add Scalable Vector Graphics using the `ui.html` element.
 You can add Scalable Vector Graphics using the `ui.html` element.
-''', skip=False)
+''')
     def svg_example():
     def svg_example():
         content = '''
         content = '''
             <svg viewBox="0 0 200 200" width="100" height="100" xmlns="http://www.w3.org/2000/svg">
             <svg viewBox="0 0 200 200" width="100" height="100" xmlns="http://www.w3.org/2000/svg">
@@ -153,7 +153,7 @@ You can add Scalable Vector Graphics using the `ui.html` element.
 
 
     h3('Images')
     h3('Images')
 
 
-    @example(ui.image, skip=False)
+    @example(ui.image)
     def image_example():
     def image_example():
         ui.image('http://placeimg.com/640/360/tech')
         ui.image('http://placeimg.com/640/360/tech')
 
 
@@ -163,7 +163,7 @@ By nesting elements inside a `ui.image` you can create augmentations.
 
 
 Use [Quasar classes](https://quasar.dev/vue-components/img) for positioning and styling captions.
 Use [Quasar classes](https://quasar.dev/vue-components/img) for positioning and styling captions.
 To overlay an SVG, make the `viewBox` exactly the size of the image and provide `100%` width/height to match the actual rendered size.
 To overlay an SVG, make the `viewBox` exactly the size of the image and provide `100%` width/height to match the actual rendered size.
-''', skip=False)
+''')
     def captions_and_overlays_example():
     def captions_and_overlays_example():
         with ui.image('http://placeimg.com/640/360/nature'):
         with ui.image('http://placeimg.com/640/360/nature'):
             ui.label('Nice!').classes('absolute-bottom text-subtitle2 text-center')
             ui.label('Nice!').classes('absolute-bottom text-subtitle2 text-center')
@@ -175,7 +175,7 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
                 </svg>
                 </svg>
             ''').classes('bg-transparent')
             ''').classes('bg-transparent')
 
 
-    @example(ui.interactive_image, skip=False)
+    @example(ui.interactive_image)
     def interactive_image_example():
     def interactive_image_example():
         from nicegui.events import MouseEventArguments
         from nicegui.events import MouseEventArguments
 
 
@@ -229,7 +229,7 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
 
 
         ui.button('Update', on_click=update)
         ui.button('Update', on_click=update)
 
 
-    @example(ui.plot, skip=False)
+    @example(ui.plot)
     def plot_example():
     def plot_example():
         import numpy as np
         import numpy as np
         from matplotlib import pyplot as plt
         from matplotlib import pyplot as plt
@@ -239,7 +239,7 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
             y = np.cos(2 * np.pi * x) * np.exp(-x)
             y = np.cos(2 * np.pi * x) * np.exp(-x)
             plt.plot(x, y, '-')
             plt.plot(x, y, '-')
 
 
-    @example(ui.line_plot, skip=False)
+    @example(ui.line_plot)
     def line_plot_example():
     def line_plot_example():
         global line_checkbox
         global line_checkbox
         from datetime import datetime
         from datetime import datetime
@@ -259,17 +259,17 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
         line_updates = ui.timer(0.1, update_line_plot, active=False)
         line_updates = ui.timer(0.1, update_line_plot, active=False)
         line_checkbox = ui.checkbox('active').bind_value(line_updates, 'active')
         line_checkbox = ui.checkbox('active').bind_value(line_updates, 'active')
 
 
-    @example(ui.linear_progress, skip=False)
+    @example(ui.linear_progress)
     def linear_progress_example():
     def linear_progress_example():
         slider = ui.slider(min=0, max=1, step=0.01, value=0.5)
         slider = ui.slider(min=0, max=1, step=0.01, value=0.5)
         ui.linear_progress().bind_value_from(slider, 'value')
         ui.linear_progress().bind_value_from(slider, 'value')
 
 
-    @example(ui.circular_progress, skip=False)
+    @example(ui.circular_progress)
     def circular_progress_example():
     def circular_progress_example():
         slider = ui.slider(min=0, max=1, step=0.01, value=0.5)
         slider = ui.slider(min=0, max=1, step=0.01, value=0.5)
         ui.circular_progress().bind_value_from(slider, 'value')
         ui.circular_progress().bind_value_from(slider, 'value')
 
 
-    @example(ui.scene, skip=False)
+    @example(ui.scene)
     def scene_example():
     def scene_example():
         with ui.scene(width=225, height=225) as scene:
         with ui.scene(width=225, height=225) as scene:
             scene.sphere().material('#4488ff')
             scene.sphere().material('#4488ff')
@@ -294,14 +294,14 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
             scene.text('2D', 'background: rgba(0, 0, 0, 0.2); border-radius: 5px; padding: 5px').move(z=2)
             scene.text('2D', 'background: rgba(0, 0, 0, 0.2); border-radius: 5px; padding: 5px').move(z=2)
             scene.text3d('3D', 'background: rgba(0, 0, 0, 0.2); border-radius: 5px; padding: 5px').move(y=-2).scale(.05)
             scene.text3d('3D', 'background: rgba(0, 0, 0, 0.2); border-radius: 5px; padding: 5px').move(y=-2).scale(.05)
 
 
-    @example(ui.tree, skip=False)
+    @example(ui.tree)
     def tree_example():
     def tree_example():
         ui.tree([
         ui.tree([
             {'id': 'numbers', 'children': [{'id': '1'}, {'id': '2'}]},
             {'id': 'numbers', 'children': [{'id': '1'}, {'id': '2'}]},
             {'id': 'letters', 'children': [{'id': 'A'}, {'id': 'B'}]},
             {'id': 'letters', 'children': [{'id': 'A'}, {'id': 'B'}]},
         ], label_key='id', on_select=lambda e: ui.notify(e.value))
         ], label_key='id', on_select=lambda e: ui.notify(e.value))
 
 
-    @example(ui.log, skip=False)
+    @example(ui.log)
     def log_example():
     def log_example():
         from datetime import datetime
         from datetime import datetime
 
 
@@ -310,21 +310,21 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
 
 
     h3('Layout')
     h3('Layout')
 
 
-    @example(ui.card, skip=False)
+    @example(ui.card)
     def card_example():
     def card_example():
         with ui.card().tight() as card:
         with ui.card().tight() as card:
             ui.image('http://placeimg.com/640/360/nature')
             ui.image('http://placeimg.com/640/360/nature')
             with ui.card_section():
             with ui.card_section():
                 ui.label('Lorem ipsum dolor sit amet, consectetur adipiscing elit, ...')
                 ui.label('Lorem ipsum dolor sit amet, consectetur adipiscing elit, ...')
 
 
-    @example(ui.column, skip=False)
+    @example(ui.column)
     def column_example():
     def column_example():
         with ui.column():
         with ui.column():
             ui.label('label 1')
             ui.label('label 1')
             ui.label('label 2')
             ui.label('label 2')
             ui.label('label 3')
             ui.label('label 3')
 
 
-    @example(ui.row, skip=False)
+    @example(ui.row)
     def row_example():
     def row_example():
         with ui.row():
         with ui.row():
             ui.label('label 1')
             ui.label('label 1')
@@ -336,7 +336,7 @@ To overlay an SVG, make the `viewBox` exactly the size of the image and provide
 To remove all elements from a row, column or card container, use the `clear()` method.
 To remove all elements from a row, column or card container, use the `clear()` method.
 
 
 Alternatively, you can remove individual elements with `remove(element)`, where `element` is an Element or an index.
 Alternatively, you can remove individual elements with `remove(element)`, where `element` is an Element or an index.
-''')
+''', skip=True)
     def clear_containers_example():
     def clear_containers_example():
         container = ui.row()
         container = ui.row()
 
 
@@ -349,12 +349,12 @@ Alternatively, you can remove individual elements with `remove(element)`, where
         ui.button('Remove', on_click=lambda: container.remove(0))
         ui.button('Remove', on_click=lambda: container.remove(0))
         ui.button('Clear', on_click=container.clear)
         ui.button('Clear', on_click=container.clear)
 
 
-    @example(ui.expansion, skip=False)
+    @example(ui.expansion)
     def expansion_example():
     def expansion_example():
         with ui.expansion('Expand!', icon='work').classes('w-full'):
         with ui.expansion('Expand!', icon='work').classes('w-full'):
             ui.label('inside the expansion')
             ui.label('inside the expansion')
 
 
-    @example(ui.menu, skip=False)
+    @example(ui.menu)
     def menu_example():
     def menu_example():
         choice = ui.label('Try the menu.')
         choice = ui.label('Try the menu.')
         with ui.menu() as menu:
         with ui.menu() as menu:
@@ -371,17 +371,17 @@ Alternatively, you can remove individual elements with `remove(element)`, where
 Simply call the `tooltip(text:str)` method on UI elements to provide a tooltip.
 Simply call the `tooltip(text:str)` method on UI elements to provide a tooltip.
 
 
 For more artistic control you can nest tooltip elements and apply props, classes and styles.
 For more artistic control you can nest tooltip elements and apply props, classes and styles.
-''', skip=False)
+''')
     def tooltips_example():
     def tooltips_example():
         ui.label('Tooltips...').tooltip('...are shown on mouse over')
         ui.label('Tooltips...').tooltip('...are shown on mouse over')
         with ui.button().props('icon=thumb_up'):
         with ui.button().props('icon=thumb_up'):
             ui.tooltip('I like this').classes('bg-green')
             ui.tooltip('I like this').classes('bg-green')
 
 
-    @example(ui.notify, skip=False)
+    @example(ui.notify)
     def notify_example():
     def notify_example():
         ui.button('Say hi!', on_click=lambda: ui.notify('Hi!', close_button='OK'))
         ui.button('Say hi!', on_click=lambda: ui.notify('Hi!', close_button='OK'))
 
 
-    @example(ui.dialog, skip=False)
+    @example(ui.dialog)
     def dialog_example():
     def dialog_example():
         with ui.dialog() as dialog, ui.card():
         with ui.dialog() as dialog, ui.card():
             ui.label('Hello world!')
             ui.label('Hello world!')
@@ -394,7 +394,7 @@ For more artistic control you can nest tooltip elements and apply props, classes
 Dialogs can be awaited.
 Dialogs can be awaited.
 Use the `submit` method to close the dialog and return a result.
 Use the `submit` method to close the dialog and return a result.
 Canceling the dialog by clicking in the background or pressing the escape key yields `None`.
 Canceling the dialog by clicking in the background or pressing the escape key yields `None`.
-''', skip=False)
+''')
     def async_dialog_example():
     def async_dialog_example():
         with ui.dialog() as dialog, ui.card():
         with ui.dialog() as dialog, ui.card():
             ui.label('Are you sure?')
             ui.label('Are you sure?')
@@ -420,7 +420,7 @@ You can also apply [Tailwind](https://tailwindcss.com/) utility classes with the
 If you really need to apply CSS, you can use the `styles` method. Here the delimiter is `;` instead of a blank space.
 If you really need to apply CSS, you can use the `styles` method. Here the delimiter is `;` instead of a blank space.
 
 
 All three functions also provide `remove` and `replace` parameters in case the predefined look is not wanted in a particular styling.
 All three functions also provide `remove` and `replace` parameters in case the predefined look is not wanted in a particular styling.
-''', skip=False)
+''')
     def design_example():
     def design_example():
         ui.radio(['x', 'y', 'z'], value='x').props('inline color=green')
         ui.radio(['x', 'y', 'z'], value='x').props('inline color=green')
         ui.button().props('icon=touch_app outline round').classes('shadow-lg')
         ui.button().props('icon=touch_app outline round').classes('shadow-lg')
@@ -444,7 +444,7 @@ You can run a function or coroutine as a parallel task by passing it to one of t
 - `ui.on_disconnect`: Called when a client disconnects from NiceGUI. (Optional argument: socket)
 - `ui.on_disconnect`: Called when a client disconnects from NiceGUI. (Optional argument: socket)
 
 
 When NiceGUI is shut down or restarted, the startup tasks will be automatically canceled.
 When NiceGUI is shut down or restarted, the startup tasks will be automatically canceled.
-''')
+''', skip=True)
     def lifecycle_example():
     def lifecycle_example():
         global countdown
         global countdown
         import asyncio
         import asyncio
@@ -458,7 +458,7 @@ When NiceGUI is shut down or restarted, the startup tasks will be automatically
 
 
         # ui.on_connect(countdown)
         # ui.on_connect(countdown)
 
 
-    @example(ui.timer, skip=False)
+    @example(ui.timer)
     def timer_example():
     def timer_example():
         from datetime import datetime
         from datetime import datetime
 
 
@@ -476,7 +476,7 @@ When NiceGUI is shut down or restarted, the startup tasks will be automatically
             lazy_clock = ui.label()
             lazy_clock = ui.label()
             ui.timer(interval=0.1, callback=lazy_update)
             ui.timer(interval=0.1, callback=lazy_update)
 
 
-    @example(ui.keyboard, skip=False)
+    @example(ui.keyboard)
     def keyboard_example():
     def keyboard_example():
         from nicegui.events import KeyEventArguments
         from nicegui.events import KeyEventArguments
 
 
@@ -508,7 +508,7 @@ Binding is possible for UI element properties like text, value or visibility and
 Each element provides methods like `bind_value` and `bind_visibility` to create a two-way binding with the corresponding property.
 Each element provides methods like `bind_value` and `bind_visibility` to create a two-way binding with the corresponding property.
 To define a one-way binding use the `_from` and `_to` variants of these methods.
 To define a one-way binding use the `_from` and `_to` variants of these methods.
 Just pass a property of the model as parameter to these methods to create the binding.
 Just pass a property of the model as parameter to these methods to create the binding.
-''', skip=False)
+''')
     def bindings_example():
     def bindings_example():
         class Demo:
         class Demo:
             def __init__(self):
             def __init__(self):
@@ -526,7 +526,7 @@ Just pass a property of the model as parameter to these methods to create the bi
 NiceGUI tries to automatically synchronize the state of UI elements with the client, e.g. when a label text, an input value or style/classes/props of an element have changed.
 NiceGUI tries to automatically synchronize the state of UI elements with the client, e.g. when a label text, an input value or style/classes/props of an element have changed.
 In other cases, you can explicitly call `element.update()` or `ui.update(*elements)` to update.
 In other cases, you can explicitly call `element.update()` or `ui.update(*elements)` to update.
 The example code shows both methods for a `ui.table`, where it is difficult to automatically detect changes in the `options` dictionary.
 The example code shows both methods for a `ui.table`, where it is difficult to automatically detect changes in the `options` dictionary.
-''')
+''', skip=True)
     def ui_updates_example():
     def ui_updates_example():
         from random import randint
         from random import randint
 
 
@@ -547,7 +547,7 @@ The example code shows both methods for a `ui.table`, where it is difficult to a
 Most elements also support asynchronous event handlers.
 Most elements also support asynchronous event handlers.
 
 
 Note: You can also pass a `functools.partial` into the `on_click` property to wrap async functions with parameters.
 Note: You can also pass a `functools.partial` into the `on_click` property to wrap async functions with parameters.
-''', skip=False)
+''')
     def async_handlers_example():
     def async_handlers_example():
         import asyncio
         import asyncio
 
 
@@ -560,7 +560,7 @@ Note: You can also pass a `functools.partial` into the `on_click` property to wr
 
 
     h3('Pages')
     h3('Pages')
 
 
-    @example(ui.page, skip=False)
+    @example(ui.page)
     def page_example():
     def page_example():
         @ui.page('/other_page')
         @ui.page('/other_page')
         def other_page():
         def other_page():
@@ -589,7 +589,7 @@ Here, the displayed ID remains constant when the browser reloads the page.
 
 
 All elements that are not created within a decorated page function are automatically added to a new, *shared* index page at route "/".
 All elements that are not created within a decorated page function are automatically added to a new, *shared* index page at route "/".
 To make it "private" or to change other attributes like title, favicon etc. you can wrap it in a page function with `@ui.page('/', ...)` decorator.
 To make it "private" or to change other attributes like title, favicon etc. you can wrap it in a page function with `@ui.page('/', ...)` decorator.
-''')
+''', skip=True)
     def shared_and_private_pages_example():
     def shared_and_private_pages_example():
         from uuid import uuid4
         from uuid import uuid4
 
 
@@ -609,7 +609,7 @@ To make it "private" or to change other attributes like title, favicon etc. you
 Page routes can contain parameters like [FastAPI](https://fastapi.tiangolo.com/tutorial/path-params/>).
 Page routes can contain parameters like [FastAPI](https://fastapi.tiangolo.com/tutorial/path-params/>).
 If type-annotated, they are automatically converted to bool, int, float and complex values.
 If type-annotated, they are automatically converted to bool, int, float and complex values.
 If the page function expects a `request` argument, the request object is automatically provided.
 If the page function expects a `request` argument, the request object is automatically provided.
-''', skip=False)
+''')
     def page_with_path_parameters_example():
     def page_with_path_parameters_example():
         @ui.page('/repeat/{word}/{count}')
         @ui.page('/repeat/{word}/{count}')
         def page(word: str, count: int):
         def page(word: str, count: int):
@@ -625,7 +625,7 @@ All code below that statement is executed after the websocket connection between
 
 
 For example, this allows you to run JavaScript commands; which is only possible with a client connection (see [#112](https://github.com/zauberzeug/nicegui/issues/112)).
 For example, this allows you to run JavaScript commands; which is only possible with a client connection (see [#112](https://github.com/zauberzeug/nicegui/issues/112)).
 Also it is possible to do async stuff while the user already sees some content.
 Also it is possible to do async stuff while the user already sees some content.
-    ''', skip=False)
+    ''')
     def wait_for_handshake_example():
     def wait_for_handshake_example():
         import asyncio
         import asyncio
 
 
@@ -650,7 +650,7 @@ See <https://quasar.dev/layout/header-and-footer> and <https://quasar.dev/layout
 `elevated`, `bordered` and many more.
 `elevated`, `bordered` and many more.
 With `ui.page_sticky` you can place an element "sticky" on the screen.
 With `ui.page_sticky` you can place an element "sticky" on the screen.
 See <https://quasar.dev/layout/page-sticky> for more information.
 See <https://quasar.dev/layout/page-sticky> for more information.
-    ''', skip=False)
+    ''')
     def page_layout_example():
     def page_layout_example():
         @ui.page('/page_layout')
         @ui.page('/page_layout')
         async def page_layout():
         async def page_layout():
@@ -667,7 +667,7 @@ See <https://quasar.dev/layout/page-sticky> for more information.
 
 
         ui.link('show page with fancy layout', page_layout)
         ui.link('show page with fancy layout', page_layout)
 
 
-    @example(ui.open, skip=False)
+    @example(ui.open)
     def ui_open_example():
     def ui_open_example():
         @ui.page('/yet_another_page')
         @ui.page('/yet_another_page')
         def yet_another_page():
         def yet_another_page():
@@ -683,7 +683,7 @@ It is invoked for each new connection to the page.
 
 
 The optional `request` argument provides insights about the clients URL parameters etc. (see [the JustPy docs](https://justpy.io/tutorial/request_object/) for more details).
 The optional `request` argument provides insights about the clients URL parameters etc. (see [the JustPy docs](https://justpy.io/tutorial/request_object/) for more details).
 It also enables you to identify sessions over [longer time spans by configuring cookies](https://justpy.io/tutorial/sessions/).
 It also enables you to identify sessions over [longer time spans by configuring cookies](https://justpy.io/tutorial/sessions/).
-''')
+''', skip=True)
     def sessions_example():
     def sessions_example():
         from collections import Counter
         from collections import Counter
         from datetime import datetime
         from datetime import datetime
@@ -709,7 +709,7 @@ It also enables you to identify sessions over [longer time spans by configuring
 With `ui.run_javascript()` you can run arbitrary JavaScript code on a page that is executed in the browser.
 With `ui.run_javascript()` you can run arbitrary JavaScript code on a page that is executed in the browser.
 The asynchronous function will return after the command(s) are executed.
 The asynchronous function will return after the command(s) are executed.
 You can also set `respond=False` to send a command without waiting for a response.
 You can also set `respond=False` to send a command without waiting for a response.
-''', skip=False)
+''')
     def javascript_example():
     def javascript_example():
         async def alert():
         async def alert():
             await ui.run_javascript('alert("Hello!")', respond=False)
             await ui.run_javascript('alert("Hello!")', respond=False)
@@ -747,7 +747,7 @@ The environment variables `HOST` and `PORT` can also be used to configure NiceGU
 
 
 To avoid the potentially costly import of Matplotlib, you set the environment variable `MATPLOTLIB=false`.
 To avoid the potentially costly import of Matplotlib, you set the environment variable `MATPLOTLIB=false`.
 This will make `ui.plot` and `ui.line_plot` unavailable.
 This will make `ui.plot` and `ui.line_plot` unavailable.
-''', skip=False)
+''')
     def ui_run_example():
     def ui_run_example():
         ui.label('dark page on port 7000 without reloading')
         ui.label('dark page on port 7000 without reloading')
 
 

+ 1 - 1
website/example.py

@@ -13,7 +13,7 @@ SPECIAL_CHARACTERS = re.compile('[^(a-z)(A-Z)(0-9)-]')
 
 
 class example:
 class example:
 
 
-    def __init__(self, content: Union[Callable, type, str], tight: bool = False, skip: bool = True) -> None:
+    def __init__(self, content: Union[Callable, type, str], tight: bool = False, skip: bool = False) -> None:
         self.content = content
         self.content = content
         self.markdown_classes = f'mr-8 w-full flex-none lg:w-{48 if tight else 80} xl:w-80'
         self.markdown_classes = f'mr-8 w-full flex-none lg:w-{48 if tight else 80} xl:w-80'
         self.rendering_classes = f'w-{48 if tight else 64} flex-none lg:mt-12'
         self.rendering_classes = f'w-{48 if tight else 64} flex-none lg:mt-12'