Skip to content

Commit 2b48f35

Browse files
committed
docs: improve readme.io build
1 parent 30d87d4 commit 2b48f35

File tree

3 files changed

+73
-6
lines changed

3 files changed

+73
-6
lines changed

.cursor/rules/docs.mdc

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
description: Guidelines for editing documentation files. Apply when creating or modifying docs, README, or documentation content.
3+
globs:
4+
- README.md
5+
- docs/**
6+
alwaysApply: false
7+
---
8+
9+
# Documentation Guidelines
10+
11+
## Editable Files
12+
13+
Only edit documentation in these locations:
14+
15+
| Location | Purpose |
16+
|----------|---------|
17+
| `README.md` | Project overview and quickstart |
18+
| `docs/sphinx/*.md` | Detailed documentation source files |
19+
20+
## Never Edit Directly
21+
22+
**Never edit `docs/*.md` files directly.** These are auto-generated from Sphinx source files and will be overwritten.
23+
24+
## Building Docs
25+
26+
After editing any files in `docs/sphinx/`, rebuild the documentation:
27+
28+
```bash
29+
make -C docs docs
30+
```
31+
32+
This generates:
33+
- `docs/*.md` - Markdown output for GitHub viewing
34+
- `docs/sphinx/_build/html/` - HTML documentation
35+
36+
## README Guidelines
37+
38+
The README should be:
39+
40+
- **Concise**: Brief project overview, not exhaustive documentation
41+
- **Quickstart focused**: Get users running in minutes
42+
- **A gateway**: Link to detailed docs in `docs/` for deeper topics
43+
44+
### README Structure
45+
46+
1. Project title and badges
47+
2. One-paragraph description
48+
3. Quick installation
49+
4. Basic usage example
50+
5. Links to detailed documentation in `docs/`
51+
52+
### Linking to Detailed Docs
53+
54+
For topics that need more detail, link to the full docs:
55+
56+
```markdown
57+
For more details, see the [Installation Guide](docs/installation.md).
58+
59+
See the [CLI Reference](docs/cli-reference.md) for all available commands.
60+
```
61+
62+
## Sphinx Source Files
63+
64+
When editing `docs/sphinx/*.md`:
65+
66+
- Follow existing formatting conventions
67+
- Use proper Sphinx/MyST markdown syntax
68+
- Include cross-references where appropriate
69+
- Always rebuild with `make -C docs docs` after changes

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ node_modules/
1212

1313
# Documentation build output
1414
docs/sphinx/_build/
15-
docs/readme.io/

docs/Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
SPHINXOPTS ?=
44
SPHINXBUILD ?= uv run sphinx-build
5-
SPHINXDIR = sphinx
5+
GIT_ROOT = $(shell git rev-parse --show-toplevel)
6+
SPHINXDIR = $(GIT_ROOT)/docs/sphinx
67
BUILDDIR = $(SPHINXDIR)/_build
7-
READMEIODIR = readme.io
88

99
.PHONY: help clean html markdown readme-io docs
1010

@@ -20,7 +20,6 @@ help:
2020
# Clean build directory
2121
clean:
2222
rm -rf $(BUILDDIR)
23-
rm -rf $(READMEIODIR)
2423
rm -f *.md
2524

2625
# Build HTML documentation
@@ -37,8 +36,8 @@ markdown:
3736

3837
# Generate readme.io documentation with YAML frontmatter
3938
readme-io: markdown
40-
@uv run python scripts/generate_readme_docs.py --source-dir . --output-dir $(READMEIODIR)
41-
@echo "readme.io docs generated in $(READMEIODIR)/"
39+
@uv run python scripts/generate_readme_docs.py --source-dir $(BUILDDIR)/markdown --output-dir $(BUILDDIR)/readme-io
40+
@echo "readme.io docs generated in $(BUILDDIR)/readme-io/"
4241

4342
# Build all documentation
4443
docs: markdown html readme-io

0 commit comments

Comments
 (0)