scan

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package scan holds small, dependency-free file inspection helpers shared by the filesystem adapter, the interactive prompt, and converter backends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTextFile

func IsTextFile(path string) (bool, error)

IsTextFile probes the beginning of the file and reports whether it looks like plain text. Directories are never text files.

func LooksLikeText

func LooksLikeText(data []byte) bool

LooksLikeText reports whether the byte sample reads as plain text.

func SVGLength

func SVGLength(value string) (float64, bool)

SVGLength parses an SVG length attribute value such as "128", "128px". Percent values are rejected because they have no absolute size.

func SVGSize

func SVGSize(path string) (string, bool, error)

SVGSize returns the intrinsic size of an SVG document as "WxH", preferring width/height attributes and falling back to the viewBox.

func SVGViewBoxSize

func SVGViewBoxSize(value string) (float64, float64, bool)

SVGViewBoxSize extracts width and height from a viewBox attribute value.

func SizeString

func SizeString(width float64, height float64) string

SizeString renders float dimensions as a "WxH" string with a 1px floor.

Types

This section is empty.

Jump to

Keyboard shortcuts

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