docs: improve template system documentation with context parameter clarification

- Distinguish between regular templates and partials for variable access
- Document how partials receive context via explicit parameters
- Add examples for both template types with correct syntax
- Templatize global CLAUDE.md for platform-specific shell environment sections
- Add conditional rendering for Windows, WSL, and Linux environments
This commit is contained in:
Ryan Walters
2025-11-04 11:35:53 -06:00
parent 1e55b4862f
commit 4d20cbbacd
2 changed files with 33 additions and 3 deletions

View File

@@ -1,4 +1,6 @@
**Note**: Project-specific CLAUDE.md files take precedence for project-specific patterns.
**Note**: Project-specific CLAUDE.md files take precedence for project-specific patterns.
{{- if and (eq .chezmoi.os "windows") (not .wsl) }}
## Shell Environment (Windows)
@@ -7,6 +9,25 @@
- ❌ Do NOT use CMD commands (`dir`, `copy`, `del`)
- ✅ Use standard Bash/Unix commands (`ls`, `cp`, `mv`, `rm`, `grep`)
- Prefer relative paths for simplicity
{{- else if .wsl }}
## Shell Environment (WSL)
- **You are in WSL (Windows Subsystem for Linux)**
- ✅ Use standard Linux/Bash commands (`ls`, `cp`, `mv`, `rm`, `grep`)
- ✅ Full access to Linux tooling and package managers
- ⚠️ Can access Windows filesystem via `/mnt/c/`, but prefer Linux paths
- ⚠️ Can call Windows executables (`.exe`), but prefer native Linux tools
- Prefer relative paths for simplicity
{{- else if eq .chezmoi.os "linux" }}
## Shell Environment (Linux)
- **You are in a standard Linux environment**
- ✅ Use standard Bash/Unix commands (`ls`, `cp`, `mv`, `rm`, `grep`)
- ✅ Full access to Linux tooling and package managers
- Prefer relative paths for simplicity
{{- end }}
## Build & Package Management