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

docs: possibility of using attributes in markup::define! #42

Open
j-n-f opened this issue Oct 6, 2024 · 0 comments
Open

docs: possibility of using attributes in markup::define! #42

j-n-f opened this issue Oct 6, 2024 · 0 comments

Comments

@j-n-f
Copy link

j-n-f commented Oct 6, 2024

I was working with this crate trying to think of how to log/serialize the objects being rendered into a view (for debugging), and I noticed the code implementing the macro had attributes near where the struct for each template gets created.

I tried it out, and it looks like it's possible to do something like:

markup::define! {
    #[derive(Debug, Serialize)]
    SomeTemplate(a: bool, b: bool, c: bool) {
        // ...
    }
}

It wasn't immediately obvious to me that each entry in define! behaves more or less like struct SomeTemplate {}. I think that's pretty awesome functionality that the docs could highlight.

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

No branches or pull requests

1 participant