Skip to content

Commit 365f26b

Browse files
authored
Merge pull request #3 from python-ellar/svg_fix
fix: SVG content args missing
2 parents 5a36988 + ad2cb0b commit 365f26b

File tree

5 files changed

+53
-22
lines changed

5 files changed

+53
-22
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,32 @@ def template():
4545
el.a(href="/", class_name="d-flex align-items-center text-dark text-decoration-none", *(
4646
el.svg(width=40, height=32, class_name="me-2", viewBox="0 0 118 94", *(
4747
el.path(fill_rule="evenodd", clip_rule="evenodd", fill="currentColor", d=(
48-
"""
49-
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
50-
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
51-
14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893
52-
11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624
53-
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
54-
5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2
55-
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
56-
10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884
57-
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
58-
0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z
59-
"""
48+
"""
49+
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
50+
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
51+
14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893
52+
11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624
53+
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
54+
5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2
55+
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
56+
10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884
57+
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
58+
0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z
59+
"""
6060
)),
6161
)),
62+
el.span("Jumbotron example", class_name="fs-4")
6263
)),
63-
el.span("Jumbotron example", class_name="fs-4")
6464
)
6565
),
6666
el.div(class_name="p-5 mb-4 bg-light rounded-3", *(
6767
el.div(class_name="container-fluid py-5", *(
6868
el.h1("Custom jumbotron", class_name="display-5 fw-bold"),
6969
el.p("""
70-
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.
71-
Check out the examples below for how you can remix and restyle it to your liking.
72-
""", class_name="col-md-8 fs-4"
73-
),
70+
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.
71+
Check out the examples below for how you can remix and restyle it to your liking.
72+
""", class_name="col-md-8 fs-4"
73+
),
7474
el.button("Example button", class_name="btn btn-primary btn-lg", type="button")
7575
)),
7676
)),

docs/images/readme.png

-6.56 KB
Loading

py_html/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""PyHTMLBuilder is HTML in python objects"""
22

3-
__version__ = "0.1.1"
3+
__version__ = "0.1.2"

py_html/el/elements/images.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ class Svg(BaseHTML):
162162

163163
def __init__(
164164
self,
165+
*content: t.Any,
165166
height: t.Optional[t.Any] = None,
166167
width: t.Optional[t.Any] = None,
167168
xmlns: str = "http://www.w3.org/2000/svg",
@@ -170,6 +171,7 @@ def __init__(
170171
**attrs,
171172
) -> None:
172173
super().__init__(
174+
*content,
173175
height=height,
174176
width=width,
175177
xmlns=xmlns,

samples/readme.py

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,37 @@ def template():
2525
el.a(
2626
href="/",
2727
class_name="d-flex align-items-center text-dark text-decoration-none",
28+
*(
29+
el.svg(
30+
width=40,
31+
height=32,
32+
class_name="me-2",
33+
viewBox="0 0 118 94",
34+
*(
35+
el.path(
36+
fill_rule="evenodd",
37+
clip_rule="evenodd",
38+
fill="currentColor",
39+
d=(
40+
"""
41+
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
42+
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
43+
14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893
44+
11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624
45+
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
46+
5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2
47+
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
48+
10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884
49+
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
50+
0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z
51+
"""
52+
),
53+
),
54+
),
55+
),
56+
el.span("Jumbotron example", class_name="fs-4"),
57+
),
2858
),
29-
el.span("Jumbotron example", class_name="fs-4"),
3059
),
3160
),
3261
el.div(
@@ -40,9 +69,9 @@ def template():
4069
),
4170
el.p(
4271
"""
43-
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.
44-
Check out the examples below for how you can remix and restyle it to your liking.
45-
""",
72+
Using a series of utilities, you can create this jumbotron, just like the one in previous versions of Bootstrap.
73+
Check out the examples below for how you can remix and restyle it to your liking.
74+
""",
4675
class_name="col-md-8 fs-4",
4776
),
4877
el.button(

0 commit comments

Comments
 (0)