Skip to content

Commit 987c74c

Browse files
TaiSakumaclaude
andauthored
docs: rewrite README and add MIT license (#24)
## Summary - Rewrite README with badges, demo site link, and concise feature descriptions - Split Features into Content and Deployment sections - Add GitHub Pages structure diagram and workflow table with links - Add MIT license 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 364fd1b commit 987c74c

File tree

2 files changed

+74
-35
lines changed

2 files changed

+74
-35
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Tai Sakuma
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 53 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,76 @@
11
# improved-octo-fortnight
22

3-
A reference implementation of a documentation workflow using [zensical](https://zensical.org/) and GitHub Pages.
3+
[![GitHub Release][release-badge]][release-url]
4+
[![GitHub Pages][pages-badge]][pages-url]
45

5-
- [latest](https://taisakuma.github.io/improved-octo-fortnight/latest/)
6-
- [dev](https://taisakuma.github.io/improved-octo-fortnight/dev/)
6+
[![Deploy dev docs][dev-badge]][dev-url]
7+
[![Deploy release docs][release-docs-badge]][release-docs-url]
8+
[![Deploy docs preview][preview-badge]][preview-url]
9+
10+
[release-badge]: https://img.shields.io/github/v/release/TaiSakuma/improved-octo-fortnight
11+
[release-url]: https://github.com/TaiSakuma/improved-octo-fortnight/releases/latest
12+
[pages-badge]: https://img.shields.io/website?url=https://taisakuma.github.io/improved-octo-fortnight/
13+
[pages-url]: https://taisakuma.github.io/improved-octo-fortnight/
14+
[dev-badge]: https://github.com/TaiSakuma/improved-octo-fortnight/actions/workflows/docs-dev.yml/badge.svg
15+
[dev-url]: https://github.com/TaiSakuma/improved-octo-fortnight/actions/workflows/docs-dev.yml
16+
[release-docs-badge]: https://github.com/TaiSakuma/improved-octo-fortnight/actions/workflows/docs-release.yml/badge.svg
17+
[release-docs-url]: https://github.com/TaiSakuma/improved-octo-fortnight/actions/workflows/docs-release.yml
18+
[preview-badge]: https://github.com/TaiSakuma/improved-octo-fortnight/actions/workflows/docs-pr-preview.yml/badge.svg
19+
[preview-url]: https://github.com/TaiSakuma/improved-octo-fortnight/actions/workflows/docs-pr-preview.yml
20+
21+
A reference implementation of documentation workflows.
22+
23+
📚 [Demo site](https://taisakuma.github.io/improved-octo-fortnight/)
724

825
## Features
926

10-
- **Versioned docs** -- Release docs at `/<version>/`, dev docs at `/dev/`, and a `/latest/` alias
11-
- **PR previews** -- Every PR gets a preview deployment at `/pr/<number>/` with an automatic comment linking to it
12-
- **PR cleanup** -- Preview deployments are removed when PRs are closed
13-
- **Version index** -- An auto-generated root `index.html` lists all available versions
14-
- **Deploy verification** -- The preview URL is polled before posting the PR comment; a note is added if the site isn't ready yet
15-
- **Custom domain support** -- Works with both default GitHub Pages URLs and custom domains
16-
- **API reference** -- Auto-generated from Python docstrings using [mkdocstrings](https://mkdocstrings.github.io/). Add `:::` directives in Markdown to render any module (see `docs/api.md` for an example)
27+
### Content
1728

18-
## How it works
29+
- Built with [zensical](https://zensical.org/)
30+
- API reference auto-generated using [mkdocstrings](https://mkdocstrings.github.io/)
1931

20-
Documentation is built with [zensical](https://zensical.org/) and deployed by pushing subdirectories to a `gh-pages` branch. Four workflows handle the different deployment scenarios:
32+
This repo documents a Python package. The setup should work for other languages with minor modifications.
2133

22-
| Workflow | Trigger | Deploys to |
23-
| --------------------- | -------------------------------- | ----------------------------------------- |
24-
| `docs-dev.yml` | Push to `main` | `/dev/` |
25-
| `docs-release.yml` | Release (via changelog workflow) | `/<version>/` + `/latest/` + `index.html` |
26-
| `docs-pr-preview.yml` | PR opened/updated (incl. forks) | `/pr/<number>/` |
27-
| `docs-pr-cleanup.yml` | PR closed | removes `/pr/<number>/` |
34+
### Deployment
2835

29-
The `gh-pages` branch has the following structure:
36+
- Deployed to [GitHub Pages](https://pages.github.com/) via [GitHub
37+
Actions](https://github.com/features/actions)
38+
- Separate docs for each release and development branch
39+
- Docs preview for each PR
3040

31-
```
32-
gh-pages
33-
├── .nojekyll
41+
## GitHub Pages structure
42+
43+
The deployed site is structured as follows:
44+
45+
```text
46+
/
3447
├── index.html # auto-generated version index
3548
├── latest/ # copy of the latest release
3649
├── dev/ # built from main
37-
├── 0.2.1/ # release versions
38-
├── 0.2.0/
50+
├── 2.0.0/ # release versions
51+
├── 1.1.0/
52+
├── 1.0.0/
3953
└── pr/
4054
├── 14/ # PR preview
4155
└── 13/
4256
```
4357

44-
Shared logic is extracted into two composite actions:
58+
## GitHub Actions workflows
59+
60+
These workflows build, deploy, and clean up the documentation:
4561

46-
- **`.github/actions/build-docs`** -- Overrides `site_url` for the target subdirectory, builds the site, and stages the output
47-
- **`.github/actions/deploy-to-gh-pages`** -- Checks out (or creates) the `gh-pages` branch and pushes the built site to a target subdirectory
62+
| Workflow | Trigger | Deploys to |
63+
| ----------------------- | ----------------- | --------------------------------------- |
64+
| [`docs-dev.yml`] | Push to `main` | `/dev/`, `index.html` |
65+
| [`docs-release.yml`] | Release | `/<version>/`, `/latest/`, `index.html` |
66+
| [`docs-pr-preview.yml`] | PR opened/updated | `/pr/<number>/` |
67+
| [`docs-pr-cleanup.yml`] | PR closed | removes `/pr/<number>/` |
4868

49-
A Python script (`.github/actions/build-docs/override_site_url.py`) uses [tomlkit](https://github.com/sdispater/tomlkit) to modify `site_url` in `zensical.toml` so that navigation and search work correctly in each subdirectory.
69+
[`docs-dev.yml`]: .github/workflows/docs-dev.yml
70+
[`docs-release.yml`]: .github/workflows/docs-release.yml
71+
[`docs-pr-preview.yml`]: .github/workflows/docs-pr-preview.yml
72+
[`docs-pr-cleanup.yml`]: .github/workflows/docs-pr-cleanup.yml
5073

51-
## Setup
74+
The workflows require the GitHub settings
5275

53-
1. Install [uv](https://docs.astral.sh/uv/)
54-
2. Build docs locally:
55-
```
56-
uv run --group docs zensical serve
57-
```
58-
3. Set GitHub Pages source to **Deploy from a branch** > `gh-pages` (root `/`)
76+
- `Settings` > `Pages` > `Source` > `Deploy from a branch` > `gh-pages` (root `/`)

0 commit comments

Comments
 (0)