Documentation
¶
Index ¶
- Constants
- type ExtraFlag
- type IndexMapper
- type RenderOption
- type RenderedArticle
- type Segment
- func (s *Segment) HasExtraFlags(fl ExtraFlag) bool
- func (s *Segment) InnerBytes() []byte
- func (s *Segment) TrimRight(cutset string)
- func (s *Segment) WriteClose(w io.Writer) (int, error)
- func (s *Segment) WriteInner(w io.Writer) (int, error)
- func (s *Segment) WriteOpen(w io.Writer) (int, error)
- func (s *Segment) WriteTo(w io.Writer) (total int64, err error)
- type TerminalState
- func (t *TerminalState) ApplyEscapeSequence(esc ansi.EscapeSequence)
- func (t *TerminalState) Bg() int
- func (t *TerminalState) Equal(u *TerminalState) bool
- func (t *TerminalState) Fg() int
- func (t *TerminalState) Flags() int
- func (t *TerminalState) HasFlags(f int) bool
- func (t *TerminalState) IsDefaultState() bool
- func (t *TerminalState) Reset()
- func (t *TerminalState) SetColor(fg, bg, flags int)
Constants ¶
View Source
const ( ClassFgPrefix = `f` ClassBgPrefix = `b` ClassHighlight = `hl` ClassPushDiv = `push` ClassPushTag = `push-tag` ClassPushUserId = `push-userid` ClassPushContent = `push-content` ClassPushIpDatetime = `push-ipdatetime` ClassArticleMetaLine = `article-metaline` ClassArticleMetaLineRight = `article-metaline-right` ClassArticleMetaTag = `article-meta-tag` ClassArticleMetaValue = `article-meta-value` )
View Source
const ( NoFlags = 1 << iota Highlighted )
Flags
View Source
const ( DefaultFg = 7 DefaultBg = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexMapper ¶
type IndexMapper struct {
// contains filtered or unexported fields
}
func NewIndexMapper ¶
func NewIndexMapper(elemLen int) *IndexMapper
func (*IndexMapper) Get ¶
func (im *IndexMapper) Get(from int) []int
func (*IndexMapper) Record ¶
func (im *IndexMapper) Record(from int, to ...int)
func (*IndexMapper) Reset ¶
func (im *IndexMapper) Reset()
type RenderOption ¶
type RenderOption func(*renderer)
func WithContent ¶
func WithContent(content []byte) RenderOption
func WithContext ¶
func WithContext(ctx context.Context) RenderOption
func WithDisableArticleHeader ¶
func WithDisableArticleHeader() RenderOption
type RenderedArticle ¶
func Render ¶
func Render(opts ...RenderOption) (RenderedArticle, error)
type Segment ¶
type Segment struct { *bytes.Buffer Tag string ExtraFlags ExtraFlag TermState TerminalState }
func (*Segment) HasExtraFlags ¶
func (*Segment) InnerBytes ¶
type TerminalState ¶
type TerminalState struct {
// contains filtered or unexported fields
}
func (*TerminalState) ApplyEscapeSequence ¶
func (t *TerminalState) ApplyEscapeSequence(esc ansi.EscapeSequence)
func (*TerminalState) Bg ¶
func (t *TerminalState) Bg() int
func (*TerminalState) Equal ¶
func (t *TerminalState) Equal(u *TerminalState) bool
func (*TerminalState) Fg ¶
func (t *TerminalState) Fg() int
func (*TerminalState) Flags ¶
func (t *TerminalState) Flags() int
func (*TerminalState) HasFlags ¶
func (t *TerminalState) HasFlags(f int) bool
func (*TerminalState) IsDefaultState ¶
func (t *TerminalState) IsDefaultState() bool
func (*TerminalState) Reset ¶
func (t *TerminalState) Reset()
func (*TerminalState) SetColor ¶
func (t *TerminalState) SetColor(fg, bg, flags int)
Click to show internal directories.
Click to hide internal directories.