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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for reactpy_html_string_compiler-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7d51c84671bdda881ab26abf4a4ff9cc54a01f9a7fe049044a1062219fde115a
MD5 5f176040df387e6a8c8108cefab5a466
BLAKE2b-256 82b837e01967e52e5b607c5ef930306d85d8358602313f54701f69dc406f43f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reactpy_html_string_compiler-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6dae92bc9bc415c6fe2bb12f36b1caeec67452445f2668a867879104de2df46
MD5 66cf5fda9db743901e54a34fc8f43419
BLAKE2b-256 995017769623d7efdfb90ce4ec1fc2525054c26a7fd2da54ca6dd03a13d5bd91

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