{"id":13413731,"url":"https://github.com/wlbr/templify","last_synced_at":"2026-01-23T11:58:56.835Z","repository":{"id":42397202,"uuid":"59423019","full_name":"wlbr/templify","owner":"wlbr","description":"A tool to be used with 'go generate' to embed external template files into Go code.","archived":false,"fork":false,"pushed_at":"2021-08-16T20:22:50.000Z","size":1232,"stargazers_count":30,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-07-31T20:52:48.874Z","etag":null,"topics":["code-generation","go-generate","go-template"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wlbr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["wlbr"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-05-22T16:42:47.000Z","updated_at":"2023-07-26T06:48:09.000Z","dependencies_parsed_at":"2022-08-28T17:40:47.225Z","dependency_job_id":null,"html_url":"https://github.com/wlbr/templify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wlbr/templify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlbr%2Ftemplify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlbr%2Ftemplify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlbr%2Ftemplify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlbr%2Ftemplify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wlbr","download_url":"https://codeload.github.com/wlbr/templify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlbr%2Ftemplify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28690611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","go-generate","go-template"],"created_at":"2024-07-30T20:01:47.639Z","updated_at":"2026-01-23T11:58:56.814Z","avatar_url":"https://github.com/wlbr.png","language":"Go","readme":"# templify\nA tool to be used with 'go generate' to embed external template files into Go code.\n\n## Scenario\nAn often used scenario in developing go applications is to generate text (e.g. html pages) \nusing the Go template packages. You have two choices: either editing the template in a\ndedicated file and to read this file at runtime from your application. Or you add a \n\"big\" string containing the template to the source of your app and parse this string to \ncreate the template.\n\nIf you want to create a single file application, then the more handy solution with a \ndedicated file is not desirable. On the other hand to edit a complex html template within \na Go string in the source is very uncomfortable. \n\ntemplify allows you to edit your template in an extra file and to generate an Go source\nfile containing the embedded string.\n\n## Installation\n   `go get github.com/wlbr/templify`\n\n## Usage\nSimply add a line \n\n   `//go:generate templify mytemplate.file`\n\nfor each template you want to embed. Every time you run a `go generate` in the \ncorresponding folder, the file `mytemplate.go` will be created. It contains a \nfunction `mytemplateTemplate` returning the template string.\n\nYou may use `templify mytemplate.file` directly on the command line.\n\n## Switches\nUsage of templify: `templify [switches] templatefilename`\u003cbr\u003e\n   -e\t\u003cbr\u003e\n      \u0026nbsp;\u0026nbsp;\u0026nbsp;export the generated, the template returning function. Default (false) means the function will not be exported.\n  \n   -f \u003cbr\u003e\n    \t\u0026nbsp;\u0026nbsp;\u0026nbsp;no formatting of the generated source. Default false means source will be formatted with gofmt.\n  \n   -n string\u003cbr\u003e\n      \u0026nbsp;\u0026nbsp;\u0026nbsp;\n    \tname of generated, the template returning function. Its name will have 'Template' attached. Will be set to $(basename -s .ext outputfile) if empty (default).\n      \n   -o string\u003cbr\u003e\n    \t\u0026nbsp;\u0026nbsp;\u0026nbsp;name of output file. Defaults to name of template file excluding extension + '.go'.\n  \n   -p string\u003cbr\u003e\n    \t\u0026nbsp;\u0026nbsp;\u0026nbsp;name of package to be used in generated code (default \"main\").\n    \t\n   -t string\u003cbr\u003e\n    \t\u0026nbsp;\u0026nbsp;\u0026nbsp;name of alternate code generation template file. If empty (default), then the embedded template will be used. Template variables supplied are: .Name, .Package, .Content\n    \t\n## Code\n* Documentation: https://godoc.org/github.com/wlbr/templify\n* Lint: http://go-lint.appspot.com/github.com/wlbr/templify\n* Continous Integration: [![Travis Status](https://api.travis-ci.com/wlbr/templify.svg?branch=master)](https://travis-ci.com/wlbr/templify)\n* Test Coverage: [![Coverage Status](https://coveralls.io/repos/github/wlbr/templify/badge.svg?branch=master)](https://coveralls.io/github/wlbr/templify?branch=master)\n* Metrics: [![GoReportCard](https://goreportcard.com/badge/github.com/wlbr/templify)](https://goreportcard.com/report/github.com/wlbr/templify)\n","funding_links":["https://github.com/sponsors/wlbr"],"categories":["Resource Embedding","嵌入的资源","資源嵌入","资源嵌入","Relational Databases","\u003cspan id=\"资源嵌入-resource-embedding\"\u003e资源嵌入 Resource Embedding\u003c/span\u003e"],"sub_categories":["HTTP Clients","Advanced Console UIs","HTTP客户端","高級控制台界面","查询语","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlbr%2Ftemplify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwlbr%2Ftemplify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlbr%2Ftemplify/lists"}