Skip to main content

compiles reactpy components into html string

Project description

Reactpy Html String Compiler

compiles ReactPy Components into a HTML String

Why would you use this?

you could use the converted html string in flask or other templating engines

How to use this?

this module has only 1 function, compiler(component : Reactpy.Types.Component) -> str, which takes in a reactpy component and returns a string

    from reactpy import component, html
    from reactpy_html_string_compiler import compiler
    from flask import Flask # or any other backend

    @component
    def header():
        return html.h1("Hello, World", {"id": "header"})

    # utilizing component

    app = Flask(__name__)

    @app.route("/")
    def index():
        return compiler(header()) # -> <h1 id="header">Hello, World</h1>

    app.run('0.0.0.0', 3000)

dependencies

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

reactpy_html_string_compiler-0.3.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reactpy_html_string_compiler-0.3.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file reactpy_html_string_compiler-0.3.0.tar.gz.

File metadata

File hashes

Hashes for reactpy_html_string_compiler-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a802b0d517b85bb05766c8cf84e52fff8f809bae80682d03c1bcb45b015ea570
MD5 3959cc7e65e2b49b248deec386f47caa
BLAKE2b-256 16b60ecff8dbdafaad9b5bf0642016e58299b2d2c07416e6e9884110305f821d

See more details on using hashes here.

File details

Details for the file reactpy_html_string_compiler-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reactpy_html_string_compiler-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f261eeba1a17a0c1228888479abf284d5dee5a7baf9aa3811895c4a8d0f11c6
MD5 c396820e0849f49fd4b976eea948d26d
BLAKE2b-256 1737404796e4db6ebe36da42c63a1f1ece58e149daa218a3d637b869a8bd818e

See more details on using hashes here.

Supported by

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