Feat: update readme and examples

This commit is contained in:
Jonathan Kelley committed 2021-03-01 00:16:48 -05:00
1 parent c8bb392cad
commit ffaf687896
12 files changed
+608 -63

No files matched your search

+13
View File
@@ -12,6 +12,7 @@ use syn::{
mod fc;
mod htm;
mod ifmt;
mod rsxt;
// mod styles;
/// The html! macro makes it easy for developers to write jsx-style markup in their components.
@@ -25,6 +26,18 @@ pub fn html(s: TokenStream) -> TokenStream {
html.to_token_stream().into()
}
/// The html! macro makes it easy for developers to write jsx-style markup in their components.
/// We aim to keep functional parity with html templates.
#[proc_macro]
pub fn rsx(s: TokenStream) -> TokenStream {
let template: rsxt::RsxRender = match syn::parse(s) {
Ok(s) => s,
Err(e) => return e.to_compile_error().into(),
};
template.to_token_stream().into()
}
/// Label a function or static closure as a functional component.
/// This macro reduces the need to create a separate properties struct.
#[proc_macro_attribute]