diff --git a/docs/content/elements-attributes.md b/docs/content/elements-attributes.md index d496ebe..40733b6 100644 --- a/docs/content/elements-attributes.md +++ b/docs/content/elements-attributes.md @@ -84,25 +84,6 @@ html! { # ; ``` -## Optional attributes: `title=[Some("value")]` - -Add optional attributes to an element using `attr=[value]` syntax, with *square* brackets. -These are only rendered if the value is `Some<T>`, and entirely omitted if the value is `None`. - -```rust -# let _ = maud:: -html! { - p title=[Some("Good password")] { "Correct horse" } - - @let value = Some(42); - input value=[value]; - - @let title: Option<&str> = None; - p title=[title] { "Battery staple" } -} -# ; -``` - ## Empty attributes: `checked` Declare an empty attribute by omitting the value. diff --git a/docs/content/splices-toggles.md b/docs/content/splices-toggles.md index 457cf0d..4f97598 100644 --- a/docs/content/splices-toggles.md +++ b/docs/content/splices-toggles.md @@ -142,3 +142,22 @@ html! { } # ; ``` + +### Optional attributes with values: `title=[Some("value")]` + +Add optional attributes to an element using `attr=[value]` syntax, with *square* brackets. +These are only rendered if the value is `Some<T>`, and entirely omitted if the value is `None`. + +```rust +# let _ = maud:: +html! { + p title=[Some("Good password")] { "Correct horse" } + + @let value = Some(42); + input value=[value]; + + @let title: Option<&str> = None; + p title=[title] { "Battery staple" } +} +# ; +``` \ No newline at end of file