templify alternatives and similar packages
Based on the "Resource Embedding" category.
Alternatively, view templify alternatives based on common mentions on social networks and blogs.
-
go.rice
go.rice is a Go package that makes working with resources such as html,js,css,images and templates very easy. -
vfsgen
Generates a vfsdata.go file that statically implements the given virtual filesystem. -
esc
Embeds files into Go programs and provides http.FileSystem interfaces to them. -
fileb0x
Simple tool to embed files in go with focus on "customization" and ease to use. -
go-bindata
Package that converts any file into managable Go source code. -
statics
Embeds static resources into go files for single binary compilation + works with http.FileSystem + symlinks. -
go-embed
Generates go code to embed resource files into your library or executable -
mule
Embed external resources like images, movies ... into Go source code to create single file binaries using go generate. Focussed on simplicity.
Scout APM - Leading-edge performance monitoring starting at $39/month
Do you think we are missing an alternative of templify or a related project?
Popular Comparisons
README
templify
A tool to be used with 'go generate' to embed external template files into Go code.
Scenario
An often used scenario in developing go applications is to generate text (e.g. html pages) using the Go template packages. You have two choices: either editing the template in a dedicated file and to read this file at runtime from your application. Or you add a "big" string containing the template to the source of your app and parse this string to create the template.
If you want to create a single file application, then the more handy solution with a dedicated file is not desirable. On the other hand to edit a complex html template within a Go string in the source is very uncomfortable.
templify allows you to edit your template in an extra file and to generate an Go source file containing the embedded string.
Installation
go get github.com/wlbr/templify
Usage
Simply add a line
//go:generate templify mytemplate.file
for each template you want to embed. Every time you run a go generate
in the
corresponding folder, the file mytemplate.go
will be created. It contains a
function mytemplateTemplate
returning the template string.
You may use templify mytemplate.file
directly on the command line.
Switches
Usage of templify: templify [switches] templatefilename
-e
export the generated, the template returning function. Default (false) means the function will not be exported.
-f no formatting of the generated source. Default false means source will be formatted with gofmt.
-n string name of generated, the template returning function. Its name will have 'Template' attached. Will be set to $(basename -s .ext outputfile) if empty (default).
-o string name of output file. Defaults to name of template file excluding extension + '.go'.
-p string name of package to be used in generated code (default "main").
-t string name of alternate code generation template file. If empty (default), then the embedded template will be used. Template variables supplied are: .Name, .Package, .Content
Code
- Documentation: https://godoc.org/github.com/wlbr/templify
- Lint: http://go-lint.appspot.com/github.com/wlbr/templify
- Continous Integration:
- Test Coverage:
- Metrics: