Documentation
¶
Index ¶
- Variables
- func ConfigurableUpdateToml(w io.Writer, p PackageInfo, data []byte, unmarshal Unmarshaler, indent bool) error
- func CopyFile(src, dst string) error
- func Exists(path string) bool
- func UpdateTOML(w io.Writer, p PackageInfo, data []byte, indent bool) error
- type Manifest
- type PackageInfo
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidManifest = errors.New("not a valid typst manifest")
View Source
var ErrLoadingTypstToml = errors.New("could not load typst.toml")
Functions ¶
func ConfigurableUpdateToml ¶
func ConfigurableUpdateToml(w io.Writer, p PackageInfo, data []byte, unmarshal Unmarshaler, indent bool) error
Write the Packageinfo (name, version and entrypoint) to io.Writer
The Unmarshal Function can be configured (e.g. for testing Purposes)
func UpdateTOML ¶
Update the Packageinfo (name, version and entrypoint)
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 ConfigureableUnmarshalToPackage ¶
func ConfigureableUnmarshalToPackage(data []byte, unmarshal Unmarshaler) (PackageInfo, error)
Unmarshal a byte slice into a PackageInfo Struct
The Unmarshal Function can be configured (e.g. for testing Purposes)
func LoadPackageFromDirectory ¶
func LoadPackageFromDirectory(directory string) (PackageInfo, error)
Load a typst Package from a directory. Returns an error if not existing.
func UnmarshalToPackage ¶
func UnmarshalToPackage(data []byte) (PackageInfo, error)
Unmarshal a byte slice into a PackageInfo Struct
func (*PackageInfo) ValidateVersion ¶
func (p *PackageInfo) ValidateVersion() bool
type Unmarshaler ¶
Click to show internal directories.
Click to hide internal directories.