forked from x/icebergs
add some
This commit is contained in:
parent
1829822e43
commit
324cd9dc57
@ -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,
|
||||
)
|
||||
|
20
info.go
20
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 {
|
||||
|
34
misc/md/md.go
Normal file
34
misc/md/md.go
Normal 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
13
misc/md/md.js
Normal 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,
|
||||
},
|
||||
},
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user