Generate HTML using python and also convert to PDF.
Project description
Easy HTML
Generate HTML using python and also convert to PDF.
Installation
pip install py-easy-html
Getting started
General usage
h1 = generate_tag('h1', body='This is a h1', class_name="your_class", id_name="your_id", self_closing=False)
Output
<h1 class="your_class" id="your_id">This is a h1</h1>
<!-- With self_closing=True -->
<h1 class="your_class" id="your_id" />
You can also do nested tags
h1 = generate_tag('h1', body=generate_tag('span', body='Span inside h1'))
Output
<h1>
<span>Span inside h1</span>
</h1>
And also multiple nested tags
h1 = generate_tag(
'h1',
style={
"display": "flex",
"justify-content": "space-between",
"align-items": "center",
},
body=[
generate_tag('span', body='First Span'),
generate_tag('span', body='Second'),
],
)
Output
<h1 style="display: flex;justify-content: space-between;align-items: center;">
<span>First Span</span>
<span>Second</span>
</h1>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py-easy-html-0.0.2.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for py_easy_html-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4c7bfddf732c4a04f6140361239b8efbca2ef6285d8af8c1dc19073c48bb32a |
|
MD5 | e37a9c339c9a197c4767faf4ff3057e4 |
|
BLAKE2b-256 | 3bb2fd5a1abd6ec17d48adf239203b4bec16a7ad587f99996c6118c5a796312f |