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
docs: align ruby gem guides with current config behavior (#1083)
* docs(ruby-gem): align reference pages with current config surface
* docs(ruby-gem): make guides and tutorials use valid configs
* Apply suggestions from code review
Copy file name to clipboardExpand all lines: src/content/docs/ruby-gem/how-to/custom-http-requests.mdx
+75-9Lines changed: 75 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "Custom HTTP Requests"
3
3
description: "Learn how to customize HTTP requests with custom headers, authentication, and API interactions for html2rss."
4
4
---
5
5
6
-
Some websites require custom HTTP headers, authentication, or specific request configurations to access their content. html2rss makes it easy to customize your requests to handle these scenarios.
6
+
Some websites require custom HTTP headers, authentication, or other request settings to access their content. `html2rss` lets you customize requests for those cases.
7
7
8
8
## When You Need Custom Headers
9
9
@@ -17,7 +17,7 @@ You might need custom HTTP requests when:
17
17
18
18
## Basic Configuration
19
19
20
-
Add a `headers` section to your feed configuration:
20
+
Add a `headers` section to your feed configuration. This example is a complete, valid config:
21
21
22
22
```yaml
23
23
headers:
@@ -28,9 +28,11 @@ channel:
28
28
url: https://api.example.com/posts
29
29
selectors:
30
30
items:
31
-
selector: ".post"
31
+
selector: "array > object"
32
32
title:
33
-
selector: "h2"
33
+
selector: "title"
34
+
url:
35
+
selector: "url"
34
36
```
35
37
36
38
## Common Use Cases
@@ -43,6 +45,15 @@ Many APIs require authentication tokens:
See our [Dynamic Parameters guide](/ruby-gem/how-to/dynamic-parameters) for more details.
93
139
140
+
## Notes
141
+
142
+
- Header examples that target third-party APIs are illustrative. Authentication requirements, header names, and response shapes can change independently of `html2rss`.
143
+
- For JSON APIs, validate the response structure before assuming selectors like `array > object` or `html_url` will match.
144
+
- If you document or share a config for reuse, prefer placeholder values and parameterized headers over embedding real tokens.
145
+
94
146
## Testing Your Headers
95
147
96
148
Test your configuration to ensure headers work correctly:
Copy file name to clipboardExpand all lines: src/content/docs/ruby-gem/how-to/dynamic-parameters.mdx
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,17 +3,25 @@ title: Dynamic Parameters
3
3
description: "Learn how to use dynamic parameters in URLs and headers for creating reusable feed configurations. Pass runtime values to customize feeds."
4
4
---
5
5
6
-
For websites with similar structures but varying content based on a parameter in the URL or headers, you can use dynamic parameters.
6
+
Use dynamic parameters when websites share the same structure but vary by URL or header values.
7
7
8
8
## Solution
9
9
10
10
You can add dynamic parameters to the `channel` and `headers` values. This is useful for creating feeds from structurally similar pages with different URLs.
- You provide the actual values for these parameters at runtime using the `--params` option.
31
39
- This allows you to reuse the same feed configuration for multiple similar pages or APIs.
32
40
41
+
## Notes
42
+
43
+
- Dynamic substitution applies to `channel` and `headers`. Selector definitions are not parameterized by this feature.
44
+
- If a config references `%<param>s` and you do not provide a value, feed generation fails unless the caller supplies a fallback.
45
+
- For shared config repositories such as `html2rss-configs`, it is common to store default parameter values alongside the config so examples, validation, and tests have concrete inputs.
46
+
33
47
## Related Topics
34
48
35
49
- **[Custom HTTP Requests](/ruby-gem/how-to/custom-http-requests/)** - Using dynamic parameters in headers
Copy file name to clipboardExpand all lines: src/content/docs/ruby-gem/reference/channel.mdx
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,9 @@ title: Channel
3
3
description: "Learn about the channel configuration block for RSS feed metadata. Configure feed title, description, author, and other RSS channel properties."
4
4
---
5
5
6
-
The `channel` configuration block defines the metadata for your RSS feed.
6
+
The `channel` configuration block defines your feed metadata.
7
+
8
+
This example is a complete feed config so you can see the `channel` block in context:
7
9
8
10
```yaml
9
11
channel:
@@ -12,8 +14,16 @@ channel:
12
14
description: "A feed of the latest news from Example.com"
| `language` | Optional | The language of the feed. Defaults to the `lang` attribute of the `<html>` tag. |
29
39
| `time_zone` | Optional | The time zone for parsing dates. See the [list of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). |
30
40
41
+
## Notes
42
+
43
+
- `language`is runtime-validated. Use a valid language code such as `en`, not an arbitrary string.
44
+
- `author`should follow the RSS-style `email (Name)` format when you set it explicitly.
45
+
- `time_zone`must be a known TZ database identifier such as `UTC` or `Europe/Berlin`.
46
+
31
47
---
32
48
33
49
For detailed documentation on the Ruby API, see the [official YARD documentation](https://www.rubydoc.info/gems/html2rss).
0 commit comments