tailwind2yew Tailwind Templates

Tailwind2yew

A Python program that converts tailwindui elements into yew frontend view macro with ease, uses PydanticAI and Google Gemini

tailwind2yew

A python program that transform tailwindui components into Rust's yew view macro, uses PydanticAI Agent Framework, and Free Gemini Flash Model.

The Issue

The way we use yew's Html! {} macro is quite different than other, there we need to put the data inside a tag to be covered in curly braces {} this is by design.

So when you tried to copy-paste(and improve) the component from tailwindui website, you will need to do the whole rewrite, just so to put the curly braces around the tag with a text in it and it is really becoming tedious really quick.

What this program try to accomplish is to bypass so that it will transform tailwindui components into yew compatible Html! {} macro with ease.

Installation

Install tailwind2yew with python environment already activated is highly recommended, check them here. Then run below command

  pip install -r requirements.txt

Environment Variables

After that, create new .env file and fill the Gemini Flash API like this, you can get them in this link

GEMINI_API_KEY

Demo

TOMORROW

Usage

  1. Create empty input.txt file and put the tailwindui html component into it input.txt ```
    Blog Image

    Studio by Mailchimp

    Produce professional, reliable streams easily leveraging Mailchimp's innovative broadcast studio.

``` 2. then run main.py 3. the output file will be in output.txt `output.txt` ```rust use yew::prelude::*;

fn blog_post_link() -> Html { html! {

} }

4. Then you can use the output into your rust yew project.

## FAQ

#### Is this free?

Yes, using gemini google flash, its free, but is limited. check them out https://aistudio.google.com/plan_information
## Other Question

If you have any other question, please post it in discussion tab

Top categories

Loading Svelte Themes