Skip to content

Commit 6ccc428

Browse files
committed
docs: migrate code blocks to Starlight Code and fix YAML indentation
1 parent 3c96302 commit 6ccc428

35 files changed

Lines changed: 1124 additions & 839 deletions

AGENTS.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Repository Guidelines
2+
3+
## Scope and Ownership
4+
5+
This repository (`html2rss.github.io/`) is the public docs and feed-directory site built with Astro/Starlight.
6+
Classify most work here as `docs`.
7+
8+
What this repo owns:
9+
10+
- docs content and navigation under `src/content/docs/`
11+
- docs-specific components and styling under `src/components/`
12+
- feed-directory presentation and client behavior
13+
- generated docs data consumed by the site (`src/data/configs.json`)
14+
15+
What this repo does not own:
16+
17+
- runtime extractor behavior and CLI semantics (`html2rss/`)
18+
- web API behavior and OpenAPI generation (`html2rss-web/`)
19+
- feed YAML catalog definitions (`html2rss-configs/`)
20+
21+
When docs describe behavior from other repos, treat those repos as source-of-truth and update docs to match them.
22+
23+
## Cross-Repo Contracts
24+
25+
Before substantial edits, state cross-repo context in your notes:
26+
27+
- Source-of-truth repo
28+
- Downstream consumer repo(s)
29+
- Whether this change needs coordinated follow-up outside `html2rss.github.io/`
30+
31+
Common contracts:
32+
33+
- Feed directory data comes from `html2rss-configs` via `bin/data-update`.
34+
- Ruby gem docs should match `html2rss` behavior and CLI output.
35+
- Web application docs should match `html2rss-web` behavior and published OpenAPI.
36+
37+
If a cross-repo behavior changed but upstream is not updated yet, document the gap clearly instead of inventing new behavior.
38+
39+
## Generated Artifacts
40+
41+
Treat `src/data/configs.json` as generated.
42+
43+
- Do not hand-edit it.
44+
- Regenerate with repo-native commands:
45+
- `make update`
46+
- or `bin/data-update` (after dependencies are installed)
47+
- `bin/data-update` reads packaged configs (from `html2rss-configs`) and writes `src/data/configs.json`.
48+
49+
If a change only affects generated data, include the source change rationale in the PR description.
50+
51+
## Build, Test, and Dev Commands
52+
53+
Run commands from `html2rss.github.io/`:
54+
55+
- `make setup` installs dependencies and refreshes generated data
56+
- `make dev` runs Astro locally
57+
- `make build` builds production output
58+
- `make lint` checks formatting
59+
- `make lintfix` applies formatting fixes
60+
- `make update` refreshes feed-directory data from packaged configs
61+
62+
Preferred verification flow for docs/content changes:
63+
64+
1. Run targeted check(s) first (`make lint` or `make build`).
65+
2. Run the broader check set before PR (`make lint` and `make build`).
66+
3. If feed directory or config references changed, run `make update` and verify resulting diffs.
67+
68+
## Docs Authoring Rules
69+
70+
### Code Snippets
71+
72+
In docs content (`src/content/docs/**`) and docs-supporting components:
73+
74+
- Do not use triple-backtick fenced code blocks.
75+
- Always render snippets with the `<Code>` component.
76+
- Use this import:
77+
`import { Code } from '@astrojs/starlight/components';`
78+
- Do not use:
79+
`import Code from "astro/components/Code.astro";`
80+
81+
### Accuracy Rules
82+
83+
- Prefer concrete, verifiable statements over aspirational wording.
84+
- Keep repo and path references explicit when guidance is cross-repo.
85+
- When referencing commands that belong to another repo, include that repo directory in the command example.
86+
87+
## Commit and PR Expectations
88+
89+
- Keep each commit scoped to one logical docs change.
90+
- Do not mix unrelated changes or unrelated generated diffs.
91+
- In PRs, call out:
92+
- cross-repo assumptions
93+
- generated files updated
94+
- verification commands run

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,24 @@ website.
1313
### Quick Setup
1414

1515
```bash
16-
# Install dependencies and start development server
16+
# Install dependencies and refresh generated feed data
1717
make setup
18+
19+
# Start the local Astro development server
20+
make dev
1821
```
1922

2023
### 💻 Try in Browser
2124

2225
You can develop html2rss directly in your browser using GitHub Codespaces:
2326

