diff --git a/core/code/autogen.go b/core/code/autogen.go index e0401f62..4371d129 100644 --- a/core/code/autogen.go +++ b/core/code/autogen.go @@ -95,9 +95,17 @@ func _autogen_gits(m *ice.Message, arg ...string) string { } func _autogen_git(m *ice.Message, arg ...string) ice.Map { msg := m.Cmd(REPOS, REMOTE) + m.Cmd(MOD, mdb.RENDER, MOD, "go.mod", "./").Table(func(value ice.Maps) { + if value["require"] == "shylinux.com/x/ice" { + msg.Append("release", value["version"]) + } + if value["require"] == "shylinux.com/x/icebergs" { + msg.Append("icebergs", value["version"]) + } + }) return kit.Dict(arg, aaa.USERNAME, m.Option(ice.MSG_USERNAME), tcp.HOSTNAME, ice.Info.Hostname, nfs.PATH, kit.Path("")+nfs.PS, mdb.TIME, m.Time(), GIT, GitVersion(m), GO, GoVersion(m), nfs.MODULE, _autogen_mod(m, ice.GO_MOD), - msg.AppendSimple("remote,branch,version,forword,author,email,hash,when,message"), + msg.AppendSimple("remote,branch,version,forword,author,email,hash,when,message,release,icebergs"), web.DOMAIN, m.Spawn(kit.Dict(ice.MSG_USERWEB, web.UserHost(m), ice.MSG_USERPOD, m.Option(ice.MSG_USERPOD))).MergePod(""), cli.SYSTEM, ice.Info.System, ) diff --git a/info.go b/info.go index 009c08b1..e9a21b81 100644 --- a/info.go +++ b/info.go @@ -21,15 +21,17 @@ type MakeInfo struct { Git string Go string - Remote string - Branch string - Version string - Forword string - Message string - Author string - Email string - Hash string - When string + Icebergs string + Release string + Remote string + Branch string + Version string + Forword string + Message string + Author string + Email string + Hash string + When string } func (s MakeInfo) Versions() string { diff --git a/misc/md/md.go b/misc/md/md.go new file mode 100644 index 00000000..8bf6da0d --- /dev/null +++ b/misc/md/md.go @@ -0,0 +1,34 @@ +package md + +import ( + "path" + + "github.com/gomarkdown/markdown" + "shylinux.com/x/ice" + "shylinux.com/x/icebergs/base/nfs" +) + +type md struct { + ice.Code + ice.Lang + list string `name:"list name auto" help:"示例"` +} + +func (s md) Init(m *ice.Message, arg ...string) { + s.Lang.Init(m, nfs.SCRIPT, m.Resource("")) +} +func (s md) List(m *ice.Message, arg ...string) { + s.Code.Source(m, "", arg...) +} +func (s md) Render(m *ice.Message, arg ...string) { + md := []byte(m.Cmdx(nfs.CAT, path.Join(arg[2], arg[1]))) + html := markdown.ToHTML(md, nil, nil) + m.Echo(string(html)) +} +func (s md) Engine(m *ice.Message, arg ...string) { + md := []byte(m.Cmdx(nfs.CAT, path.Join(arg[2], arg[1]))) + html := markdown.ToHTML(md, nil, nil) + m.Echo(string(html)) +} + +func init() { ice.Cmd("web.wiki.md", md{}) } diff --git a/misc/md/md.js b/misc/md/md.js new file mode 100644 index 00000000..6409b03b --- /dev/null +++ b/misc/md/md.js @@ -0,0 +1,13 @@ +Volcanos(chat.ONSYNTAX, { + md: { + prefix: {"//": code.COMMENT}, + regexp: {"[A-Z_0-9]+": code.CONSTANT}, + keyword: { + "package": code.KEYWORD, + "import": code.KEYWORD, + "public": code.KEYWORD, + "private": code.KEYWORD, + "static": code.KEYWORD, + }, + }, +}) \ No newline at end of file