package
module
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Jul 21, 2023
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
gotmpl2html
gotmpl2html is a cli tool to convert gotemplate to html.
Usage
$ gotmpl2html input.gotmpl > output.html
For more information, see usage
Feature
-
JSON Binding
Example
- employeelist.json
{
"title": "Employee List",
"employees": [
{
"id": "001",
"name": "James",
"age": 20
},
{
"id": "002",
"name": "Mary",
"age": 30
},
{
"id": "003",
"name": "Linda",
"age": 40
}
]
}
- input.gotmpl
{{data "/employeelist.json" }}
<html>
<head>
<title>{{.title}}</title>
</head>
<body>
{{template "/_header.partial" . }}
<table>
{{range .employees}}
<tr>
<td>{{.id}}</td>
<td>{{.name}}</td>
<td>{{.age}}</td>
</tr>
{{end}}
</table>
{{template "/_footer.partial" . }}
</body>
</html>
Documentation
¶
View Source
const (
EXIT_SUCCESS = 0
EXIT_FAILURE = 1
)
func (a *App) Run() (exitStatus int)
Source Files
¶
Directories
¶
cmd
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.