Documentation
¶
Overview ¶
Package html helper library for parsing HTML for Altid markup
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cleaner ¶
type Cleaner struct {
// contains filtered or unexported fields
}
Cleaner wraps the underlying WriteCloser, and handles parsing HTML into Altid-flavoured markdown, to the underlying writer.
func NewCleaner ¶
func NewCleaner(w io.WriteCloser, p Handler) (*Cleaner, error)
NewCleaner returns a usable Cleaner struct if either w or p are nil it will return an error
func (*Cleaner) Close ¶
func (c *Cleaner) Close()
Close calls the underlying WriteCloser's Close method.
func (*Cleaner) Parse ¶
func (c *Cleaner) Parse(r io.ReadCloser) error
Parse - This assumes properly formatted html, and will return an error from the underlying html tokenizer if encountered Parse writes properly formatted Altid markup to the underlying writer, translating many elements into their markdown form. This will be considered lossy, as the token metadata is ignored in all cases. This will return any errors encountered, and EOF on success
type Handler ¶
type Handler interface { NavHandler ImgHandler }
Handler will be called to satisfy both <nav> and <img> elements
type ImgHandler ¶
ImgHandler is called when the parser encounters an <img> element
type NavHandler ¶
type NavHandler interface {
}NavHandler is called when the parser encounters a <nav> element