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

Render from String as opposed from defining a template struct pointing to a file? #110

Open
fcoury opened this issue Feb 3, 2023 · 2 comments
Labels
Status: PR Welcome Welcome to Pull Request Type: Feature New Feature

Comments

@fcoury
Copy link

fcoury commented Feb 3, 2023

Is is possible to render directly from a String using dynamic attributes?

@svelterust
Copy link

Doubt it. This crate is compile time based.

@Kogia-sima
Copy link
Member

Although sailfish can't parse runtime template, Rendering based on compile-time string should be possible like this:

#[derive(TemplateOnce)]
#[template = "<div><%= name %></div>"]
struct Template {
    name: String
}

@Kogia-sima Kogia-sima added Type: Feature New Feature Status: PR Welcome Welcome to Pull Request labels Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: PR Welcome Welcome to Pull Request Type: Feature New Feature
Projects
None yet
Development

No branches or pull requests

3 participants