func Code(c *tgframe.Container, code string) func CodeWithConf(c *tgframe.Container, code string, conf *CodeConf)
c
code
conf
// CodeConf provide extra config for Code Component. type CodeConf struct { // Language is language of code block, leave empty to use `go` Language string // ID is id of the component ID string }
tgcomp.Code(c, "package main\n\nfunc main() {\n\tprintln(\"Hello, World!\")")
tgcomp.CodeWithConf(c, "package main\n\nfunc main() {\n\tprintln(\"Hello, World!\")", &tgcomp.CodeConf{ Language: "go", ID: "mycode", })