-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
55 lines (41 loc) · 988 Bytes
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package moontpl
import (
"io/fs"
)
var moontpl *Moontpl
func RenderFile(filename string) (string, error) {
return moontpl.RenderFile(filename)
}
func RenderString(code string) (string, error) {
return moontpl.RenderString(code)
}
func BuildAll(outputDir string) error {
return moontpl.BuildAll(outputDir)
}
func CopyNonSourceFiles(srcDir, destDir string) error {
return moontpl.CopyNonSourceFiles(srcDir, destDir)
}
func Serve(addr string) {
moontpl.Serve(addr)
}
func SetGlobal(varname string, obj any) {
moontpl.SetGlobal(varname, obj)
}
func SetModule(moduleName string, modMap ModMap) {
moontpl.SetModule(moduleName, modMap)
}
func AddLuaPath(pathStr string) {
moontpl.AddLuaPath(pathStr)
}
func AddLuaDir(dir string) {
moontpl.AddLuaDir(dir)
}
func GetPages() ([]Page, error) {
return moontpl.GetPages()
}
func GetPageFilenames(baseDir string) ([]PagePath, error) {
return moontpl.GetPageFilenames(baseDir)
}
func AddFs(fsys fs.FS) {
moontpl.AddFs(fsys)
}