config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Zlib Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = Config{
	Title:     "doctopus",
	Footer:    "Built with [Doctopus](https://doctopus.frankmayer.dev/) 🐙",
	BaseURL:   "https://example.com",
	Lang:      "en",
	DocsDir:   "docs",
	OutputDir: "out",
	Minify:    MinifyEnabled,
	SchemaOrg: map[string]any{
		"@context": "https://schema.org",
		"@type":    "SoftwareApplication",
	},
	Light: map[string]string{
		"--accent-color":          "oklch(60% 0.118 184.704)",
		"--background-color":      "oklch(98.7% 0.002 197.1)",
		"--background-alt-color":  "oklch(96.3% 0.002 197.1)",
		"--foreground-color":      "oklch(14.8% 0.004 228.8)",
		"--border-color":          "oklch(72.3% 0.014 214.4)",
		"--code-background-color": "oklch(92.5% 0.005 214.3)",
	},
	Dark: map[string]string{
		"--accent-color":          "oklch(50.8% 0.118 165.612)",
		"--background-color":      "oklch(14.8% 0.004 228.8)",
		"--background-alt-color":  "oklch(21.8% 0.008 223.9)",
		"--foreground-color":      "oklch(98.7% 0.002 197.1)",
		"--border-color":          "oklch(45% 0.017 213.2)",
		"--code-background-color": "oklch(21.8% 0.008 223.9)",
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Title       string     `yaml:"title"`
	Description string     `yaml:"description"`
	Footer      string     `yaml:"footer,omitempty"`
	BaseURL     string     `yaml:"base_url"`
	Platform    string     `yaml:"platform,omitempty"`
	Lang        string     `yaml:"lang"`
	DocsDir     string     `yaml:"docs_dir"`
	OutputDir   string     `yaml:"output_dir"`
	Minify      Minify     `yaml:"minify,omitempty"`
	Versioning  Versioning `yaml:"versioning,omitempty"`
	Hooks       Hooks      `yaml:"hooks,omitempty"`
	Tools       Tools      `yaml:"tools,omitempty"`
	SchemaOrg   SchemaOrg  `yaml:"schema_org,omitempty"`
	Light       Variables  `yaml:"light"`
	Dark        Variables  `yaml:"dark"`
	RootDir     string     `yaml:"-"`
}

func (Config) CSS

func (v Config) CSS() string

func (*Config) Detect added in v1.0.0

func (c *Config) Detect()

func (*Config) Load

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

func (*Config) Save

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

func (*Config) Validate

func (c *Config) Validate() error

type Hooks

type Hooks struct {
	PreBuild  []string `yaml:"pre_build"`
	PostBuild []string `yaml:"post_build"`
}

type Minify

type Minify uint8
const (
	MinifyEnabled Minify = iota
	MinifyDisabled
)

func ParseMinify

func ParseMinify(value string) (Minify, error)

func (Minify) Enabled

func (m Minify) Enabled() bool

func (Minify) MarshalJSON

func (m Minify) MarshalJSON() ([]byte, error)

func (Minify) MarshalYAML

func (m Minify) MarshalYAML() (interface{}, error)

func (Minify) String

func (m Minify) String() string

func (*Minify) UnmarshalJSON

func (m *Minify) UnmarshalJSON(data []byte) error

func (*Minify) UnmarshalYAML

func (m *Minify) UnmarshalYAML(unmarshal func(interface{}) error) error

func (Minify) Valid

func (m Minify) Valid() bool

type PlantUMLTool added in v1.1.0

type PlantUMLTool struct {
	Raw       string `yaml:"-"`
	Kind      PlantUMLToolKind
	Path      string
	ServerURL string
}

func (PlantUMLTool) Enabled added in v1.1.0

func (t PlantUMLTool) Enabled() bool

func (PlantUMLTool) IsZero added in v1.1.0

func (t PlantUMLTool) IsZero() bool

func (PlantUMLTool) MarshalJSON added in v1.1.0

func (t PlantUMLTool) MarshalJSON() ([]byte, error)

func (PlantUMLTool) MarshalYAML added in v1.1.0

func (t PlantUMLTool) MarshalYAML() (interface{}, error)

func (*PlantUMLTool) UnmarshalJSON added in v1.1.0

func (t *PlantUMLTool) UnmarshalJSON(data []byte) error

func (*PlantUMLTool) UnmarshalYAML added in v1.1.0

func (t *PlantUMLTool) UnmarshalYAML(unmarshal func(interface{}) error) error

type PlantUMLToolKind added in v1.1.0

type PlantUMLToolKind uint8
const (
	PlantUMLToolDisabled PlantUMLToolKind = iota
	PlantUMLToolServer
	PlantUMLToolJar
	PlantUMLToolBinary
)

type SchemaOrg added in v1.0.0

type SchemaOrg map[string]any

func (SchemaOrg) Validate added in v1.0.0

func (s SchemaOrg) Validate() error

type Tools added in v1.1.0

type Tools struct {
	PlantUML PlantUMLTool `yaml:"plantuml,omitempty"`
}

func (Tools) IsZero added in v1.1.0

func (t Tools) IsZero() bool

type Variables

type Variables map[string]string

type Versioning added in v0.4.0

type Versioning struct {
	Mode    VersioningMode      `yaml:"mode"`
	FromStr string              `yaml:"from"`
	Current string              `yaml:"current"`
	From    *semver.Constraints `yaml:"-"`
}

func (Versioning) Enabled added in v0.4.0

func (v Versioning) Enabled() bool

func (Versioning) IncludeCurrent added in v0.4.0

func (v Versioning) IncludeCurrent() bool

func (Versioning) Valid added in v0.4.0

func (v Versioning) Valid() bool

func (Versioning) Validate added in v0.4.0

func (v Versioning) Validate() error

type VersioningMode added in v0.4.0

type VersioningMode uint8
const (
	VersioningDisabled VersioningMode = iota
	VersioningFromDirectories
	VersioningFromGitTags
)

func ParseVersioning added in v0.4.0

func ParseVersioning(value string) (VersioningMode, error)

func (VersioningMode) Enabled added in v0.4.0

func (v VersioningMode) Enabled() bool

func (VersioningMode) MarshalJSON added in v0.4.0

func (v VersioningMode) MarshalJSON() ([]byte, error)

func (VersioningMode) MarshalYAML added in v0.4.0

func (v VersioningMode) MarshalYAML() (interface{}, error)

func (VersioningMode) String added in v0.4.0

func (v VersioningMode) String() string

func (*VersioningMode) UnmarshalJSON added in v0.4.0

func (v *VersioningMode) UnmarshalJSON(data []byte) error

func (*VersioningMode) UnmarshalYAML added in v0.4.0

func (v *VersioningMode) UnmarshalYAML(unmarshal func(interface{}) error) error

func (VersioningMode) Valid added in v0.4.0

func (v VersioningMode) Valid() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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