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

Formatting template files #4

Open
Nutomic opened this issue Jul 13, 2022 · 3 comments
Open

Formatting template files #4

Nutomic opened this issue Jul 13, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Nutomic
Copy link
Member

Nutomic commented Jul 13, 2022

The HTML in template files is currently rather messy, It would be good if it could be formatted nicely with an automated formatter, similar to cargo fmt. So far i found two possible tools, but neither of them really works for our usecase:

@dessalines
Copy link
Member

If you used yew.rs, you could move all the template html to rust, as well as get rid of the rocket back-end entirely.

@Nutomic
Copy link
Member Author

Nutomic commented Sep 26, 2022

Sounds like it wouldnt work without js in that case, which i want to avoid. I also dont want to translate templates to another language, tried that before and its a ton of work for very little benefit. Right now i can simply copy-paste most of the html and use it directly.

@dessalines
Copy link
Member

Yew uses an html! macro but ya it would probably still be a lot of work... only worth it if you had very few templates.

Yew also has SSR(renderToString()) and isomorphic app support tho, so if the site doesn't need javascript, its still usable. I'm considering using it for future web apps even tho its slower than inferno and solidjs, just because working in rust is so much nicer.

Nutomic added a commit that referenced this issue Oct 26, 2022
* Run prettier formatter as part of ci (ref #4)

* fix docker image

* fix prettier path

* format files

* clean rust code

* fix clippy
@Nutomic Nutomic added the enhancement New feature or request label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants