Skip to content

fix: SVG content args missing #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,32 @@ def template():
el.a(href="/", class_name="d-flex align-items-center text-dark text-decoration-none", *(
el.svg(width=40, height=32, class_name="me-2", viewBox="0 0 118 94", *(
el.path(fill_rule="evenodd", clip_rule="evenodd", fill="currentColor", d=(
"""
M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943
39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28
14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893
11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624
10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214
5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2
2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01
10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884
0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167
0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z
"""
"""
M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943
39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28
14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893
11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624
10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214
5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2
2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01
10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884
0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167
0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z
"""
)),
)),
el.span("Jumbotron example", class_name="fs-4")
)),
el.span("Jumbotron example", class_name="fs-4")
)
),
el.div(class_name="p-5 mb-4 bg-light rounded-3", *(
el.div(class_name="container-fluid py-5", *(
el.h1("Custom jumbotron", class_name="display-5 fw-bold"),
el.p("""
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.
Check out the examples below for how you can remix and restyle it to your liking.
""", class_name="col-md-8 fs-4"
),
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.
Check out the examples below for how you can remix and restyle it to your liking.
""", class_name="col-md-8 fs-4"
),
el.button("Example button", class_name="btn btn-primary btn-lg", type="button")
)),
)),
Expand Down
Binary file modified docs/images/readme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion py_html/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""PyHTMLBuilder is HTML in python objects"""

__version__ = "0.1.1"
__version__ = "0.1.2"
2 changes: 2 additions & 0 deletions py_html/el/elements/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class Svg(BaseHTML):

def __init__(
self,
*content: t.Any,
height: t.Optional[t.Any] = None,
width: t.Optional[t.Any] = None,
xmlns: str = "http://www.w3.org/2000/svg",
Expand All @@ -170,6 +171,7 @@ def __init__(
**attrs,
) -> None:
super().__init__(
*content,
height=height,
width=width,
xmlns=xmlns,
Expand Down
37 changes: 33 additions & 4 deletions samples/readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,37 @@ def template():
el.a(
href="/",
class_name="d-flex align-items-center text-dark text-decoration-none",
*(
el.svg(
width=40,
height=32,
class_name="me-2",
viewBox="0 0 118 94",
*(
el.path(
fill_rule="evenodd",
clip_rule="evenodd",
fill="currentColor",
d=(
"""
M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943
39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28
14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893
11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624
10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214
5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2
2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01
10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884
0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167
0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z
"""
),
),
),
),
el.span("Jumbotron example", class_name="fs-4"),
),
),
el.span("Jumbotron example", class_name="fs-4"),
),
),
el.div(
Expand All @@ -40,9 +69,9 @@ def template():
),
el.p(
"""
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.
Check out the examples below for how you can remix and restyle it to your liking.
""",
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.
Check out the examples below for how you can remix and restyle it to your liking.
""",
class_name="col-md-8 fs-4",
),
el.button(
Expand Down