1
0
forked from x/icebergs

opt wiki.note

This commit is contained in:
shylinux 2020-01-09 11:21:44 +08:00
parent 173c9a194c
commit 220d14faf7
2 changed files with 4 additions and 2 deletions

View File

@ -151,8 +151,8 @@ var Index = &ice.Context{Name: "nfs", Help: "文件模块",
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last", kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { ), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
rg, _ := regexp.Compile(m.Option("dir_reg")) rg, _ := regexp.Compile(m.Option("dir_reg"))
dir(m, kit.Select("./", m.Option("dir_root")), kit.Select("", arg, 0), 0, false, "both", rg, dir(m, kit.Select("./", m.Option("dir_root")), kit.Select("", arg, 0), 0, m.Options("dir_deep"), "both", rg,
strings.Split(kit.Select("time size line path", arg, 2), " "), ice.ICE_TIME) strings.Split(kit.Select("time size line path", arg, 1), " "), ice.ICE_TIME)
}}, }},
"save": {Name: "save path text", Help: "保存", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { "save": {Name: "save path text", Help: "保存", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if f, p, e := kit.Create(arg[0]); m.Assert(e) { if f, p, e := kit.Create(arg[0]); m.Assert(e) {

View File

@ -163,6 +163,8 @@ var Index = &ice.Context{Name: "wiki", Help: "文档模块",
m.Echo(string(markdown.ToHTML(buffer.Bytes(), nil, nil))) m.Echo(string(markdown.ToHTML(buffer.Bytes(), nil, nil)))
}}, }},
"_tree": {Name: "_tree path", Help: "文库", Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) { "_tree": {Name: "_tree path", Help: "文库", Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) {
m.Option("dir_deep", "true")
m.Option("dir_reg", ".*\\.md")
m.Cmdy("nfs.dir", kit.Select(m.Conf("note", "meta.path"), arg, 0), m.Conf("note", "meta.head")) m.Cmdy("nfs.dir", kit.Select(m.Conf("note", "meta.path"), arg, 0), m.Conf("note", "meta.head"))
}}, }},
"note": {Name: "note file", Help: "笔记", Meta: kit.Dict("remote", "you", "display", "inner"), List: kit.List( "note": {Name: "note file", Help: "笔记", Meta: kit.Dict("remote", "you", "display", "inner"), List: kit.List(