Documentation
¶
Overview ¶
Package main: batch subcommand.
runBatch streams URLs line-by-line from stdin or --input. Streaming (vs io.ReadAll) bounds memory for large URL lists; a bounded scanner buffer caps any single line so a pathological input cannot OOM the process.
Package main: `defuddle extractors` subcommand — lists registered site-specific extractor mappings or matches a single URL when --match is set.
Package main: HTTP client construction for the parse command.
buildHTTPClient assembles a *requests.Client from CLI fetch flags (--user-agent, --header, --proxy, --timeout). It returns nil when all flags are unset so callers can fall through to defuddle's built-in default client (preserves prior behavior).
Package main: bounded I/O helpers for parse mode.
All local input paths (stdin, --output file, HTML files) share a single size ceiling (maxInputSize) and a directory-traversal guard so a pathological input cannot OOM the process or escape its working set.
Package main provides the defuddle CLI application.
Package main: `defuddle parse` subcommand and its supporting helpers.
parseCmd is the cobra wrapper; parseContent reads flags into a ParseOptions struct and hands off to executeParseContent, which drives the load → render → write pipeline. loadResult routes stdin / URL / file inputs through the defuddle library; renderOutput formats the Result for JSON, markdown, raw content, or a single --property accessor.
Package main: property accessors for `defuddle parse --property`.
propertyExtractors is the canonical map of valid --property values to Result accessors. knownProperties exposes the sorted key list for error messages; getProperty performs case-insensitive lookup.