From b02d2ba479446de6f38fce1e25cec8564ef9010a Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sat, 26 Apr 2025 19:47:00 -0400 Subject: chore(templ): fix go generate commands Signed-off-by: Xe Iaso --- cmd/hlang/hlang_templ.go | 48 ++++++++++++++++++++++++++++++++++-------------- cmd/hlang/http.go | 2 +- 2 files changed, 35 insertions(+), 15 deletions(-) (limited to 'cmd/hlang') diff --git a/cmd/hlang/hlang_templ.go b/cmd/hlang/hlang_templ.go index 2155e26..c704085 100644 --- a/cmd/hlang/hlang_templ.go +++ b/cmd/hlang/hlang_templ.go @@ -1,6 +1,6 @@ // Code generated by templ - DO NOT EDIT. -// templ: version: v0.2.731 +// templ: version: v0.3.857 package main //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -11,6 +11,9 @@ import templruntime "github.com/a-h/templ/runtime" func navbar() 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 { + return templ_7745c5c3_CtxErr + } templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { defer func() { @@ -26,17 +29,20 @@ func navbar() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("The h programming language - Docs - Playground - FAQ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "The h programming language - Docs - Playground - FAQ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - return templ_7745c5c3_Err + return nil }) } func footer() 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 { + return templ_7745c5c3_CtxErr + } templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { defer func() { @@ -52,17 +58,20 @@ func footer() templ.Component { templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

From Within

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "

