1
0
mirror of https://shylinux.com/x/icebergs synced 2025-06-26 10:27:31 +08:00
This commit is contained in:
root 2025-02-06 16:21:11 +08:00
parent 1829822e43
commit 324cd9dc57
4 changed files with 67 additions and 10 deletions

View File

@ -95,9 +95,17 @@ func _autogen_gits(m *ice.Message, arg ...string) string {
} }
func _autogen_git(m *ice.Message, arg ...string) ice.Map { func _autogen_git(m *ice.Message, arg ...string) ice.Map {
msg := m.Cmd(REPOS, REMOTE) 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(), 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), 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(""), 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, cli.SYSTEM, ice.Info.System,
) )

20
info.go
View File

@ -21,15 +21,17 @@ type MakeInfo struct {
Git string Git string
Go string Go string
Remote string Icebergs string
Branch string Release string
Version string Remote string
Forword string Branch string
Message string Version string
Author string Forword string
Email string Message string
Hash string Author string
When string Email string
Hash string
When string
} }
func (s MakeInfo) Versions() string { func (s MakeInfo) Versions() string {

34
misc/md/md.go Normal file
View File

@ -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{}) }

13
misc/md/md.js Normal file
View File

@ -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,
},
},
})