page

package
v0.0.0-...-a0a6b0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2023 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

type Anchor struct {
	URL  *url.URL
	Text string
}

type Config

type Config struct {
	Client    *http.Client
	Referer   string
	UserAgent string
}

type Content

type Content struct {
	HTML, Markdown string
}

type Meta

type Meta struct {
	Title    string
	Byline   string
	Duration time.Duration
}

type Option

type Option = func(*Config)

func WithClient

func WithClient(client *http.Client) Option

func WithReferer

func WithReferer(referer string) Option

func WithUserAgent

func WithUserAgent(userAgent string) Option

type Page

type Page struct {
	URL     *url.URL
	Content Content
	Meta    Meta
	Anchors []Anchor
}

func New

func New(ctx context.Context, URL *url.URL, opts ...Option) (*Page, error)

func (*Page) AsBookmark

func (p *Page) AsBookmark() bookmark.Bookmark

func (*Page) Render

func (p *Page) Render(renderer *glamour.TermRenderer) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL