Metadata-Version: 2.1
Name: html-dsl
Version: 0.4.1
Summary: A HTML-DSL for Python
Home-page: https://github.com/duyixian1234/html_dsl
License: MIT
Author: duyixian
Author-email: duyixian1234@qq.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Project-URL: Repository, https://github.com/duyixian1234/html_dsl
Description-Content-Type: text/x-rst

html-dsl
--------
A HTML-DSL for Python


.. image:: https://github.com/duyixian1234/html_dsl/actions/workflows/ci.yml/badge.svg?branch=master
  :alt: CI
  :target: https://github.com/duyixian1234/html_dsl/actions/workflows/ci.yml

USE
---


>>> from html_dsl.elements import BaseHtmlElement
>>> from html_dsl.common import HTML, BODY, H1, P, DIV, SPAN
>>> html = HTML[
        BODY[
            H1["Title"],
            P(color="yellow")[
                "Hello, World.", SPAN["something in span"], "Out of the span"
            ],
            P["This is the second paragraph."],
            DIV[
                DIV(_class="row")[
                    DIV(_class="column", color="red")["col1"],
                    DIV(_class="column", color="blue")["col2"],
                    DIV(_class="column", color="green")["col3"],
                ]
            ],
        ]
    ]
>>> print(html)
<html>
  <body>
    <h1>
    Title
    </h1>
    <p color="yellow">
    Hello, World.
      <span>
      something in span
      </span>
    Out of the span
    </p>
    <p>
    This is the second paragraph.
    </p>
    <div>
      <div class="row">
        <div color="red" class="column">
        col1
        </div>
        <div color="blue" class="column">
        col2
        </div>
        <div color="green" class="column">
        col3
        </div>
      </div>
    </div>
  </body>
</html>

Install
-------

.. code-block:: shell
    
    pip install html_dsl


Author
------
Yixian Du

