article

package
v0.0.0-...-cdfe42d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(ctx context.Context, url string, width int) (string, error)

func Validate

func Validate(title, domain string) error

Types

type Parsed

type Parsed struct {
	// contains filtered or unexported fields
}

Parsed holds the intermediate representation of a fetched article, allowing re-rendering at different widths without re-fetching.

func NewParsedFromMarkdown

func NewParsedFromMarkdown(md string) *Parsed

NewParsedFromMarkdown creates a Parsed value from raw Markdown text, bypassing the network fetch. Intended for tests that need a Parsed without hitting a real URL.

func Parse

func Parse(ctx context.Context, url string) (*Parsed, error)

Parse fetches and parses an article, returning the intermediate representation that can be rendered at any width.

func (*Parsed) Render

func (p *Parsed) Render(width int) string

func (*Parsed) RenderWithHeader

func (p *Parsed) RenderWithHeader(width int, header string) string

Jump to

Keyboard shortcuts

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