* Update `axum-core` depedency to 0.2
* Update doctest to use Axum 0.5
* Update CHANGELOG.md regarding axum
Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
* Update to axum-core 0.1
Together with the new 0.4 release of `axum` we made a new crate called
[`axum-core`]. `axum-core` has a small API and is less likely to receive
breaking changes. Therefore its recommended for libraries to depend on
`axum-core` instead of `axum`.
So this updates `maud` to use `axum-core`.
Note this is a breaking change since `axum-core` requires `axum` 0.4.
[`axum-core`]: https://crates.io/crates/axum-core
* Update changelog link
* fix test
# Overview
The following syntax will no longer work:
```rust
html! {
br /
link rel="stylesheet" href="styles.css" /
}
```
This should be changed to the following:
```rust
html! {
br;
link rel="stylesheet" href="styles.css";
}
```
# Rationale
The `;` syntax was introduced in #96; the rationale for it can be found there.
Removing support for the older `/` syntax will simplify the API surface, and allow for the space to be used for other things.
The Iron framework hasn't been updated in a long time. It still uses outdated versions of libraries like futures 0.1, hyper 0.12, url 1.7. We can clean up the repo by removing it. This will also slightly speed up CI.
* Add support for Option<T> attributes
Introduces the `attr=[value]` syntax that assumes `value` is an
`Option<T>`. Renders `attr="value"` for `Some(value)` and entirely
omits the attribute for `None`.
Implements and therefore closes#283.
* Call `Generator::splice` directly
* Handle struct literals (edge case)
Co-authored-by: Chris Wong <xbuns@google.com>
This introduces support for Tide by implementing `From` over markup.
Unlike other frameworks, Tide does not seem to provide e.g. a trait
which could instead be implemented. However as demonstrated, this
alternative results in a simple, ergonomic interface.
Consumers may leverage Tide support by using the "tide" feature.
Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
Removed references to `std` and replaced them with references to `core` and `alloc`.
Features `rocket` and `iron` still require `std`.
Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
* Add actix-web v3 support
* Add actix-web example
* Resolve changelog PR number
* Make sure that examples are built on CI
* Format Cargo.toml consistently
Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
When Rust and HTML syntax differ, Maud tends to side with Rust syntax.
This can be seen with string literals, for example, where we use
backslash escapes instead of HTML entities. Using `;` to terminate void
elements is consistent with this idea.
Moreover, this reduces confusion around the generated code. Maud does
not insert an extra slash into the HTML output (as per the spec) but
the syntax may imply otherwise.
This confusion may have been the cause of a [bug I found in the
wild][1], where the code omitted the trailing slash on an `input`
element. I suspect that this is because the author thought that a
trailing slash in the Maud template would lead to one in the HTML
output. Switching to semicolons would prevent this misconception.
[1]: https://github.com/anowell/quasar/pull/3