Markdown
Prose supports emoji shortcodes. A shortcode in a code span or a fenced block stays as written.
Formulas are written in LaTeX and drawn by KaTeX, as in the
Latex component: $...$ inline, $$...$$ as a block. An inline
formula can't start or end with a space, so $5 and $10 stays text.
API
Interface
func Markdown(c *tgframe.Container, markdown string, conf ...*MarkdownConf)
Parameters
c: Parent container.markdown: Markdown content to display.conf: Optional configuration, at most one.
// MarkdownConf is the configuration for the Markdown component.
type MarkdownConf struct {
tgframe.Base // ID
}
Example
tgcomp.Markdown(c, "* Hello, World!")
tgcomp.Markdown(c, "Euler: $e^{i\\pi} + 1 = 0$")
tgcomp.Markdown(c, "* Hello, World!", &tgcomp.MarkdownConf{ID: "my_markdown"})