mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-22 11:45:28 -05:00
lint
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from textwrap import dedent
|
||||
|
||||
import examples
|
||||
import styles
|
||||
from pyweb import pydom
|
||||
from pyweb.ui import elements as el
|
||||
from pyweb.ui import shoelace
|
||||
@@ -7,9 +9,6 @@ from pyweb.ui.markdown import markdown
|
||||
|
||||
from pyscript import when, window
|
||||
|
||||
import styles
|
||||
import examples
|
||||
|
||||
MAIN_PAGE_MARKDOWN = dedent(
|
||||
"""
|
||||
## What is pyweb.ui?
|
||||
@@ -58,7 +57,8 @@ def create_component_details(component):
|
||||
example,
|
||||
shoelace.Details(
|
||||
el.div(
|
||||
examples_gallery[component]["code"], style=styles.STYLE_CODE_BLOCK
|
||||
examples_gallery[component]["code"],
|
||||
style=styles.STYLE_CODE_BLOCK,
|
||||
),
|
||||
summary="View Code",
|
||||
style={"background-color": "gainsboro"},
|
||||
@@ -137,7 +137,7 @@ def create_main_area():
|
||||
"""
|
||||
div = el.div(
|
||||
[
|
||||
el.h1("Welcome to PyDom UI!", style={"text-align": "center"}),
|
||||
el.h1("Welcome to PyWeb UI!", style={"text-align": "center"}),
|
||||
markdown(MAIN_PAGE_MARKDOWN),
|
||||
]
|
||||
)
|
||||
@@ -199,8 +199,10 @@ def create_basic_components_page():
|
||||
btn = el.button("Click me!")
|
||||
when("click", btn)(lambda: window.alert("Clicked!"))
|
||||
|
||||
btn_code = dedent("""btn = button("Click me!")
|
||||
when('click', btn)(lambda: window.alert("Clicked!"))""")
|
||||
btn_code = dedent(
|
||||
"""btn = button("Click me!")
|
||||
when('click', btn)(lambda: window.alert("Clicked!"))"""
|
||||
)
|
||||
|
||||
div.append(create_component_example(btn, btn_code))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user