Documentation ¶
Index ¶
- Variables
- func Anchor(text, href string) string
- func Get(attrs []html.Attribute, key string) string
- type AnchorFormat
- type Output
- type PlainTagConverter
- type Tag
- type TagConverter
- type Writer
- func (w *Writer) Bold(text string, args ...interface{}) *Writer
- func (w *Writer) Code(text string, args ...interface{}) *Writer
- func (w *Writer) Context() context.Context
- func (w *Writer) EndTag() *Writer
- func (w *Writer) Flush() error
- func (w *Writer) Italic(text string, args ...interface{}) *Writer
- func (w *Writer) Link(text, href string) *Writer
- func (w *Writer) Markup(reader io.Reader) *Writer
- func (w *Writer) MarkupString(markup string) *Writer
- func (w *Writer) Media(url string, ref syncf.Ref[*receiver.Media], collapsible bool, anchored bool) *Writer
- func (w *Writer) Pre(text string, args ...interface{}) *Writer
- func (w *Writer) StartTag(name string, attrs []html.Attribute) *Writer
- func (w *Writer) Text(text string, args ...interface{}) *Writer
- func (w *Writer) WithContext(ctx context.Context) *Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultLinkAllocSize = 200 DefaultMaxMessageSize = telegram.MaxMessageSize - DefaultLinkAllocSize DefaultMaxCaptionSize = telegram.MaxCaptionSize - DefaultLinkAllocSize )
View Source
var ( Bold = Tag{Open: "<b>", Close: "</b>"} Italic = Tag{Open: "<i>", Close: "</i>"} Code = Tag{Open: "<code>", Close: "</code>"} Pre = Tag{Open: "<pre>", Close: "</pre>"} )
View Source
var DefaultTagConverter = PlainTagConverter{ "strong": Bold, "b": Bold, "italic": Italic, "em": Italic, "i": Italic, "code": Code, "pre": Pre, }
Functions ¶
Types ¶
type AnchorFormat ¶
var DefaultAnchorFormat AnchorFormat = defaultAnchorFormat{}
type Output ¶
type Output interface { IsOverflown() bool UpdatePrefix(update func(prefix string) string) UpdateSuffix(update func(suffix string) string) Write(text string) WriteBreakable(ctx context.Context, text string) error WriteUnbreakable(ctx context.Context, text string) error AddMedia(ctx context.Context, ref syncf.Ref[*receiver.Media], anchor string, collapsible bool) error BreakPage(ctx context.Context) error Flush(ctx context.Context) error PageCapacity(ctx context.Context) int }
type PlainTagConverter ¶
type TagConverter ¶
type Writer ¶
type Writer struct { Out Output Tags TagConverter Anchors AnchorFormat // contains filtered or unexported fields }
func (*Writer) MarkupString ¶
Click to show internal directories.
Click to hide internal directories.