diff --git a/base/lex/split.go b/base/lex/split.go
index 8b27aa10..6416186a 100644
--- a/base/lex/split.go
+++ b/base/lex/split.go
@@ -66,6 +66,8 @@ func _split_list(m *ice.Message, file string, arg ...string) ice.Map {
ls = cb(ls, data)
case func([]string):
cb(ls)
+ case func([]string) []string:
+ ls = cb(ls)
case nil:
default:
m.ErrorNotImplement(cb)
diff --git a/core/wiki/audio.go b/core/wiki/audio.go
index 96ab287c..f86349df 100644
--- a/core/wiki/audio.go
+++ b/core/wiki/audio.go
@@ -5,12 +5,15 @@ import (
"shylinux.com/x/icebergs/base/nfs"
)
+const (
+ M4A = "m4a"
+)
const AUDIO = "audio"
func init() {
Index.MergeCommands(ice.Commands{
- AUDIO: {Name: "audio url run", Help: "音频", Actions: WordAction(
- ``, nfs.PATH, ice.USR_LOCAL_IMAGE,
+ AUDIO: {Name: "audio url", 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 8ff386f7..52acaaa3 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 run", Help: "摘要", Actions: WordAction(
+ BRIEF: {Name: "brief text", 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 32d4765d..9ad19310 100644
--- a/core/wiki/chart.go
+++ b/core/wiki/chart.go
@@ -56,16 +56,6 @@ 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 {
- res := []string{}
- for i := 0; i < len(arg)-1; i += 2 {
- if arg[i] == "" {
- continue
- }
- res = append(res, kit.Format(`%s="%s"`, arg[i], arg[i+1]))
- }
- 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...)
}
@@ -76,57 +66,42 @@ func (g *Group) EchoLine(group string, x1, y1, x2, y2 int) *ice.Message {
return g.Echo(group, "", x1, y1, x2, y2)
}
func (g *Group) EchoRect(group string, height, width, x, y int, arg ...string) *ice.Message { // rx ry
- return g.Echo(group, ``, height, width, kit.Select("4", arg, 0), kit.Select("4", arg, 1), x, y, g.Join(kit.Slice(arg, 2)...))
+ return g.Echo(group, ``,
+ height, width, kit.Select("4", arg, 0), kit.Select("4", arg, 1), x, y, kit.JoinKV(ice.EQ, ice.SP, kit.Slice(arg, 2)...))
}
func (g *Group) EchoText(group string, x, y int, text string, arg ...string) *ice.Message {
- if text == "" {
- return g.Get(group)
- }
- return g.Echo(group, "%s", x, y, g.Join(arg...), text)
+ return g.Echo(group, "%s", x, y, kit.JoinKV(ice.EQ, ice.SP, arg...), text)
}
func (g *Group) EchoTexts(group string, x, y int, text string, arg ...string) *ice.Message {
m := g.Get(group)
- float := kit.Int(kit.Select("2", "7", kit.Contains(m.Option(ice.MSG_USERUA), "iPhone")))
- if strings.Contains(m.Option(ice.MSG_USERUA), "Chrome") || strings.Contains(m.Option(ice.MSG_USERUA), "Mobile") {
- } else {
- float += 4
- }
+ float := kit.Int(kit.Select("6", "2", strings.Contains(m.Option(ice.MSG_USERUA), "Chrome") || (strings.Contains(m.Option(ice.MSG_USERUA), "Mobile") && !kit.Contains(m.Option(ice.MSG_USERUA), "iPhone"))))
return g.EchoText(group, x, y+float, text, arg...)
}
+func (g *Group) EchoArrowLine(group string, x1, y1, x2, y2 int, arg ...string) *ice.Message { // marker-end
+ return g.Echo(group, "", x1, y1, x2, y2, kit.Select("arrowhead", arg, 0))
+}
func (g *Group) DefsArrow(group string, height, width int, arg ...string) *ice.Message { // name
return g.Echo(group, `
`, kit.Select("arrowhead", arg, 0), height, width, height/2, width, height/2, height)
}
-func (g *Group) EchoArrowLine(group string, x1, y1, x2, y2 int, arg ...string) *ice.Message { // marker-end
- return g.Echo(group, "", x1, y1, x2, y2, kit.Select("arrowhead", arg, 0))
-}
func (g *Group) Dump(m *ice.Message, group string, arg ...string) *Group {
item := NewItem("").Dump(m).Copy(g.Get(group)).Echo("")
return g
}
-func (g *Group) DumpAll(m *ice.Message, group ...string) *Group {
+func (g *Group) DumpAll(m *ice.Message, group ...string) {
for _, grp := range group {
g.Dump(m, grp)
}
- return g
}
type Chart interface {
Init(*ice.Message, ...string) Chart
Draw(*ice.Message, int, int) Chart
- Data(*ice.Message, ice.Any) Chart
GetHeight(...string) int
GetWidth(...string) int
}
@@ -159,12 +134,12 @@ const (
FG = "fg"
BG = "bg"
+ FONT_SIZE = "font-size"
+ FONT_FAMILY = "font-family"
STROKE_DASHARRAY = "stroke-dasharray"
STROKE_WIDTH = "stroke-width"
STROKE = "stroke"
FILL = "fill"
- FONT_SIZE = "font-size"
- FONT_FAMILY = "font-family"
PADDING = "padding"
MARGINX = "marginx"
@@ -181,14 +156,10 @@ const CHART = "chart"
func init() {
Index.MergeCommands(ice.Commands{
- CHART: {Name: "chart type=label,chain,sequence auto text", Help: "图表", Actions: WordAction(
+ CHART: {Name: "chart type=label,chain,sequence run text", Help: "图表", Actions: WordAction(
`