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.1.0.tar.gz (1.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.1.0-py3-none-any.whl (1.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for reactpy_html_string_compiler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54d2ca0590e65bf0f660fa346eeec5cef21692dd01348c0d9c3a69c086ddd639
MD5 29583c44dcfa5d916c2c88d8171570d1
BLAKE2b-256 24ab3d3d5cbff4a3c62253e38a1b84aa0bbb87837f6a7352adba1edf7560c789

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reactpy_html_string_compiler-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77126db8470ef7ddc3acd662c703f61b98a268a8708070b2fd04d2b4999f7045
MD5 3b1435c350ef03a5fb0b9fd7579707cb
BLAKE2b-256 16415126e87c4703a605b8cec7be3cee6d48d2759cb0ae17a585ef0bcac55a2d

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