config

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataHomePath

func DataHomePath() string

DataHomePath returns the path to the data home directory.

func StateHomePath

func StateHomePath() string

Types

type Config

type Config struct {
	// Whether to display line breaks in the document as line breaks
	Breaks *bool `yaml:"breaks,omitempty" json:"breaks,omitempty"`
	// Conditions for default
	Defaults []DefaultCondition `yaml:"defaults,omitempty" json:"defaults,omitempty"`
	// command to convert code blocks to images
	CodeBlockToImageCommand string `yaml:"codeBlockToImageCommand,omitempty" json:"codeBlockToImageCommand,omitempty"`
	// Template is the path to a .pptx file used as the design template.
	Template string `yaml:"template,omitempty" json:"template,omitempty"`
}

func Load

func Load(profile string) (*Config, error)

Load loads the configuration from the config file. It searches for config files in the following order: 1. $XDG_CONFIG_HOME/slidown/config-{profile}.yml 2. $XDG_CONFIG_HOME/slidown/config.yml If no config file is found, it returns an empty Config struct.

type DefaultCondition

type DefaultCondition struct {
	If     string `json:"if"`               // condition to check
	Layout string `json:"layout,omitempty"` // layout name to apply if condition is true
	Freeze *bool  `json:"freeze,omitempty"` // freeze the page
	Ignore *bool  `json:"ignore,omitempty"` // whether to ignore the page if condition is true
	Skip   *bool  `json:"skip,omitempty"`   // whether to skip the page if condition is true
}

Jump to

Keyboard shortcuts

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