mirror of
https://github.com/a-h/templ.git
synced 2025-02-06 10:03:16 +00:00
chore: fix misspellings (#1040)
Co-authored-by: Adrian Hesketh <adrianhesketh@hushmail.com>
This commit is contained in:
parent
34660b3bf3
commit
725a88f73c
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -14,7 +14,7 @@ Please make sure you're using the latest version of the templ CLI (`go install g
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
A small, self-container, complete reproduction, uploaded to a Github repo, containing the minimum amount of files required to reproduce the behaviour, along with a list of commands that need to be run. Keep it simple.
|
||||
A small, self-container, complete reproduction, uploaded to a GitHub repo, containing the minimum amount of files required to reproduce the behaviour, along with a list of commands that need to be run. Keep it simple.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
@ -156,7 +156,7 @@ git diff --exit-code
|
||||
|
||||
### push-release-tag
|
||||
|
||||
Push a semantic version number to Github to trigger the release process.
|
||||
Push a semantic version number to GitHub to trigger the release process.
|
||||
|
||||
```sh
|
||||
./push-tag.sh
|
||||
|
@ -6,4 +6,4 @@ The latest version of templ is supported.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Use the "Security" tab in Github and fill out the "Report a vulnerability" form.
|
||||
Use the "Security" tab in GitHub and fill out the "Report a vulnerability" form.
|
||||
|
@ -719,11 +719,11 @@ func TestDocumentSymbol(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
expectdSlice, err := sliceToAnySlice(test.expect)
|
||||
expectedSlice, err := sliceToAnySlice(test.expect)
|
||||
if err != nil {
|
||||
t.Errorf("failed to convert expect to any slice: %v", err)
|
||||
}
|
||||
diff := cmp.Diff(expectdSlice, actual)
|
||||
diff := cmp.Diff(expectedSlice, actual)
|
||||
if diff != "" {
|
||||
t.Errorf("unexpected document symbol: %v", diff)
|
||||
}
|
||||
@ -843,7 +843,7 @@ func Setup(ctx context.Context, log *zap.Logger) (clientCtx context.Context, app
|
||||
var wg sync.WaitGroup
|
||||
var cmdErr error
|
||||
|
||||
// Copy from the LSP to the CLient, and vice versa.
|
||||
// Copy from the LSP to the Client, and vice versa.
|
||||
fromClient, toLSP := io.Pipe()
|
||||
fromLSP, toClient := io.Pipe()
|
||||
clientStream := jsonrpc2.NewStream(newStdRwc(log, "clientStream", toLSP, fromLSP))
|
||||
|
@ -8,7 +8,7 @@ With Go 1.23 or greater installed, run:
|
||||
go install github.com/a-h/templ/cmd/templ@latest
|
||||
```
|
||||
|
||||
## Github binaries
|
||||
## GitHub binaries
|
||||
|
||||
Download the latest release from https://github.com/a-h/templ/releases/latest
|
||||
|
||||
|
@ -458,7 +458,7 @@ templ page(content string) {
|
||||
}
|
||||
```
|
||||
|
||||
The data passed into the Javascript funtion will be JSON encoded, which then can be used inside the function.
|
||||
The data passed into the Javascript function will be JSON encoded, which then can be used inside the function.
|
||||
|
||||
```go title="main.go"
|
||||
package main
|
||||
|
@ -213,9 +213,9 @@ end
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If you cannot run `:TSInstall templ`, ensure you have an up-to-date version of [tree-sitter](https://github.com/nvim-treesitter/nvim-treesitter). The [package for templ](https://github.com/vrischmann/tree-sitter-templ) was [added to the main tree-sitter repositry](https://github.com/nvim-treesitter/nvim-treesitter/pull/5667) so you shouldn't need to install a separate plugin for it.
|
||||
If you cannot run `:TSInstall templ`, ensure you have an up-to-date version of [tree-sitter](https://github.com/nvim-treesitter/nvim-treesitter). The [package for templ](https://github.com/vrischmann/tree-sitter-templ) was [added to the main tree-sitter repository](https://github.com/nvim-treesitter/nvim-treesitter/pull/5667) so you shouldn't need to install a separate plugin for it.
|
||||
|
||||
If you still don't get syntax highlighting after it's installed, try running `:TSBufEnable highlight`. If you find that you need to do this every time you open a .templ file, you can run this autocmd to do it for your neovim configuation.
|
||||
If you still don't get syntax highlighting after it's installed, try running `:TSBufEnable highlight`. If you find that you need to do this every time you open a .templ file, you can run this autocmd to do it for your neovim configuration.
|
||||
|
||||
```lua
|
||||
vim.api.nvim_create_autocmd("BufEnter", { pattern = "*.templ", callback = function() vim.cmd("TSBufEnable highlight") end })
|
||||
|
@ -106,7 +106,7 @@ templ generate --notify-proxy --proxybind="localhost" --proxyport="8080"
|
||||
wgo -file=.go -file=.templ -xfile=_templ.go templ generate :: go run main.go
|
||||
```
|
||||
|
||||
To avoid a continous reloading files ending with `_templ.go` should be skipped via `-xfile`.
|
||||
To avoid a continuous reloading files ending with `_templ.go` should be skipped via `-xfile`.
|
||||
|
||||
## Alternative 2: air
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Coding assistants / LLMs
|
||||
|
||||
To provide AI coding assistants such as Github Copilot, Cursor or similar with help on how to write templ code, the templ project maintains a single file containing documentation for LLMs to read.
|
||||
To provide AI coding assistants such as GitHub Copilot, Cursor or similar with help on how to write templ code, the templ project maintains a single file containing documentation for LLMs to read.
|
||||
|
||||
You can find the file at `https://templ.guide/llms.md`.
|
||||
|
||||
@ -8,6 +8,6 @@ You can find the file at `https://templ.guide/llms.md`.
|
||||
|
||||
### https://github.com/CopilotC-Nvim/CopilotChat.nvim
|
||||
|
||||
CopilotChat is a plugin for Neovim that provides a chat interface for Github Copilot. It allows you to ask Copilot questions and get responses in real-time.
|
||||
CopilotChat is a plugin for Neovim that provides a chat interface for GitHub Copilot. It allows you to ask Copilot questions and get responses in real-time.
|
||||
|
||||
Use the URL feature to load `https://templ.guide/llms.md`.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Code signing
|
||||
|
||||
Binaries are created by the Github Actions workflow at https://github.com/a-h/templ/blob/main/.github/workflows/release.yml
|
||||
Binaries are created by the GitHub Actions workflow at https://github.com/a-h/templ/blob/main/.github/workflows/release.yml
|
||||
|
||||
Binaries are signed by cosign. The public key is stored in the repository at https://github.com/a-h/templ/blob/main/cosign.pub
|
||||
|
||||
|
@ -24,7 +24,7 @@ templ component(o Order) {
|
||||
}
|
||||
```
|
||||
|
||||
See [URL Attribures](/syntax-and-usage/attributes#url-attributes) for more information.
|
||||
See [URL Attributes](/syntax-and-usage/attributes#url-attributes) for more information.
|
||||
|
||||
## Feedback
|
||||
|
||||
|
@ -8,6 +8,6 @@ Use the #templ channel in the Gopher Slack community.
|
||||
|
||||
https://invite.slack.golangbridge.org/
|
||||
|
||||
## Github Discussion
|
||||
## GitHub Discussion
|
||||
|
||||
https://github.com/a-h/templ/discussions
|
||||
|
@ -1013,7 +1013,7 @@ func (g *generator) writeAttributeCSS(indentLevel int, attr parser.ExpressionAtt
|
||||
}
|
||||
// Create a class name for the style.
|
||||
// The expression can either be expecting a templ.Classes call, or an expression that returns
|
||||
// var templ_7745c5c3_CSSClassess = []any{
|
||||
// var templ_7745c5c3_CSSClasses = []any{
|
||||
classesName := g.createVariableName()
|
||||
if _, err = g.w.WriteIndent(indentLevel, "var "+classesName+" = []any{"); err != nil {
|
||||
return
|
||||
@ -1028,7 +1028,7 @@ func (g *generator) writeAttributeCSS(indentLevel int, attr parser.ExpressionAtt
|
||||
return
|
||||
}
|
||||
// Render the CSS before the element if required.
|
||||
// templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_CSSClassess...)
|
||||
// templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_CSSClasses...)
|
||||
if _, err = g.w.WriteIndent(indentLevel, "templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, "+classesName+"...)\n"); err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
<div class="a c">Maps can be used to determine if a class should be added or not.</div>
|
||||
<style type="text/css">.e_739d4573{font-size:14pt;}</style>
|
||||
<div class="a c e_739d4573">KV can be used to conditionally set classes.</div>
|
||||
<div class="bg-violet-500 hover:bg-red-600 hover:bg-sky-700 text-[#50d71e] w-[calc(100%-4rem)">Psuedo attributes and complex class names are supported.</div>
|
||||
<div class="bg-violet-500 hover:bg-red-600 hover:bg-sky-700 text-[#50d71e] w-[calc(100%-4rem)">Pseudo attributes and complex class names are supported.</div>
|
||||
<div class="a" onClick="alert('hello')"">
|
||||
Class names are HTML escaped.
|
||||
</div>
|
||||
|
@ -54,8 +54,8 @@ templ KVCanBeUsedToConditionallySetClasses() {
|
||||
}
|
||||
|
||||
// Pseudo attributes can be used without any special syntax.
|
||||
templ PsuedoAttributesAndComplexClassNamesAreSupported() {
|
||||
<div class={ "bg-violet-500", "hover:bg-red-600", "hover:bg-sky-700", "text-[#50d71e]", "w-[calc(100%-4rem)" }>Psuedo attributes and complex class names are supported.</div>
|
||||
templ PseudoAttributesAndComplexClassNamesAreSupported() {
|
||||
<div class={ "bg-violet-500", "hover:bg-red-600", "hover:bg-sky-700", "text-[#50d71e]", "w-[calc(100%-4rem)" }>Pseudo attributes and complex class names are supported.</div>
|
||||
}
|
||||
|
||||
// Class names are HTML escaped.
|
||||
@ -89,7 +89,7 @@ templ TestComponent() {
|
||||
@CSSComponentsAndConstantsAreSupported()
|
||||
@MapsCanBeUsedToConditionallySetClasses()
|
||||
@KVCanBeUsedToConditionallySetClasses()
|
||||
@PsuedoAttributesAndComplexClassNamesAreSupported()
|
||||
@PseudoAttributesAndComplexClassNamesAreSupported()
|
||||
@ClassNamesAreHTMLEscaped()
|
||||
@CSSComponentsCanBeUsedWithArguments()
|
||||
@Rotate(45)
|
||||
|
@ -290,7 +290,7 @@ func KVCanBeUsedToConditionallySetClasses() templ.Component {
|
||||
}
|
||||
|
||||
// Pseudo attributes can be used without any special syntax.
|
||||
func PsuedoAttributesAndComplexClassNamesAreSupported() templ.Component {
|
||||
func PseudoAttributesAndComplexClassNamesAreSupported() templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
@ -329,7 +329,7 @@ func PsuedoAttributesAndComplexClassNamesAreSupported() templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\">Psuedo attributes and complex class names are supported.</div>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\">Pseudo attributes and complex class names are supported.</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@ -564,7 +564,7 @@ func TestComponent() templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = PsuedoAttributesAndComplexClassNamesAreSupported().Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = PseudoAttributesAndComplexClassNamesAreSupported().Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
@ -189,8 +189,8 @@ func TestHandler(t *testing.T) {
|
||||
}
|
||||
// Expect the status code to be 201, not 400, because in streaming mode,
|
||||
// we have to write the header before we can call the error handler.
|
||||
if actualRepsonseCode := w.Result().StatusCode; http.StatusCreated != actualRepsonseCode {
|
||||
t.Errorf("expected status %d, got %d", http.StatusCreated, actualRepsonseCode)
|
||||
if actualResponseCode := w.Result().StatusCode; http.StatusCreated != actualResponseCode {
|
||||
t.Errorf("expected status %d, got %d", http.StatusCreated, actualResponseCode)
|
||||
}
|
||||
// Expect the body to be "BodyError message", not just "Error message" because
|
||||
// in streaming mode, we've already written part of the body to the response, unlike in
|
||||
|
@ -19,7 +19,7 @@ func (ifExpressionParser) Parse(pi *parse.Input) (n Node, ok bool, err error) {
|
||||
return r, false, nil
|
||||
}
|
||||
|
||||
// Parse the Go if expresion.
|
||||
// Parse the Go if expression.
|
||||
if r.Expression, err = parseGo("if", pi, goexpression.If); err != nil {
|
||||
return r, false, err
|
||||
}
|
||||
@ -78,7 +78,7 @@ func (elseIfExpressionParser) Parse(pi *parse.Input) (r ElseIfExpression, ok boo
|
||||
|
||||
// Rewind to the start of the `if` statement.
|
||||
pi.Seek(pi.Index() - 2)
|
||||
// Parse the Go if expresion.
|
||||
// Parse the Go if expression.
|
||||
if r.Expression, err = parseGo("else if", pi, goexpression.If); err != nil {
|
||||
return r, false, err
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ func (switchExpressionParser) Parse(pi *parse.Input) (n Node, ok bool, err error
|
||||
return
|
||||
}
|
||||
|
||||
// Parse the Go switch expresion.
|
||||
// Parse the Go switch expression.
|
||||
if r.Expression, err = parseGo("switch", pi, goexpression.Switch); err != nil {
|
||||
return r, false, err
|
||||
}
|
||||
@ -67,7 +67,7 @@ var caseExpressionStartParser = parse.Func(func(pi *parse.Input) (r Expression,
|
||||
pi.Seek(start)
|
||||
return r, false, nil
|
||||
}
|
||||
// Parse the Go expresion.
|
||||
// Parse the Go expression.
|
||||
if r, err = parseGo("case", pi, goexpression.Case); err != nil {
|
||||
return r, false, err
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ func TestTextParser(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Multiline text is colected line by line",
|
||||
name: "Multiline text is collected line by line",
|
||||
input: "Line 1\nLine 2",
|
||||
expected: Text{
|
||||
Value: "Line 1",
|
||||
@ -92,7 +92,7 @@ func TestTextParser(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Multiline text is colected line by line (Windows)",
|
||||
name: "Multiline text is collected line by line (Windows)",
|
||||
input: "Line 1\r\nLine 2",
|
||||
expected: Text{
|
||||
Value: "Line 1",
|
||||
|
@ -172,7 +172,7 @@ func TestSanitizeCSS(t *testing.T) {
|
||||
expectedValue: InnocuousPropertyValue,
|
||||
},
|
||||
{
|
||||
name: "background-image invalid sufix",
|
||||
name: "background-image invalid suffix",
|
||||
inputProperty: "background-image",
|
||||
expectedProperty: "background-image",
|
||||
inputValue: `url("/img.png`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user