Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
Dependency represents a parsed Typst package import.
func ExtractFromDirectory ¶
func ExtractFromDirectory(dirPath string) ([]Dependency, error)
ExtractFromDirectory walks a local directory, scanning all .typ files for imports.
func ExtractFromSource ¶
func ExtractFromSource(content []byte) []Dependency
ExtractFromSource scans a single .typ file's content for package imports.
func ParseDependency ¶ added in v0.12.0
func ParseDependency(pkgName string) Dependency
ParseDependency parses a package spec in the format @namespace/name:version Returns namespace, name, and version (version may be empty)
func (Dependency) IsComplete ¶ added in v0.14.0
func (s Dependency) IsComplete() bool
IsComplete reports whether s fully identifies one package version.
func (Dependency) IsPartial ¶ added in v0.14.0
func (s Dependency) IsPartial() bool
IsPartial reports whether s identifies a package without a pinned version.
func (Dependency) IsValid ¶ added in v0.14.0
func (s Dependency) IsValid() bool
IsValid reports whether s identifies at least a package (partial or complete).
func (Dependency) RelPath ¶ added in v0.12.0
func (s Dependency) RelPath() string
RelPath returns the file system path of the package relative to the cache dir. It returns an empty path unless s is complete.
func (Dependency) String ¶ added in v0.12.0
func (s Dependency) String() string
String returns the normalized string form of the package.