tccontent

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(c *tgframe.Container, code string)

Code create a code block with syntax highlight.

func CodeWithConf

func CodeWithConf(c *tgframe.Container, code string, conf *CodeConf)

CodeWithConf create a code block with syntax highlight.

func Divider

func Divider(c *tgframe.Container)

Divider create a horizontal line.

func DividerWithID

func DividerWithID(c *tgframe.Container, id string)

DividerWithID create a horizontal line with ID.

func Image

func Image(c *tgframe.Container, img any)

Image show an image.

func ImageWithConf

func ImageWithConf(c *tgframe.Container, img any, conf *ImageConf)

ImageWithConf show an image with a custom configuration.

func Latex

func Latex(c *tgframe.Container, text string)

Text show a text.

func LatexWithID

func LatexWithID(c *tgframe.Container, text string, id string)

TextWithID create a text component with a user specific id.

func Link(c *tgframe.Container, text, url string)

Link create a link component.

func LinkWithID

func LinkWithID(c *tgframe.Container, text, url, id string)

LinkWithID create a link component with a user specific id.

func Markdown

func Markdown(c *tgframe.Container, markdown string)

Markdown render markdown to html.

func MarkdownWithID

func MarkdownWithID(c *tgframe.Container, markdown string, id string)

Markdown create a markdown-rendering part with a user-specific id.

func Subtitle

func Subtitle(c *tgframe.Container, text string)

Subtitle create a subtitle.

func SubtitleWithID

func SubtitleWithID(c *tgframe.Container, text string, id string)

SubtitleWithID create a subtitle component with a user specific id.

func Text

func Text(c *tgframe.Container, text string)

Text show a text.

func TextWithID

func TextWithID(c *tgframe.Container, text string, id string)

TextWithID create a text component with a user specific id.

func Title

func Title(c *tgframe.Container, text string)

Title show a title.

func TitleWithID

func TitleWithID(c *tgframe.Container, text string, id string)

TitleWithID create a title component with a user specific id.

Types

type CodeConf

type CodeConf struct {
	// Language is language of code block, leave empty to use `go`
	Language string

	// ID is id of the component
	ID string
}

CodeConf provide extra config for Code Component.

type ImageConf

type ImageConf struct {
	// Width is the width of the image (e.g. "100px", "50%")
	Width string

	// Format is the format of the image, default is "png"
	Format ImageFormat

	// ID is the unique identifier for this image component
	ID string
}

ImageConf is the configuration for the Image component

type ImageFormat

type ImageFormat int

ImageFormat is the format of the image

const (
	ImageFormatPNG ImageFormat = iota
	ImageFormatJPEG
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL