diff --git a/core/wiki/chart.go b/core/wiki/chart.go
index da42eb41..5323f54c 100644
--- a/core/wiki/chart.go
+++ b/core/wiki/chart.go
@@ -25,12 +25,15 @@ type Block struct {
BackGround string
Padding int
- Margin int
+ MarginX int
+ MarginY int
Width, Height int
TextData string
RectData string
+
+ x, y int
}
func (b *Block) Init(m *ice.Message, arg ...string) Chart {
@@ -39,7 +42,8 @@ func (b *Block) Init(m *ice.Message, arg ...string) Chart {
b.FontColor = kit.Select(m.Option("stroke"), kit.Select(b.FontColor, arg, 2))
b.BackGround = kit.Select(m.Option("fill"), kit.Select(b.BackGround, arg, 3))
b.Padding = kit.Int(kit.Select(m.Option("padding"), kit.Select(kit.Format(b.Padding), arg, 4)))
- b.Margin = kit.Int(kit.Select(m.Option("margin"), kit.Select(kit.Format(b.Margin), arg, 5)))
+ b.MarginX = kit.Int(kit.Select(m.Option("marginx"), kit.Select(kit.Format(b.MarginX), arg, 5)))
+ b.MarginY = kit.Int(kit.Select(m.Option("marginy"), kit.Select(kit.Format(b.MarginY), arg, 5)))
return b
}
func (b *Block) Data(m *ice.Message, root interface{}) Chart {
@@ -61,11 +65,11 @@ func (b *Block) Data(m *ice.Message, root interface{}) Chart {
return b
}
func (b *Block) Draw(m *ice.Message, x, y int) Chart {
- m.Echo(`
{{.Option "text"}}
` +var premenu = `{{.Option "text"}}
` + var refer = `{{.Option "text"}}
` +var spark = `{{.Option "text"}}
` var chart = ``)}, - FIELD: {Name: "field", Help: "插件", Value: kit.Data("template", field)}, - SHELL: {Name: "shell", Help: "命令", Value: kit.Data("template", shell)}, - LOCAL: {Name: "local", Help: "文件", Value: kit.Data("template", local)}, + CHART: {Name: CHART, Help: "图表", Value: kit.Data("template", chart, "suffix", ``)}, + FIELD: {Name: FIELD, Help: "插件", Value: kit.Data("template", field)}, + SHELL: {Name: SHELL, Help: "命令", Value: kit.Data("template", shell)}, + LOCAL: {Name: LOCAL, Help: "文件", Value: kit.Data("template", local)}, - ORDER: {Name: "order", Help: "列表", Value: kit.Data("template", order)}, - TABLE: {Name: "table", Help: "表格", Value: kit.Data("template", table)}, - STACK: {Name: "stack", Help: "结构", Value: kit.Data("template", stack)}, + ORDER: {Name: ORDER, Help: "列表", Value: kit.Data("template", order)}, + TABLE: {Name: TABLE, Help: "表格", Value: kit.Data("template", table)}, + IMAGE: {Name: IMAGE, Help: "图片", Value: kit.Data("template", image)}, + VIDEO: {Name: VIDEO, Help: "视频", Value: kit.Data("template", video)}, - WORD: {Name: "word", Help: "语言文字", Value: kit.Data(kit.MDB_SHORT, "name", + WORD: {Name: WORD, Help: "语言文字", Value: kit.Data( "path", "usr", "regs", ".*\\.shy", "alias", map[string]interface{}{ - LABEL: []interface{}{CHART, LABEL}, - CHAIN: []interface{}{CHART, CHAIN}, - - SECTION: []interface{}{TITLE, SECTION}, - CHAPTER: []interface{}{TITLE, CHAPTER}, - ENDMENU: []interface{}{TITLE, ENDMENU}, PREMENU: []interface{}{TITLE, PREMENU}, + CHAPTER: []interface{}{TITLE, CHAPTER}, + SECTION: []interface{}{TITLE, SECTION}, + ENDMENU: []interface{}{TITLE, ENDMENU}, + LABEL: []interface{}{CHART, LABEL}, + CHAIN: []interface{}{CHART, CHAIN}, }, )}, }, Commands: map[string]*ice.Command{ - TITLE: {Name: "title [chapter|section|endmenu|premenu] text", Help: "标题", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + TITLE: {Name: "title [premenu|chapter|section|endmenu] text", Help: "标题", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { if len(arg) == 0 { ns := strings.Split(cli.NodeName, "-") arg = append(arg, kit.Select(ns[len(ns)-1], "")) @@ -307,9 +300,9 @@ func init() { if len(arg) == 1 { arg = append(arg, arg[0]) } - _title_show(m, arg[0], arg[1], arg[2:]...) + _title_show(m, arg[0], kit.Select(arg[0], arg[1]), arg[2:]...) }}, - BRIEF: {Name: "brief name text", Help: "摘要", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + BRIEF: {Name: "brief [name] text", Help: "摘要", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { if len(arg) == 0 { m.Echo(`