We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As noted in #35, templ currently requires a `{% package "packageName" %} at the top of each file.
This is the same behaviour as Go, but to make it faster to write templates, the following approach could be used:
templ fmt
package
The automatic package algorithm:
*.templ
main
This is simpler than attempting to read any Go files that already exist in the directory.
The text was updated successfully, but these errors were encountered:
To test the fmt command, I used a sample file:
fmt
{% templ test() %} Hello {% endtempl %}
templ fmt rewrote it to include:
{% package testimplicitpackage %}
Sorry, something went wrong.
Closed in 4234940
No branches or pull requests
As noted in #35, templ currently requires a `{% package "packageName" %} at the top of each file.
This is the same behaviour as Go, but to make it faster to write templates, the following approach could be used:
templ fmt
inserts missingpackage
instructions.The automatic package algorithm:
package
instruction in the*.templ
file if there is one.main
as the package if it's not, or a directory context is not available (e.g. parsing a string).This is simpler than attempting to read any Go files that already exist in the directory.
The text was updated successfully, but these errors were encountered: