Documentation
¶
Index ¶
- func ContentCSS(s string) string
- func MergeFile(cfg *Config, path string) error
- type ColorsConfig
- type Config
- type CoverConfig
- type FontConfig
- type HeaderFooterConfig
- type HeadingLevel
- type HeadingNumbersConfig
- type HeadingsConfig
- type MarginsConfig
- type PageConfig
- type ReferencesConfig
- type TOCConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentCSS ¶
ContentCSS converts a header/footer slot value to a CSS content value. Empty string produces `""`. Tokens {page} and {pages} become CSS counters.
Types ¶
type ColorsConfig ¶
type Config ¶
type Config struct {
Page PageConfig `yaml:"page"`
Font FontConfig `yaml:"font"`
Headings HeadingsConfig `yaml:"headings"`
Justify bool `yaml:"justify"`
ParagraphIndent string `yaml:"paragraph_indent"`
HeadingIndent string `yaml:"heading_indent"`
HeadingNumbers HeadingNumbersConfig `yaml:"heading_numbers"`
TOC TOCConfig `yaml:"toc"`
Header HeaderFooterConfig `yaml:"header"`
BlankPage bool `yaml:"blank_page"`
Colors ColorsConfig `yaml:"colors"`
Cover CoverConfig `yaml:"cover"`
References ReferencesConfig `yaml:"references"`
Custom map[string]any `yaml:"custom"`
// contains filtered or unexported fields
}
func FromBundle ¶
FromBundle builds a Config from the raw YAML of a bundle's default.yml. Falls back to Default() if data is nil.
func (*Config) ApplyDocMeta ¶
ApplyDocMeta overrides header/footer Left/Center/Right from the document's front matter. Front matter keys "header" and "footer" accept the same left/center/right sub-keys.
func (*Config) CustomString ¶
CustomString returns a string value from Config.Custom at the given dot-separated path, falling back to def if missing or not a string (e.g. "invoice.labels.client").
func (*Config) ResolvePath ¶
ResolvePath resolves a path relative to the config file's directory.
type CoverConfig ¶
type FontConfig ¶
type HeaderFooterConfig ¶
type HeaderFooterConfig struct {
}
HeaderFooterConfig configures a header or footer band on every page. Left/Center/Right accept plain text or {page}/{pages} tokens.
type HeadingLevel ¶
type HeadingNumbersConfig ¶
type HeadingsConfig ¶
type HeadingsConfig struct {
H1 HeadingLevel `yaml:"h1"`
H2 HeadingLevel `yaml:"h2"`
H3 HeadingLevel `yaml:"h3"`
H4 HeadingLevel `yaml:"h4"`
H5 HeadingLevel `yaml:"h5"`
H6 HeadingLevel `yaml:"h6"`
}
type MarginsConfig ¶
type PageConfig ¶
type PageConfig struct {
Size string `yaml:"size"`
Margins MarginsConfig `yaml:"margins"`
}