a-h/templ — 10.6k★ trên GitHub (Go). A language for writing HTML user interfaces in Go.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
An HTML templating language for Go that has great developer tooling.
Documentation
See user documentation at https://templ.guide
Tasks
version-set
Set the version of templ to the current version.
version set
build
Build a local version.
version set
cd cmd/templ
go build
install-snapshot
Build and install current version.
# Remove templ from the non-standard ~/bin/templ path
# that this command previously used.
rm -f ~/bin/templ
# Clear LSP logs.
rm -f cmd/templ/lspcmd/*.txt
# Update version.
version set
# Install to $GOPATH/bin or $HOME/go/bin
cd cmd/templ && go install
build-snapshot
Use goreleaser to build the command line binary using goreleaser.
goreleaser build --snapshot --clean
generate
Run templ generate using local version.
go run ./cmd/templ generate -include-version=false
test
Run Go tests.
version set
go run ./cmd/templ generate -include-version=false
go test ./...
test-short
Run Go tests.
version set
go run ./cmd/templ generate -include-version=false
go test ./... -short
test-cover
Run Go tests.
# Create test profile directories.
mkdir -p coverage/fmt
mkdir -p coverage/generate
mkdir -p coverage/version
mkdir -p coverage/unit
# Build the test binary.
go build -cover -o ./coverage/templ-cover ./cmd/templ
# Run the covered generate command.
GOCOVERDIR=coverage/fmt ./coverage/templ-cover fmt .
GOCOVERDIR=coverage/generate ./coverage/templ-cover generate -include-version=false
GOCOVERDIR=coverage/version ./coverage/templ-cover version
# Run the unit tests.
go test -cover ./... -coverpkg ./... -args -test.gocoverdir="$PWD/coverage/unit"
# Display the combined percentage.
go tool covdata percent -i=./coverage/fmt,./coverage/generate,./coverage/version,./coverage/unit
# Generate a text coverage profile for tooling to use.
go tool covdata textfmt -i=./coverage/fmt,./coverage/generate,./coverage/version,./coverage/unit -o coverage.out
# Print total
go tool cover -func coverage.out | grep total
Run the runtime and JavaScript tokenizer fuzz tests against their seed and committed corpora, without fuzzing. These fuzz tests are in separate modules, so that their JavaScript engine and parser dependencies are not dependencies of templ, and go test ./... in the root module doesn't run them. The parser fuzz tests are in the root module, so test and test-cover run their corpora.
(cd runtime/fuzzing && go test ./...) &&
(cd internal/jstokenizer/fuzzing && go test ./...)
benchmark
Run benchmarks.
go run ./cmd/templ generate -include-version=false && go test ./... -bench=. -benchmem
benchmark-fmt
Run the templ fmt benchmarks, which include the time taken by prettier.
go test ./internal/format -run '^$' -bench BenchmarkTempl -benchtime 3x
fmt
Format all Go and templ code.
gofmt -s -w .
go run ./cmd/templ fmt .
lint
Run the lint operations that are run as part of the CI.
golangci-lint run --verbose
vulncheck
Check for known vulnerabilities in dependencies that templ calls.
govulncheck ./...
bump-deps
Update Go dependencies in the root module and the fuzzing modules, then update the vendor hash in flake.nix. The fuzzing modules replace templ with the root module, so they must be tidied whenever the root module's dependencies change.
go get -u ./...
go mod tidy
(cd runtime/fuzzing && go get -u ./... && go mod tidy)
(cd internal/jstokenizer/fuzzing && go get -u ./... && go mod tidy)
nix-update --flake --version=skip templ
ensure-generated
Ensure that templ files have been generated with the local version of templ, and that those files have been added to git.
Requires: generate
git diff --exit-code
push-release-tag
Push a semantic version number to GitHub to trigger the release process.
a-h/templ có 10.6k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/a-h/templ. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
a-h/templ có những chủ đề gì?
GitHub topics của a-h/templ: "go", "html-elements", "htmx", "ide-support", "language-server", "lsp", "server-side-rendering", "templating-languages". TopGit xếp repo vào nhóm Backend.
a-h/templ có phải mã nguồn mở không?
Có — a-h/templ phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/a-h/templ.
a-h/templ có trang demo không?
Dự án có trang chủ ở https://templ.guide/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
a-h/templ còn đang phát triển không?
Commit gần nhất trên a-h/templ là 3 tháng trước (theo timestamp GitHub). Repo có 381 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Cùng nhóm Backend còn repo nào?
a-h/templ thuộc nhóm Backend trên TopGit, cùng 8 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về a-h/templ ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/a-h/templ là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc templ có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về templ.