24-
[Open in GitHub Codespaces](https://github.com/codespaces/new?repo=html2rss/html2rss)
27+
[Open in GitHub Codespaces](https://github.com/codespaces/new?repo=html2rss/html2rss.github.io)
2528

2629
The Codespace provides a cloud development environment with Node.js and Ruby pre-installed. Run `make setup` to install dependencies and get started!
2730

2831
### Available Commands
2932

30-
- `make setup` - Install dependencies and start dev server
33+
- `make setup` - Install dependencies and refresh generated feed data
3134
- `make dev` - Start Astro development server
3235
- `make build` - Build for production
3336
- `make preview` - Preview production build

src/components/docs/DockerComposeSnippet.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import Code from "astro/components/Code.astro";
2+
import { Code } from "@astrojs/starlight/components";
33
import { browserlessImage, caddyImage, watchtowerImage, webImage } from "../../data/docker";
44
55
interface Props {

src/content/docs/creating-custom-feeds.mdx

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ sidebar:
55
order: 2
66
---
77

8-
import { Aside } from "@astrojs/starlight/components";
9-
import Code from "astro/components/Code.astro";
8+
import { Aside, Code } from "@astrojs/starlight/components";
109

1110
When auto-sourcing isn't enough, you can write your own configuration files to create custom RSS feeds for any website. This guide shows you how to take full control with YAML configs.
1211

@@ -70,11 +69,14 @@ This tells html2rss basic information about your feed - like giving it a name an
7069

7170
**Example:**
7271

73-
```yaml
74-
channel:
75-
url: https://example.com/blog
76-
title: My Awesome Blog
77-
```
72+
<Code
73+
code={`
74+
channel:
75+
url: https://example.com/blog
76+
title: My Awesome Blog
77+
`}
78+
lang="yaml"
79+
/>
7880

7981
This says: "Look at this website and call the feed 'My Awesome Blog'"
8082

@@ -84,16 +86,19 @@ This is where you tell the html2rss engine exactly what to find on the page. You
8486

8587
**Example:**
8688

87-
```yaml
88-
selectors:
89-
items:
90-
selector: "article.post"
91-
title:
92-
selector: "h2 a"
93-
link:
94-
selector: "h2 a"
95-
attribute: href
96-
```
89+
<Code
90+
code={`
91+
selectors:
92+
items:
93+
selector: "article.post"
94+
title:
95+
selector: "h2 a"
96+
link:
97+
selector: "h2 a"
98+
attribute: href
99+
`}
100+
lang="yaml"
101+
/>
97102

98103
This says: "Find each article, get the title from the h2 anchor, and get the link from the same h2 anchor's href attribute"
99104

@@ -107,20 +112,23 @@ This says: "Find each article, get the title from the h2 anchor, and get the lin
107112

108113
**Step 2:** Create a file called `example.com.yml` with this basic structure:
109114

110-
```yaml
111-
channel:
112-
url: https://example.com/blog
113-
title: My Blog
114-
115-
selectors:
116-
items:
117-
selector: "article.post"
118-
title:
119-
selector: "h2 a"
120-
link:
121-
selector: "h2 a"
122-
attribute: href
123-
```
115+
<Code
116+
code={
117+
"channel:\n" +
118+
" url: https://example.com/blog\n" +
119+
" title: My Blog\n" +
120+
"\n" +
121+
"selectors:\n" +
122+
" items:\n" +
123+
' selector: "article.post"\n' +
124+
" title:\n" +
125+
' selector: "h2 a"\n' +
126+
" link:\n" +
127+
' selector: "h2 a"\n' +
128+
" attribute: href"
129+
}
130+
lang="yaml"
131+
/>
124132

125133
**Step 3:** Test it with your html2rss-web instance or the [Ruby gem](/ruby-gem/installation).
126134

@@ -147,15 +155,11 @@ html2rss supports many configuration options:
147155

148156
1. **Validate the config first:**
149157

150-
```bash
151-
html2rss validate your-config.yml
152-
```
158+
<Code code={`html2rss validate your-config.yml`} lang="bash" />
153159

154160
2. **Then render the feed with the Ruby gem:**
155161

156-
```bash
157-
html2rss feed your-config.yml
158-
```
162+
<Code code={`html2rss feed your-config.yml`} lang="bash" />
159163

160164
3. **Test with `html2rss-web`:** Add your config to the `feeds.yml` file and restart your instance
161165

@@ -169,9 +173,11 @@ Some sites need a little more request budget than the defaults.
169173
- Use `--max-requests` when your config needs more than one request, for example pagination or other follow-up fetches.
170174

171175
<Code
172-
code={`html2rss feed your-config.yml --max-redirects 10
173-
html2rss feed your-config.yml --max-requests 5
174-
html2rss auto https://example.com/blog --max-redirects 10 --max-requests 5`}
176+
code={`
177+
html2rss feed your-config.yml --max-redirects 10 && \
178+
html2rss feed your-config.yml --max-requests 5 && \
179+
html2rss auto https://example.com/blog --max-redirects 10 --max-requests 5
180+
`}
175181
lang="bash"
176182
/>
177183

src/content/docs/get-involved/contributing.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: Contributing
33
description: Learn how to contribute to the html2rss project
44
---
55

6+
import { Code } from "@astrojs/starlight/components";
7+
68
We're thrilled that you're interested in contributing to `html2rss`! There are many ways to get involved, and we welcome contributions of all kinds.
79

810
---
@@ -31,9 +33,7 @@ Are you missing an RSS feed for a website? You can create your own feed config a
3133

3234
**Want to test your config first?** Use the [Ruby gem](/ruby-gem/installation) to test it locally:
3335

34-
```bash
35-
html2rss feed your-config.yml
36-
```
36+
<Code code={`html2rss feed your-config.yml`} lang="bash" />
3737

3838
### 2. Host a Public Instance
3939

src/content/docs/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 1
66
---
77

8-
import Code from "astro/components/Code.astro";
8+
import { Code } from "@astrojs/starlight/components";
99

1010
This page points to the main onboarding flow.
1111

0 commit comments

Comments
 (0)