Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- 'README.md'
- 'CHANGELOG.md'
- 'zensical.toml'
- 'zensical.zh-TW.toml'
- 'i18n/**'
- 'pyproject.toml'
- 'uv.lock'
- '.github/workflows/docs.yml'
Expand All @@ -20,6 +22,8 @@ on:
- 'README.md'
- 'CHANGELOG.md'
- 'zensical.toml'
- 'zensical.zh-TW.toml'
- 'i18n/**'
- 'pyproject.toml'
- 'uv.lock'
- '.github/workflows/docs.yml'
Expand All @@ -46,3 +50,6 @@ jobs:

- name: Build (strict)
run: uv run --no-sync zensical build --strict

- name: Build Traditional Chinese translation (strict)
run: uv run --no-sync zensical build --strict -f zensical.zh-TW.toml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ venv.bak/

# mkdocs documentation
/site
/site-zh-TW

# mypy
.mypy_cache/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![PyPI version](https://img.shields.io/pypi/v/fastapi-cachex.svg?logo=pypi&logoColor=gold&label=PyPI)](https://pypi.org/project/fastapi-cachex)
[![Python Versions](https://img.shields.io/pypi/pyversions/fastapi-cachex.svg?logo=python&label=Python&logoColor=gold)](https://pypi.org/project/fastapi-cachex/)

[English](https://github.com/allen0099/FastAPI-CacheX/blob/master/README.md) | [繁體中文](https://github.com/allen0099/FastAPI-CacheX/blob/master/docs/README.zh-TW.md)
[English](https://github.com/allen0099/FastAPI-CacheX/blob/master/README.md) | [繁體中文](https://github.com/allen0099/FastAPI-CacheX/blob/master/i18n/zh-TW/docs/index.md)

A high-performance caching extension for FastAPI: a server-side response cache with `Cache-Control` and `ETag` support, application-level caching, and optional session management.

Expand Down
4 changes: 3 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ Please refer to our [Development Guide](DEVELOPMENT.md) for detailed instruction

## Pull Request Process

1. Update the matching guide under `docs/` (and the README if the change belongs on the front page) when you change the interface
1. Update the matching guide under `docs/` (and the README if the change belongs on the front page) when you change the interface. Only the English
pages need updating: the [Traditional Chinese translation](DEVELOPMENT.md#traditional-chinese-translation)
is allowed to lag behind them
2. Add an entry to the `## [Unreleased]` section of
[CHANGELOG.md](https://github.com/allen0099/FastAPI-CacheX/blob/master/CHANGELOG.md) if your change alters behaviour, adds public
API, or fixes something a user could have hit. That section is what the
Expand Down
19 changes: 19 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,25 @@ The **Docs** workflow (`.github/workflows/docs.yml`) and Read the Docs
(`.readthedocs.yaml`) both run `zensical build --strict`, so a broken link,
snippet path or docstring reference fails the PR.

### Traditional Chinese translation

A Traditional Chinese (`zh-TW`) translation is published at
<https://fastapi-cachex.readthedocs.io/zh-tw/latest/>. It is a separate Read the
Docs translation project built from `zensical.zh-TW.toml` (build settings in
`i18n/zh-TW/.readthedocs.yaml`), and its pages live in `i18n/zh-TW/docs/` — not
under `docs/`, which would pull them into the English site.

```bash
uv run zensical serve -f zensical.zh-TW.toml
uv run zensical build --strict -f zensical.zh-TW.toml # also run by the Docs workflow
```

The English pages are the source of truth. The translation may lag behind
them, and every translated page carries a banner saying so, with a link to the
English original. Pages that are not translated yet are linked from the
translation's navigation to the English site. When translating, follow the
terms in [`i18n/zh-TW/GLOSSARY.md`](https://github.com/allen0099/FastAPI-CacheX/blob/master/i18n/zh-TW/GLOSSARY.md).

### Adding API reference pages

API pages live under `docs/api/` and are generated from docstrings (Google
Expand Down
279 changes: 0 additions & 279 deletions docs/README.zh-TW.md

This file was deleted.

20 changes: 20 additions & 0 deletions i18n/zh-TW/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Read the Docs build of the Traditional Chinese translation:
# https://fastapi-cachex.readthedocs.io/zh-tw/latest/
# Same as the root .readthedocs.yaml, but built from zensical.zh-TW.toml. The
# translation project points its "Build configuration file" setting here.
version: 2

build:
os: ubuntu-24.04
tools:
python: "3.14"
jobs:
install:
- pip install uv
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --frozen --only-group docs --no-install-project
build:
html:
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv run --no-sync zensical build --strict -f zensical.zh-TW.toml
post_build:
- mkdir -p $READTHEDOCS_OUTPUT/html/
- cp -r site-zh-TW/* $READTHEDOCS_OUTPUT/html/
Loading
Loading