You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-4Lines changed: 48 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ This repository contains `html2rss` feed configurations for many websites.
22
22
23
23
## Dynamic Parameters
24
24
25
-
Configs must include a `parameters` section to define default values for dynamic parameters:
25
+
Parameterized configs should include a `parameters` section with default values:
26
26
27
27
```yaml
28
28
parameters:
@@ -38,7 +38,30 @@ channel:
38
38
# ... rest of config
39
39
```
40
40
41
-
The `type` field specifies the parameter type (currently only `string` is supported), and `default` provides the default value when no parameter is explicitly provided.
41
+
The `type` field specifies the parameter type (currently only `string` is supported), and `default` provides the default value used by this repository's validation and fetch tests.
42
+
43
+
Notes:
44
+
45
+
- Only configs that use `%<param>s` placeholders need a `parameters` section.
46
+
- Callers can still override those defaults at runtime with `html2rss feed ... --params ...`.
47
+
- Dynamic substitution applies to `channel` and `headers`; selectors are not parameterized by this feature.
48
+
49
+
## Validation
50
+
51
+
Use both schema-aware editing and runtime validation before committing:
# Export the current JSON Schema locally for editor use
61
+
make schema
62
+
```
63
+
64
+
The JSON Schema is useful for editor autocompletion and basic structural checks. Runtime validation remains authoritative for merged defaults and cross-field rules.
42
65
43
66
## Testing
44
67
@@ -55,12 +78,33 @@ make test-config CONFIG=github.com/releases.yml
55
78
make test-domain DOMAIN=github.com
56
79
```
57
80
58
-
**Adding new configs**: Just create the YAML file and run tests. No spec file needed.
81
+
**Adding new configs**: Create the YAML file, run `make validate`, then run the generated tests. No dedicated spec file is needed.
59
82
60
83
**Config folder convention**: Place configs under the registrable domain folder (e.g., `example.com/` or `bbc.co.uk/`). Legacy subdomain folders (e.g., `news.example.com/`) are allowed but not preferred.
61
84
85
+
## Editor Setup (JSON Schema)
86
+
87
+
Get inline validation and autocompletion when editing configs in your IDE.
88
+
All config files already carry the schema modeline at the top:
0 commit comments