- 授权协议: BSD
- 开发语言: Google Go
- 操作系统: 跨平台
- 软件首页: https://github.com/achun/template
- 软件文档: https://github.com/achun/template
- 官方下载: https://github.com/achun/template
软件介绍
基于官方 text/template 和 html/template 的模板引擎. Template 通过几种惯用方式组合, 为模板提供简洁的使用方式.
特性:模板名仿效 URI 格式, 使用全路径名称命名.
模板名以 ".html" 结尾当作 HTML 模板处理, 否则当作 TEXT 模板处理.
模板源码可使用相对路径名指示目标模板.
引入 RootDir 限制模板文件根目录.
内置 import 函数支持变量名表示模板名.
示例模板:
<html>
<head>
<meta charset="UTF-8">
{{import .js}}
</head>
<body>
{{import .body .}}
</body>
{{template "foot.html"}}
</html>
示例代码:
package main
import (
"github.com/achun/template"
"os"
)
var data = map[string]interface{}{
"title": `>title`,
"body": `/admin/body.html`,
"js": `/admin/js.tmpl`,
"href": ">>>",
"name": "admin",
}
func main() {
pwd, _ := os.Getwd()
t, err := template.New("./fixtures/base/layout.html")
t.Walk(pwd+`/fixtures/base`, ".html.tmpl")
t.Execute(os.Stdout, data)
}
Mathematica Cookbook
Sal Mangano / O'Reilly Media / 2009 / GBP 51.99
As the leading software application for symbolic mathematics, Mathematica is standard in many environments that rely on math, such as science, engineering, financial analysis, software development, an......一起来看看 《Mathematica Cookbook》 这本书的介绍吧!
