From 3d96597ec1f543a6ab04ab9ad0bfe695f4ab133b Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Wed, 19 Mar 2025 12:48:41 +0800 Subject: [PATCH] Further renaming --- .gitignore | 2 +- Makefile | 8 ++++---- README.md | 2 +- htmpl.7 => gohtmpl.7 | 16 ++++++++-------- htmplgen.1 => gohtmplgen.1 | 2 +- htmplgen.c => gohtmplgen.c | 2 +- diff --git a/.gitignore b/.gitignore index d33eeff38ee16a5ceba0590ad8e71b40cb8ef5ea..20cfbf4b85ed835e9621ecf66607e51928c98951 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.o /parse.c /parse.h -/htmplgen +/gohtmplgen diff --git a/Makefile b/Makefile index 752bacea089ec8dd0950778332c084b451016e03..7b093288efcf500550badaa89b259a35126cb354 100644 --- a/Makefile +++ b/Makefile @@ -4,19 +4,19 @@ CFLAGS = -Wall -Werror -O2 YFLAGS = -d LDFLAGS = -TARGET = htmplgen +TARGET = gohtmplgen PREFIX ?= /usr/local -SRCS = htmplgen.c parse.y -OBJS = htmplgen.o parse.o +SRCS = gohtmplgen.c parse.y +OBJS = gohtmplgen.o parse.o all: $(TARGET) parse.c parse.h: parse.y $(YACC) $(YFLAGS) -o parse.c $< -htmplgen.o: htmplgen.c parse.h +gohtmplgen.o: gohtmplgen.c parse.h $(CC) $(CFLAGS) -c -o $@ $< parse.o: parse.c diff --git a/README.md b/README.md index b78e6c70a762f558ee3a34b1c2041aa1f339bd17..f7cff5116a09630ed95566a1b7c17527f84a1887 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [Got](https://got.gameoftrees.org/?action=summary&path=got.git) and described in [Omar Polo's blog post](https://www.omarpolo.com/post/template.html). -The `gohtmplgen` program generates a Go file from the template file. +The `gogohtmplgen` program generates a Go file from the template file. Each template is presented as a function that accepts an `net/http.ResponseWriter` and other user-defined parameters, if any. diff --git a/htmpl.7 b/gohtmpl.7 rename from htmpl.7 rename to gohtmpl.7 index b92333fd5cb6c0aa7af4fedfeca25568692c8330..27019044be644de866db9985b45f9c7ebb560e49 100644 --- a/htmpl.7 +++ b/gohtmpl.7 @@ -26,8 +26,8 @@ .Dq templates . A .Nm file is assumed to be compiled using the -.Xr htmplgen 1 -utility into Hare code, to be further compiled as part of a bigger +.Xr gohtmplgen 1 +utility into Go code, to be further compiled as part of a bigger application. .Pp There are two special sequences: @@ -37,7 +37,7 @@ used for .Nm special syntax. .It Cm {! Ar ... Cm !} -used to include literal Hare code. +used to include literal Go code. This is the only special syntax permitted as top-level, except for block definition and includes. .El @@ -45,7 +45,7 @@ .Pp The basic unit of a .Nm file is the block. -Each block is turned into a Hare function that output its content via some +Each block is turned into a Go function that output its content via some provided functions. The block must accept an argument called .Ar handle that satisfies io::handle. @@ -100,9 +100,9 @@ can be provided zero or more times, .Ic else only zero or one time and always for last. .It Cm {{ Ic for Ar ... ; Ar ... ; Ar ... Cm }} Ar ... Cm {{ Ic end Cm }} -Looping construct similar to the Hare for loop. +Looping construct similar to the Go for loop. .It Cm {{ Ic while Ar ... Cm }} Ar ... Cm {{ Ic end Cm }} -Looping construct similar to the Hare for loop with one condition argument only. +Looping construct similar to the Go for loop with one condition argument only. .It Cm {{ Ar expression Cm \&| Ic unsafe Cm }} Output .Ar expression @@ -117,9 +117,9 @@ .Ar expression with the default HTML escaping. .El .Sh SEE ALSO -.Xr htmplgen 1 +.Xr gohtmplgen 1 .Sh AUTHORS .An Omar Polo Aq Mt op@openbsd.org wrote the original program. .An Runxi Yu Aq Mt op@openbsd.org -ported it to Hare. +ported it to Go. diff --git a/htmplgen.1 b/gohtmplgen.1 rename from htmplgen.1 rename to gohtmplgen.1 index eeb374ed381a86b21eea1c26471eea54e506fc2c..bb03c6e0c33b545258f349209889cff397d76f53 100644 --- a/htmplgen.1 +++ b/gohtmplgen.1 @@ -16,7 +16,7 @@ .Dd January 6, 2022 .Dt TEMPLATE 1 .Os .Sh NAME -.Nm htmplgen +.Nm gohtmplgen .Nd templating system compiler .Sh SYNOPSIS .Nm diff --git a/htmplgen.c b/gohtmplgen.c rename from htmplgen.c rename to gohtmplgen.c index 3f982430453d641a9862e41e66eebff332dd7378..652ebd65f58051fd12171435b852cedb0627a6c9 100644 --- a/htmplgen.c +++ b/gohtmplgen.c @@ -48,7 +48,7 @@ out = optarg; break; default: if (argc == 0) - usage("htmplgen"); + usage("gohtmplgen"); else usage(argv[0]); } -- 2.48.1