33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
from pyx import DIV, H1, P, IMG, A, HTML, HEAD, BODY, STYLE, Capture
|
|
from user_styles import UserMadeSheet
|
|
|
|
|
|
output = Capture(
|
|
DIV
|
|
[
|
|
H1["Welcome!"],
|
|
A(css=(UserMadeSheet.Anchor), href="www.site.com")
|
|
[
|
|
IMG(src="image.png")
|
|
],
|
|
P(css=UserMadeSheet.Paragraph)
|
|
[
|
|
"""hello and lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
|
|
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
|
|
in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
|
|
deserunt mollit anim id est laborum."""
|
|
]
|
|
]
|
|
)
|
|
|
|
with open("example.html", "w") as file:
|
|
file.write(f'<!doctype html>{HTML[
|
|
HEAD[
|
|
STYLE[ output.css ]
|
|
],
|
|
BODY[ output.html ]
|
|
]}')
|