Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shahriyardx/py-easy-html
Generate HTML using python and also convert to PDF
https://github.com/shahriyardx/py-easy-html
Last synced: 9 days ago
JSON representation
Generate HTML using python and also convert to PDF
- Host: GitHub
- URL: https://github.com/shahriyardx/py-easy-html
- Owner: shahriyardx
- License: mit
- Created: 2022-11-16T09:08:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T08:31:30.000Z (about 1 year ago)
- Last Synced: 2024-09-19T08:19:45.472Z (about 2 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Easy HTML
Generate HTML using python and also convert to PDF.# Installation
```sh
pip install py-easy-html
```# Getting started
General usage
```py
h1 = generate_tag('h1', body='This is a h1', class_name="your_class", id_name="your_id", self_closing=False)
```
> Output
```htmlThis is a h1
```You can also do nested tags
```py
h1 = generate_tag('h1', body=generate_tag('span', body='Span inside h1'))
```
> Output
```html
Span inside h1
```And also multiple nested tags
```py
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
```html
First Span
Second
```