1
0
forked from x/icebergs
icebergs/core/wiki/local.go
2022-07-09 20:13:21 +08:00

28 lines
771 B
Go

package wiki
import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/nfs"
kit "shylinux.com/x/toolkits"
)
func _local_show(m *ice.Message, name, text string, arg ...string) {
m.Option(INPUT, m.Cmdx(nfs.CAT, text))
_wiki_template(m, LOCAL, name, text, arg...)
}
const LOCAL = "local"
func init() {
Index.Merge(&ice.Context{Commands: ice.Commands{
LOCAL: {Name: "local [name] file", Help: "文件", Hand: func(m *ice.Message, arg ...string) {
arg = _name(m, arg)
_local_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...)
}},
}, Configs: ice.Configs{
LOCAL: {Name: LOCAL, Help: "文件", Value: kit.Data(
nfs.TEMPLATE, `<code {{.OptionTemplate}}>{{range $index, $value := .Optionv "input"}}{{$value}}{{end}}</code>`,
)},
}})
}