Skip to main content

Crate basecoat_macros

Crate basecoat_macros 

Source
Expand description

basecoat-macros — the rsx! proc-macro for basecoat-rs.

§Usage

use basecoat_macros::rsx;

let markup = rsx! { <Button variant="primary">"Click me"</Button> };

See SYNTAX.md in this crate for the full language specification.

§Crate architecture

  • parse — rstml → internal RsxNode AST.
  • emitRsxNode AST → proc_macro2::TokenStream.
  • props — static tables: known typed setters per component, void element list, PascalCase → snake_case conversion.

The emitted code calls:

  • ::basecoat_core::* for prop types.
  • ::basecoat_components::* for component functions.
  • ::basecoat_macros_rt::escape_text / escape_attr for runtime escaping.

Macros§

rsx
JSX-like template macro that emits pre-rendered HTML as ::basecoat_core::Markup.