diff --git a/base/web/render.go b/base/web/render.go index 372d9635..ede3f458 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -74,6 +74,7 @@ func Render(msg *ice.Message, cmd string, args ...ice.Any) { } { msg.Set(k) } + msg.Debug("what %v %v", cmd, args) if cmd != "" && cmd != ice.RENDER_RAW { // [str [arg...]] msg.Echo(kit.Format(cmd, args...)) diff --git a/core/wiki/audio.go b/core/wiki/audio.go index ee3f73a5..96ab287c 100644 --- a/core/wiki/audio.go +++ b/core/wiki/audio.go @@ -9,7 +9,7 @@ const AUDIO = "audio" func init() { Index.MergeCommands(ice.Commands{ - AUDIO: {Name: "audio url", Help: "音频", Actions: WordAction( + AUDIO: {Name: "audio url run", Help: "音频", Actions: WordAction( ``, nfs.PATH, ice.USR_LOCAL_IMAGE, ), Hand: func(m *ice.Message, arg ...string) { _image_show(m, arg[0], arg[1:]...) }}, }) diff --git a/core/wiki/brief.go b/core/wiki/brief.go index 52acaaa3..8ff386f7 100644 --- a/core/wiki/brief.go +++ b/core/wiki/brief.go @@ -8,7 +8,7 @@ const BRIEF = "brief" func init() { Index.MergeCommands(ice.Commands{ - BRIEF: {Name: "brief text", Help: "摘要", Actions: WordAction( + BRIEF: {Name: "brief text run", Help: "摘要", Actions: WordAction( `
{{.Option "text"}}
`, ), Hand: func(m *ice.Message, arg ...string) { _wiki_template(m, "", arg[0], arg[1:]...) }}, }) diff --git a/core/wiki/chart.go b/core/wiki/chart.go index ac60ff6c..32d4765d 100644 --- a/core/wiki/chart.go +++ b/core/wiki/chart.go @@ -12,12 +12,8 @@ type Item struct { args []ice.Any } -func NewItem(list []string, args ...ice.Any) *Item { - return &Item{list, args} -} -func (item *Item) Echo(str string, arg ...ice.Any) *Item { - item.list = append(item.list, kit.Format(str, arg...)) - return item +func NewItem(str string, args ...ice.Any) *Item { + return &Item{[]string{str}, args} } func (item *Item) Push(str string, arg ice.Any) *Item { switch arg := arg.(type) { @@ -33,6 +29,10 @@ func (item *Item) Push(str string, arg ice.Any) *Item { item.list, item.args = append(item.list, str), append(item.args, arg) return item } +func (item *Item) Echo(str string, arg ...ice.Any) *Item { + item.list = append(item.list, kit.Format(str, arg...)) + return item +} func (item *Item) Dump(m *ice.Message) *ice.Message { return m.Echo(kit.Join(item.list, ice.SP), item.args...).Echo(ice.NL) } @@ -57,14 +57,14 @@ func (g *Group) Option(group string, key string, arg ...ice.Any) string { func (g *Group) Get(group string) *ice.Message { return g.list[group] } func (g *Group) Join(arg ...string) string { - args := []string{} + res := []string{} for i := 0; i < len(arg)-1; i += 2 { if arg[i] == "" { continue } - args = append(args, kit.Format(`%s="%s"`, arg[i], arg[i+1])) + res = append(res, kit.Format(`%s="%s"`, arg[i], arg[i+1])) } - return kit.Join(args, ice.SP) + return kit.Join(res, ice.SP) } func (g *Group) Echo(group string, str string, arg ...ice.Any) *ice.Message { return g.Get(group).Echo(str, arg...) @@ -102,7 +102,7 @@ func (g *Group) EchoArrowLine(group string, x1, y1, x2, y2 int, arg ...string) * return g.Echo(group, "