Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeJSON(data []byte) (types.Twt, error)
- func DefaultTwtManager()
- func NewLexer(r io.Reader) *lexer
- func NewParser(l *lexer) *parser
- func NewTwtFile(twter types.Twter, comments Comments, twts types.Twts) *lextwtFile
- func ParseFile(r io.Reader, twter types.Twter) (types.TwtFile, error)
- func ParseLine(line string, twter types.Twter) (twt types.Twt, err error)
- type Code
- type CodeType
- type Comment
- type Comments
- type DateTime
- type Elem
- type Line
- type Link
- type LinkType
- type ListError
- type Mention
- func (n *Mention) Clone() Elem
- func (n *Mention) Domain() string
- func (n *Mention) Err() error
- func (n *Mention) Format(state fmt.State, r rune)
- func (n *Mention) FormatCompact(out io.Writer)
- func (n *Mention) FormatHTML(out io.Writer)
- func (n *Mention) FormatMarkdown(out io.Writer)
- func (n *Mention) FormatText(out io.Writer)
- func (n *Mention) IsNil() bool
- func (n *Mention) Literal() string
- func (n *Mention) Name() string
- func (n *Mention) SetTarget(target string)
- func (n *Mention) String() string
- func (n *Mention) Target() string
- func (n *Mention) Twter() types.Twter
- func (n *Mention) URL() *url.URL
- type Subject
- type Tag
- func (n *Tag) Clone() Elem
- func (n *Tag) CloneTag() *Tag
- func (n *Tag) Format(state fmt.State, r rune)
- func (n *Tag) FormatCompact(out io.Writer)
- func (n *Tag) FormatHTML(out io.Writer)
- func (n *Tag) FormatMarkdown(out io.Writer)
- func (n *Tag) FormatText(out io.Writer)
- func (n *Tag) IsNil() bool
- func (n *Tag) Literal() string
- func (n *Tag) String() string
- func (n *Tag) Target() string
- func (n *Tag) Text() string
- func (n *Tag) URL() (*url.URL, error)
- type Text
- type TokType
- type Token
- type Twt
- func (twt Twt) Clone() types.Twt
- func (twt Twt) CloneTwt() *Twt
- func (twt Twt) Created() time.Time
- func (twt *Twt) Elems() []Elem
- func (twt *Twt) ExpandLinks(opts types.FmtOpts, lookup types.FeedLookup)
- func (twt *Twt) FilePos() int
- func (twt Twt) Format(state fmt.State, c rune)
- func (twt Twt) FormatText(mode types.TwtTextFormat, opts types.FmtOpts) string
- func (twt Twt) FormatTwt() string
- func (twt *Twt) GobDecode(data []byte) error
- func (twt *Twt) GobEncode() ([]byte, error)
- func (twt Twt) Hash() string
- func (twt *Twt) IsNil() bool
- func (twt *Twt) IsZero() bool
- func (twt Twt) Links() types.LinkList
- func (twt *Twt) Literal() string
- func (twt *Twt) LiteralText() string
- func (twt Twt) MarshalJSON() ([]byte, error)
- func (twt Twt) Mentions() types.MentionList
- func (twt Twt) String() string
- func (twt Twt) Subject() types.Subject
- func (twt Twt) Tags() types.TagList
- func (twt *Twt) Text() string
- func (twt Twt) Twter() types.Twter
- type Twts
Constants ¶
View Source
const EOF rune = -(iota + 1)
EOF represents an end of file.
Variables ¶
View Source
var ErrParseElm = errors.New("error parsing element")
View Source
var ErrParseToken = errors.New("error parsing digit")
Functions ¶
func DefaultTwtManager ¶
func DefaultTwtManager()
func NewTwtFile ¶
Types ¶
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
func (*Code) FormatMarkdown ¶
type Comment ¶
type Comment struct {
// contains filtered or unexported fields
}
func NewComment ¶
func NewCommentValue ¶
type DateTime ¶
type DateTime struct {
// contains filtered or unexported fields
}
func (*DateTime) CloneDateTime ¶
type Elem ¶
type Elem interface { IsNil() bool // A typed nil will fail `elem == nil` We need to unbox to test. Literal() string // value as read from input. Clone() Elem // clone element. fmt.Formatter }
var LineSeparator Elem = &lineSeparator{}
type Mention ¶
type Mention struct {
// contains filtered or unexported fields
}
func NewMention ¶
func (*Mention) FormatCompact ¶
func (*Mention) FormatHTML ¶
func (*Mention) FormatMarkdown ¶
func (*Mention) FormatText ¶
type Subject ¶
type Subject struct {
// contains filtered or unexported fields
}
func NewSubject ¶
func NewSubjectTag ¶
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
func (*Tag) FormatCompact ¶
func (*Tag) FormatHTML ¶
func (*Tag) FormatMarkdown ¶
func (*Tag) FormatText ¶
type TokType ¶
type TokType string
TokType passed to parser.
const ( TokILLEGAL TokType = "ILLEGAL" // Illegal UTF8 TokEOF TokType = "EOF" // End-of-File TokNUMBER TokType = "NUMBER" // Digit 0-9 TokLS TokType = "LS" // Unicode Line Separator TokNL TokType = "NL" // New Line TokSTRING TokType = "STRING" // String TokCODE TokType = "CODE" // Code Block TokSPACE TokType = "SPACE" // White Space TokTAB TokType = "TAB" // Tab TokSCHEME TokType = "://" // URL Scheme TokCOLON TokType = ":" TokHYPHEN TokType = "-" TokDOT TokType = "." TokPLUS TokType = "+" TokT TokType = "T" TokZ TokType = "Z" TokHASH TokType = "#" TokEQUAL TokType = "=" TokAT TokType = "@" TokLT TokType = "<" TokGT TokType = ">" TokLPAREN TokType = "(" TokRPAREN TokType = ")" TokLBRACK TokType = "[" TokRBRACK TokType = "]" TokBANG TokType = "!" TokBSLASH TokType = `\` )
TokType values
type Twt ¶
type Twt struct {
// contains filtered or unexported fields
}
func (*Twt) ExpandLinks ¶
func (twt *Twt) ExpandLinks(opts types.FmtOpts, lookup types.FeedLookup)
func (Twt) FormatText ¶
func (*Twt) LiteralText ¶
func (Twt) MarshalJSON ¶
func (Twt) Mentions ¶
func (twt Twt) Mentions() types.MentionList
Click to show internal directories.
Click to hide internal directories.