docs: enhance Go 1.24 tools feature documentation
Summary
- Add documentation about using templ as a Go tool with the Go 1.24 tools directive
- Enhance the installation guide with clean, simple documentation
- Add helpful tip in CLI documentation with cross-reference to installation guide
Changes
- Installation guide: Added "Using templ as a Go tool" section with proper Docusaurus formatting
- CLI documentation: Added tip about using
go tool templwith link to installation guide - Improved user experience: Clear guidance on the Go 1.24 tools approach without overstating its adoption
Test plan
- [x] Verify documentation renders correctly in Docusaurus (tested locally with
npm run build) - [x] Ensure all internal links work properly
Resolves #1067
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
Thanks for all the feedback! I've addressed all the review comments:
Changes Made
Installation Documentation
- ✅ Removed "Recommended" from title and content - Changed to "Using templ as a Go tool" since Go 1.24 requirement limits adoption
- ✅ Simplified content - Removed detailed bullet points and examples for cleaner documentation
- ✅ Fixed Docusaurus admonition - Used proper
:::infosyntax with correct formatting
CLI Documentation
- ✅ Fixed admonition formatting - Added proper empty lines and correct
:::tipsyntax according to Docusaurus documentation - ✅ Updated internal link - Fixed reference to match new heading format
Verification
- ✅ Build tested - Ran
npm run buildsuccessfully to verify all Docusaurus formatting works correctly - ✅ All feedback addressed - Every review comment has been implemented
The documentation is now much cleaner and follows the recommended formatting practices. Ready for re-review!
CI is failing with a test in cmd/templ/generatecmd/testwatch - this appears to be a flaky test unrelated to my documentation changes:
panic: send on closed channel
goroutine 183 [running]:
github.com/a-h/templ/cmd/templ/generatecmd/watcher.(*RecursiveWatcher).loop.func1()
/home/runner/work/templ/templ/cmd/templ/generatecmd/watcher/watch.go:118 +0x29
FAIL github.com/a-h/templ/cmd/templ/generatecmd/testwatch 66.303s
This looks like a race condition in the file watcher tests rather than anything related to the documentation updates in this PR. The recent main branch CI runs have been successful, suggesting this might be an intermittent issue.
Should I rebase to trigger a fresh CI run, or is this a known flaky test?
Yes, it's a race condition in the tests. Some of the tests don't use the fsnotify constructor, so some internal state of the fsnotify struct wasn't properly set. I've updated the main branch.