Macro fhtml_macros::formatcp

source ·
formatcp!() { /* proc-macro */ }
Expand description

Creates a compile time &'static str with formatted HTML.

Since there are no suitable std macros for compile-time string formatting, fhtml::formatcp! is the only fhtml macro that uses a dependency: const_format. fhtml::formatcp! has the same syntax as fhtml::write!, with the biggest difference being: values are limited by what can be evaluated at compile-time.

Read about limitations and behaviours here.

§Examples

const HTML: &str = fhtml::formatcp!(<div>"Hello, World!"</div>);