{"modulePath":"github.com/ambientkit/plugin","version":"v0.0.0-20220330114152-ecdd364f93e8","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package htmlengine\n\nPackage htmlengine is an Ambient plugin that provides a HTML template engine.\n\n## Types\n\n```go\ntype Engine struct {\n\t// contains filtered or unexported fields\n}\n```\nEngine represents a HTML template engine.\n\n```go\nfunc NewTemplateEngine(logger ambient.Logger, assetInjector ambient.AssetInjector) *Engine\n```\nNewTemplateEngine returns a HTML template engine.\n\n```go\nfunc (te *Engine) Body(t *template.Template, content string, fm template.FuncMap, data map[string]interface{}) (*template.Template, error)\n```\nBody -\n\n```go\nfunc (te *Engine) Error(w http.ResponseWriter, r *http.Request, content string, statusCode int, fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)\n```\nError renders HTML to a response writer and returns a 404 status code and an error if one occurs.\n\n```go\nfunc (te *Engine) Footer(t *template.Template, content string, fm template.FuncMap, data map[string]interface{}) (*template.Template, error)\n```\nFooter -\n\n```go\nfunc (te *Engine) Head(t *template.Template, content string, fm template.FuncMap, data map[string]interface{}) (*template.Template, error)\n```\nHead -\n\n```go\nfunc (te *Engine) Header(t *template.Template, content string, fm template.FuncMap, data map[string]interface{}) (*template.Template, error)\n```\nHeader -\n\n```go\nfunc (te *Engine) Main(t *template.Template, content string, fm template.FuncMap, data map[string]interface{}) (*template.Template, error)\n```\nMain -\n\n```go\nfunc (te *Engine) Page(w http.ResponseWriter, r *http.Request, assets ambient.FileSystemReader, partialTemplate string, fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)\n```\nPage renders using the page layout.\n\n```go\nfunc (te *Engine) PageContent(w http.ResponseWriter, r *http.Request, content string, fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)\n```\nPageContent renders using the page content.\n\n```go\nfunc (te *Engine) Post(w http.ResponseWriter, r *http.Request, assets ambient.FileSystemReader, partialTemplate string, fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)\n```\nPost renders using the post layout.\n\n```go\nfunc (te *Engine) PostContent(w http.ResponseWriter, r *http.Request, content string, fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)\n```\nPostContent renders using the post content.\n\n```go\ntype Plugin struct{}\n```\nPlugin represents an Ambient plugin.\n\n```go\nfunc New() *Plugin\n```\nNew returns an Ambient plugin that provides a HTML template engine.\n\n```go\nfunc (p *Plugin) PluginName() string\n```\nPluginName returns the plugin name.\n\n```go\nfunc (p *Plugin) PluginVersion() string\n```\nPluginVersion returns the plugin version.\n\n```go\nfunc (p *Plugin) TemplateEngine(logger ambient.Logger, injector ambient.AssetInjector) (ambient.Renderer, error)\n```\nTemplateEngine returns a template engine.\n\n","path":"github.com/ambientkit/plugin/templateengine/htmlengine","name":"htmlengine","synopsis":"Package htmlengine is an Ambient plugin that provides a HTML template engine.","isRedistributable":true}
