Skip to content

Commit

Permalink
✨ Add description fields to configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wesen committed Jan 26, 2025
1 parent da14c1d commit a641f25
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
11 changes: 10 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,4 +614,13 @@ Added Sprig template functions to enhance template capabilities:
- Added full set of Sprig text template functions
- Available in both file templates and config templates
- Includes string manipulation, math, date formatting, and more
- Removed custom add function in favor of Sprig's math functions
- Removed custom add function in favor of Sprig's math functions

# Added Configuration Descriptions

Added description fields to improve configuration documentation:

- Added top-level description field to describe the overall configuration purpose
- Added per-selector description field to document each selector's purpose
- Updated example configurations with detailed descriptions
- Improved self-documentation of configuration files
14 changes: 8 additions & 6 deletions cmd/tools/test-html-selector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@ import (
)

type Config struct {
File string `yaml:"file"`
Selectors []Selector `yaml:"selectors"`
Config struct {
File string `yaml:"file"`
Description string `yaml:"description"`
Selectors []Selector `yaml:"selectors"`
Config struct {
SampleCount int `yaml:"sample_count"`
ContextChars int `yaml:"context_chars"`
Template string `yaml:"template"`
} `yaml:"config"`
}

type Selector struct {
Name string `yaml:"name"`
Selector string `yaml:"selector"`
Type string `yaml:"type"` // "css" or "xpath"
Name string `yaml:"name"`
Selector string `yaml:"selector"`
Type string `yaml:"type"` // "css" or "xpath"
Description string `yaml:"description"`
}

type SimplifiedSample struct {
Expand Down

0 comments on commit a641f25

Please sign in to comment.