Skip to main content

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


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)

Uploaded Source

Built Distribution

py_easy_html-0.0.2-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page