From Within

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - return templ_7745c5c3_Err + return nil }) } func homePage() 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 { + return templ_7745c5c3_CtxErr + } templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { defer func() { @@ -78,17 +87,20 @@ func homePage() templ.Component { templ_7745c5c3_Var3 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

A simple, fast, open-source, complete and safe language for developing modern software for the web


Example Program

h

Outputs:

h

Fast Compilation

h probably compiles hundreds of characters of source per second. I didn't really test how fast it is, but when I was testing it the speed was fast enough that I didn't care to profile it.


Safety

h is completely memory safe with no garbage collector or heap allocations. It does not allow memory leaks to happen, nor do any programs in h have the possibility to allocate memory.


Zero* Dependencies

h generates WebAssembly, so every binary produced by the compiler is completely dependency free save a single system call: h.h. This allows for modern, future-proof code that will work on all platforms.


Simple

h has a simple grammar that gzips to 117 bytes. Creating a runtime environment for h is so trivial just about anyone can do it.


Platform Support

h supports the following platforms:


International Out of the Box

h supports multiple written and spoken languages with true contextual awareness. It not only supports the Latin h as input, it also accepts the Lojbanic ' as well. This allows for full 100% internationalization into Lojban should your project needs require it.


Testimonials

Not convinced? Take the word of people we probably didn't pay for their opinion.


Open-Source

The h compiler and default runtime are open-source free software sent out into the Public Domain. You can use h for any purpose at all with no limitations or restrictions.


") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "

A simple, fast, open-source, complete and safe language for developing modern software for the web


Example Program

h

Outputs:

h

Fast Compilation

h probably compiles hundreds of characters of source per second. I didn't really test how fast it is, but when I was testing it the speed was fast enough that I didn't care to profile it.


Safety

h is completely memory safe with no garbage collector or heap allocations. It does not allow memory leaks to happen, nor do any programs in h have the possibility to allocate memory.


Zero* Dependencies

h generates WebAssembly, so every binary produced by the compiler is completely dependency free save a single system call: h.h. This allows for modern, future-proof code that will work on all platforms.


Simple

h has a simple grammar that gzips to 117 bytes. Creating a runtime environment for h is so trivial just about anyone can do it.


Platform Support

h supports the following platforms:


International Out of the Box

h supports multiple written and spoken languages with true contextual awareness. It not only supports the Latin h as input, it also accepts the Lojbanic ' as well. This allows for full 100% internationalization into Lojban should your project needs require it.


Testimonials

Not convinced? Take the word of people we probably didn't pay for their opinion.


Open-Source

The h compiler and default runtime are open-source free software sent out into the Public Domain. You can use h for any purpose at all with no limitations or restrictions.


") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - return templ_7745c5c3_Err + return nil }) } func docsPage() 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 { + return templ_7745c5c3_CtxErr + } templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { defer func() { @@ -104,17 +116,20 @@ func docsPage() templ.Component { templ_7745c5c3_Var4 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Coming soon...


") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "

Coming soon...


") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - return templ_7745c5c3_Err + return nil }) } func faqPage() 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 { + return templ_7745c5c3_CtxErr + } templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { defer func() { @@ -130,7 +145,7 @@ func faqPage() templ.Component { templ_7745c5c3_Var5 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

What are the instructions of h?

h supports the following instructions:

All valid h instructions must be separated by a space (\\0x20 or the spacebar on your computer). No other forms of whitespace are permitted. Any other characters will render your program gentoldra.

How do I install and use h?

With any computer running Go 1.11 or higher:

go get -u -v within.website/x/cmd/hlang
Usage is simple:
")
+		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "

What are the instructions of h?

h supports the following instructions:

  • h
  • '

All valid h instructions must be separated by a space (\\0x20 or the spacebar on your computer). No other forms of whitespace are permitted. Any other characters will render your program gentoldra.

How do I install and use h?

With any computer running Go 1.11 or higher:

go get -u -v within.website/x/cmd/hlang
Usage is simple:
")
 		if templ_7745c5c3_Err != nil {
 			return templ_7745c5c3_Err
 		}
@@ -143,17 +158,20 @@ func faqPage() templ.Component {
 		if templ_7745c5c3_Err != nil {
 			return templ_7745c5c3_Err
 		}
-		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

What version is h?

Version 1.0.1, this will hopefully be the only release.

What is the h koan?

And Jesus said unto the theologians, \"Who do you say that I am?\"

They replied: \"You are the eschatological manifestation of the ground of our being, the kerygma of which we find the ultimate meaning in our interpersonal relationships.\"

And Jesus said \"...What?\"

Some time passed and one of them spoke \"h\".

Jesus was enlightened.

Why?

That's a good question. The following blogposts may help you understand this more:

Who wrote h?

Within

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "

What version is h?

Version 1.0.1, this will hopefully be the only release.

What is the h koan?

And Jesus said unto the theologians, \"Who do you say that I am?\"

They replied: \"You are the eschatological manifestation of the ground of our being, the kerygma of which we find the ultimate meaning in our interpersonal relationships.\"

And Jesus said \"...What?\"

Some time passed and one of them spoke \"h\".

Jesus was enlightened.

Why?

That's a good question. The following blogposts may help you understand this more:

Who wrote h?

Within

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - return templ_7745c5c3_Err + return nil }) } func playgroundPage() 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 { + return templ_7745c5c3_CtxErr + } templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { defer func() { @@ -169,10 +187,12 @@ func playgroundPage() templ.Component { templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Unfortunately, Javascript is required to use this page, sorry.

Program

Output

AST

Execution time (nanoseconds):

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "

Unfortunately, Javascript is required to use this page, sorry.

Program

Output

AST

Execution time (nanoseconds):

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - return templ_7745c5c3_Err + return nil }) } + +var _ = templruntime.GeneratedTemplate diff --git a/cmd/hlang/http.go b/cmd/hlang/http.go index d581b03..a4858c1 100644 --- a/cmd/hlang/http.go +++ b/cmd/hlang/http.go @@ -16,7 +16,7 @@ import ( "within.website/x/xess" ) -//go:generate go run github.com/a-h/templ/cmd/templ@latest generate +//go:generate go tool templ generate var ( maxBytes = flag.Int64("max-playground-bytes", 75, "how many bytes of data should users be allowed to post to the playground?") -- cgit v1.2.3