config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package config provides configuration handling for mtcvctm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// InputFile is the path to the input markdown file
	InputFile string `yaml:"input" json:"input"`

	// OutputFile is the path to the output VCTM file
	OutputFile string `yaml:"output" json:"output"`

	// OutputDir is the directory for output files (used in multi-format mode)
	OutputDir string `yaml:"output_dir" json:"output_dir"`

	// BaseURL is the base URL for generating image URLs
	BaseURL string `yaml:"base_url" json:"base_url"`

	// VCT is the Verifiable Credential Type identifier
	VCT string `yaml:"vct" json:"vct"`

	// Language is the default language for display properties
	Language string `yaml:"language" json:"language"`

	// GitHubAction indicates if running in GitHub Action mode
	GitHubAction bool `yaml:"github_action" json:"github_action"`

	// VCTMBranch is the branch to commit VCTM files to in GitHub Action mode
	VCTMBranch string `yaml:"vctm_branch" json:"vctm_branch"`

	// InlineImages embeds images as base64 data URLs in the VCTM
	InlineImages bool `yaml:"inline_images" json:"inline_images"`

	// Formats is a comma-separated list of output formats (vctm, mddl, w3c, all)
	Formats string `yaml:"formats" json:"formats"`
}

Config holds the configuration for mtcvctm

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a configuration with default values

func LoadFromFile

func LoadFromFile(path string) (*Config, error)

LoadFromFile loads configuration from a YAML file

func (*Config) GetOutputFile

func (c *Config) GetOutputFile() string

GetOutputFile returns the output file path, deriving from input if not set

func (*Config) GetVCT

func (c *Config) GetVCT() string

GetVCT returns the VCT identifier, deriving from base_url if not set

func (*Config) Merge

func (c *Config) Merge(other *Config)

Merge merges another config into this one, with the other taking precedence for non-empty values

func (*Config) SaveToFile

func (c *Config) SaveToFile(path string) error

SaveToFile saves the configuration to a YAML file

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid

Jump to

Keyboard shortcuts

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