manifest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidManifest = errors.New("not a valid typst manifest")

Functions

func ConfigurableWriteTOML

func ConfigurableWriteTOML(w io.Writer, p PackageInfo, data []byte, unmarshal UnmarshalFunc) error

Write the Packageinfo (name, version and entrypoint) to io.Writer

The Unmarshal Function can be configured (e.g. for testing Purposes)

func DefaultUnmarshaler

func DefaultUnmarshaler(data []byte, v any) error

The Default Unmarshal function.

func WriteTOML

func WriteTOML(w io.Writer, p PackageInfo, data []byte) error

Write the Packageinfo (name, version and entrypoint) to io.Writer

Types

type Manifest

type Manifest struct {
	Package PackageInfo `toml:"package"`
}

type PackageInfo

type PackageInfo struct {
	// The Name of the Package
	Name string `toml:"name"`
	// The Version of the Package
	Version string `toml:"version"`
	// The Entrypoint of the Package
	Entrypoint string `toml:"entrypoint"`
}

Structure with the required Typst TOML fields

func ConfigureableUnmarshal

func ConfigureableUnmarshal(data []byte, unmarshal UnmarshalFunc) (PackageInfo, error)

Unmarshal a byte slice into a PackageInfo Struct

The Unmarshal Function can be configured (e.g. for testing Purposes)

func TypstTOMLUnmarshal

func TypstTOMLUnmarshal(data []byte) (PackageInfo, error)

Unmarshal a byte slice into a PackageInfo Struct

func (*PackageInfo) ValidateVersion

func (p *PackageInfo) ValidateVersion() bool

type UnmarshalFunc

type UnmarshalFunc func([]byte, any) error

Jump to

Keyboard shortcuts

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