Versions in this module Expand all Collapse all v0 v0.1.3 Jul 27, 2026 v0.1.2 Jul 24, 2026 v0.1.1 Jul 23, 2026 v0.1.0 Jul 23, 2026 Changes in this version + var ErrInvalidURL = errors.New("pagemark: invalid page URL") + var ErrLimit = errors.New("pagemark: resource limit exceeded") + var ErrNoContent = errors.New("pagemark: no useful content") + type BlockDiagnostic struct + ID int + Kind string + Reasons []string + Score float64 + Selected bool + Text string + type Diagnostics struct + Blocks []BlockDiagnostic + Fallback string + PageCandidates []PageCandidate + ProfileVersion string + RejectedLinks []string + type Document struct + Author string + CanonicalURL string + Description string + Diagnostics *Diagnostics + Images []Image + Language string + Links []Link + Markdown string + PageType PageType + PageTypeScore float64 + PublishedTime string + Quality float64 + Sections []Section + SiteName string + Stats Stats + Text string + Title string + URL string + Warnings []Warning + func Extract(input io.Reader, pageURL string, opts ...Option) (*Document, error) + func ExtractBytes(input []byte, pageURL string, opts ...Option) (*Document, error) + func ExtractNode(root *html.Node, pageURL string, opts ...Option) (*Document, error) + type Image struct + Alt string + URL string + type LimitError struct + Count int64 + Max int64 + Resource string + func (e *LimitError) Error() string + func (e *LimitError) Unwrap() error + type Link struct + Text string + URL string + type Option func(*options) + func WithDiagnostics(v bool) Option + func WithFavorPrecision(v bool) Option + func WithFavorRecall(v bool) Option + func WithIncludeImages(v bool) Option + func WithIncludeLinks(v bool) Option + func WithIncludeMetadata(v bool) Option + func WithIncludeTables(v bool) Option + func WithLogger(v *slog.Logger) Option + func WithMaxDepth(v int) Option + func WithMaxElements(v int) Option + func WithMaxImages(v int) Option + func WithMaxInputBytes(v int64) Option + func WithMaxLinks(v int) Option + func WithMaxOutputBytes(v int) Option + func WithMaxRepeatedItems(v int) Option + func WithMaxTableCells(v int) Option + func WithPageType(v PageType) Option + func WithProfile(v Profile) Option + func WithURLPolicy(v URLPolicy) Option + type PageCandidate struct + Score float64 + Type PageType + type PageType string + const PageTypeArticle + const PageTypeCollection + const PageTypeDiscussion + const PageTypeDocumentation + const PageTypeGeneric + const PageTypeListing + const PageTypeProduct + const PageTypeService + type Profile struct + PageType PageType + type Section struct + Heading string + Text string + type Stats struct + Blocks int + Elements int + InputBytes int + OutputBytes int + SelectedBlocks int + TextBytes int + type URLPolicy struct + AllowMailto bool + MaxLength int + Schemes []string + StripTracking bool + type Warning struct + Code string + Message string