bram209 / leptosfmt

A formatter for the leptos view! macro
Apache License 2.0
274 stars 30 forks source link

usage with other framework #98

Closed jpx40 closed 2 months ago

jpx40 commented 11 months ago

Hey, can u use leptosfmt outside of leptos, for example with Sauron or yew.rs

bram209 commented 11 months ago

hey, currently it is specifically build for the view! macro of leptos and is able to format rstml https://github.com/rs-tml/rstml compatible syntax.

That said, with relatively little effort I could add support for other syntaxes as well and reuse components such as:

I might take up on this if I have a little bit more free time.

jpx40 commented 11 months ago

sry, i am relative new to Rust so i couldn't Really help.

jpx40 commented 11 months ago

but i will try to Contribute

SofusA commented 10 months ago

This would be awesome! I am using rstml-to-string-macro for a simple htmx site.

I have aliased their html! macro to view! which allows leptosfmt to pick up the macro:

macro_rules! view {
    ($($body:tt)*) => {
        html!($($body)*)
    };
}

It would be awesome to be able to input a range of macros to format with the cli.

Thanks for an awesome tool btw.