templ icon indicating copy to clipboard operation
templ copied to clipboard

docs: enhance Go 1.24 tools feature documentation

Open kotahorii opened this issue 5 months ago • 3 comments

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 templ with 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]

kotahorii avatar Aug 02 '25 14:08 kotahorii

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 :::info syntax with correct formatting

CLI Documentation

  • Fixed admonition formatting - Added proper empty lines and correct :::tip syntax according to Docusaurus documentation
  • Updated internal link - Fixed reference to match new heading format

Verification

  • Build tested - Ran npm run build successfully 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!

kotahorii avatar Aug 03 '25 02:08 kotahorii

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?

kotahorii avatar Aug 03 '25 03:08 kotahorii

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.

a-h avatar Aug 04 '25 08:08 a-h