Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the way to create a full document #423

Open
real-felix opened this issue Feb 25, 2024 · 3 comments
Open

Document the way to create a full document #423

real-felix opened this issue Feb 25, 2024 · 3 comments

Comments

@real-felix
Copy link

Hello, I am using Maud more and more along with htmx, and I really like it. It just took me a bit of time to understand how to return a full document. This is what I came up with:

pub fn document(markup: maud::Markup) -> maud::Markup {
    maud::html! {
        (maud::DOCTYPE)
        html lang="en" {
            head {
                meta charset="UTF-8";
                meta name="viewport" content="width=device-width, initial-scale=1.0";
                link rel="stylesheet" href="index.css";
                script src="https://unpkg.com/[email protected]" {}
                title { "My Cool WebApp" }
            }

            body { (markup) }
        }
    }
}

Maybe it could be documented somewhere?

@louiseyousre
Copy link

That's exactly what I came up with too

@Anonyfox
Copy link

Anonyfox commented May 7, 2024

thats actually a very clean way I'd say. as simple and straightforward as it gets

@warsaw
Copy link

warsaw commented May 28, 2024

I needed exactly this and it works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants