mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 11:15:36 -05:00
precommit
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from pyodide.ffi import to_js
|
||||
|
||||
from pyscript import window
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from textwrap import dedent
|
||||
|
||||
from pyscript import document, when, window
|
||||
from pyweb import JSProperty, js_property, pydom
|
||||
|
||||
from pyscript import document, when, window
|
||||
|
||||
|
||||
class ElementBase(pydom.Element):
|
||||
tag = "div"
|
||||
@@ -128,10 +129,17 @@ class style(TextElementBase):
|
||||
style=None,
|
||||
**kwargs
|
||||
):
|
||||
super().__init__(content=content, blocking=blocking, title=title,
|
||||
nonce=nonce, media=media, style=style, **kwargs
|
||||
super().__init__(
|
||||
content=content,
|
||||
blocking=blocking,
|
||||
title=title,
|
||||
nonce=nonce,
|
||||
media=media,
|
||||
style=style,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
||||
class script(TextElementBase):
|
||||
tag = "script"
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
"""Markdown module to generate web/HTML components from Markdown code"""
|
||||
from pyscript import document, window
|
||||
from pyweb import pydom
|
||||
from pyweb.ui.elements import TextElementBase, script
|
||||
|
||||
from pyscript import document, window
|
||||
|
||||
|
||||
class markdown(TextElementBase):
|
||||
"""Markdown component to render HTML from Markdown code"""
|
||||
|
||||
@@ -14,6 +16,7 @@ class markdown(TextElementBase):
|
||||
html = window.marked.parse(content)
|
||||
super().__init__(html, style=style, **kwargs)
|
||||
|
||||
|
||||
# TODO: DON'T KNOW WHY BUT THIS DOESN'T WORK
|
||||
def load_resources(parent=None):
|
||||
if parent is None:
|
||||
@@ -23,4 +26,5 @@ def load_resources(parent=None):
|
||||
script(src="https://cdn.jsdelivr.net/npm/marked@11.1.1/lib/marked.umd.min.js"),
|
||||
)
|
||||
|
||||
# load_resources()
|
||||
|
||||
# load_resources()
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import string
|
||||
from textwrap import dedent
|
||||
|
||||
from pyscript import document, when, window
|
||||
from pyweb import JSProperty, js_property, pydom
|
||||
from pyweb.ui import elements as el
|
||||
|
||||
from pyscript import document, when, window
|
||||
|
||||
|
||||
class ShoeBase(pydom.Element):
|
||||
tag = "div"
|
||||
@@ -390,6 +391,8 @@ CSS = """
|
||||
align-items: center;
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
def load_resources(parent=None):
|
||||
print("Loading shoelace resources...")
|
||||
if parent is None:
|
||||
|
||||
Reference in New Issue
Block a user