Documentation
¶
Overview ¶
Package htmlmd turns a part of an HTML page into Markdown, selected and cleaned with simple CSS selectors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSelector = errors.New("invalid selector")
ErrSelector is wrapped by every selector parse error.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is a parsed HTML page. Its methods don't change it, so one page can be converted in parts.
type Options ¶
type Options struct {
Content string // selector of the element to convert; empty means main, else body
Strip []string // selectors of elements to drop before converting
}
Options selects and cleans the part of a page to convert.
type Selector ¶
type Selector struct {
// contains filtered or unexported fields
}
Selector matches elements by tag, id and classes, such as div.body, a.headerlink or #main. It has no combinators: one selector names one element.
func ParseSelector ¶
ParseSelector parses tag, #id and .class parts written together without spaces.