From 54e5ba6e79ac5806fd6417dbe94b702a5cadcfbd Mon Sep 17 00:00:00 2001 From: shylinux Date: Tue, 4 Jul 2023 11:05:14 +0800 Subject: [PATCH] add style.go --- core/wiki/style.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 core/wiki/style.go diff --git a/core/wiki/style.go b/core/wiki/style.go new file mode 100644 index 00000000..0228c7ad --- /dev/null +++ b/core/wiki/style.go @@ -0,0 +1,25 @@ +package wiki + +import ( + ice "shylinux.com/x/icebergs" + kit "shylinux.com/x/toolkits" +) + +const STYLE = "style" + +func init() { + Index.MergeCommands(ice.Commands{ + STYLE: {Name: "style class auto", Help: "样式", Hand: func(m *ice.Message, arg ...string) { + switch kit.Select("end", arg, 0) { + case "end": + m.Echo("") + default: + if len(arg) > 1 { + m.Echo(`
`, "story", arg[0], kit.JoinKV(":", ";", arg[1:]...)) + } else { + m.Echo(`
`, "story", arg[0]) + } + } + }}, + }) +}