Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LeadImageFinder ¶
type LeadImageFinder struct {
// contains filtered or unexported fields
}
LeadImageFinder is used to identify a lead image for an article (sometimes known as a mast). Each candidate image is scored based on several heuristics including: - If an ancestor node of the image is the "figure" tag. - If the image is close with content.
In original dom-distiller they have two more heuristics which cannot be implemented here because it would require us to compute the stylesheet (NEED-COMPUTE-CSS): - The ratio of width/height. - The area of the image (width * height) relative to its container.
func NewLeadImageFinder ¶
func NewLeadImageFinder(logger logutil.Logger) *LeadImageFinder
type NestedElementRetainer ¶
type NestedElementRetainer struct{}
func NewNestedElementRetainer ¶
func NewNestedElementRetainer() *NestedElementRetainer
type RelevantElements ¶
type RelevantElements struct{}
func NewRelevantElements ¶
func NewRelevantElements() *RelevantElements
Click to show internal directories.
Click to hide internal directories.