Skip to content

Consolidate docs: one Sphinx project, language subdirectories (Eng/, Zh-TW/, Zh-CN/, API/)#77

Merged
JE-Chen merged 1 commit intomainfrom
dev
Apr 28, 2026
Merged

Consolidate docs: one Sphinx project, language subdirectories (Eng/, Zh-TW/, Zh-CN/, API/)#77
JE-Chen merged 1 commit intomainfrom
dev

Conversation

@JE-Chen
Copy link
Copy Markdown
Member

@JE-Chen JE-Chen commented Apr 28, 2026

Summary

Cross-language navigation never worked on the public site because only the English source was deployed by RTD; the manual switcher links to ../html-zh-TW/ were 404s. Adopt WebRunner's docs layout instead: one Sphinx project with language subdirectories. All three languages now build into a single deployment, and cross-language navigation goes through normal Sphinx toctrees inside the same project.

New tree

docs/source/
  conf.py · index.rst                      ← slim hero + 4 toctrees
  Eng/{eng_index.rst, architecture.rst, usage/*.rst}
  Zh-TW/{zh_tw_index.rst, architecture.rst, usage/*.rst}
  Zh-CN/{zh_cn_index.rst, architecture.rst, usage/*.rst}
  API/{api_index.rst, *.rst}               ← language-neutral autodoc

What changed

  • Top-level docs/source/index.rst — slim WebRunner-style hero (title, tagline, PyPI / GitHub / License bullets, organisation paragraph) followed by four toctrees: English manual, 繁體中文手冊, 简体中文手册, API reference. Each toctree points at one chapter sub-index.
  • Four chapter sub-indexesEng/eng_index.rst, Zh-TW/zh_tw_index.rst, Zh-CN/zh_cn_index.rst, API/api_index.rst. Each has a .. contents:: directive plus chapter sections, each section toctree'ing to one chapter doc.
  • All chapter docs moved under their language subdirectory; architecture.rst is now per-language under each subdir.
  • Single API tree under API/ — translated API titles dropped, since the autodoc-generated content was identical across languages and was producing 28 duplicate object description warnings.
  • Dropped docs/source.zh-TW/, docs/source.zh-CN/, .readthedocs.zh-TW.yaml, .readthedocs.zh-CN.yaml, the per-language conf.py files, the per-language index.rst files, and the html-zh-TW / html-zh-CN / html-all targets in make.bat / Makefile.
  • Cleaned docs/source/conf.py — removed html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") (single-project setup; canonical URL handling is no longer per-language).

Commits in this PR

  • 1e2c700 Consolidate docs into one Sphinx project with language subdirectories

Test plan

  • Build clean: rm -rf docs/_build && py -m sphinx -b html docs/source docs/_build/htmlbuild succeeded with no new toctree / autodoc-duplicate warnings (only the 8 pre-existing CJK punctuation warnings inside chapter docs remain).
  • Confirm sidebar shows four captions: English manual, 繁體中文手冊, 简体中文手册, API reference.
  • Click each language section in the rendered index.html: confirm it lands on the corresponding sub-index, and every chapter link opens a real page.
  • After RTD rebuilds the merged main: confirm https://fileautomation.readthedocs.io/en/latest/ shows all four sections, with /Eng/..., /Zh-TW/..., /Zh-CN/..., /API/... all reachable.

Adopt WebRunner's docs layout: a single Sphinx project under
docs/source/ with per-language subdirectories (Eng/, Zh-TW/, Zh-CN/)
and a language-neutral API/ tree. The top-level index.rst is a slim
hero with four toctrees pointing at chapter sub-indexes
(eng_index, zh_tw_index, zh_cn_index, api_index); each sub-index
has chapter sections that toctree to the chapter docs.

Cross-language navigation now works through normal Sphinx toctrees
inside the same build — relative ../html-zh-TW/ links and per-
language RTD projects are no longer needed. Drop the per-language
.readthedocs.zh-*.yaml files, drop the source.zh-TW/ and
source.zh-CN/ source trees, drop the per-language conf.py + index,
and simplify make.bat / Makefile to a single html target.

Single API tree built once from English autodoc avoids the
duplicate object descriptions warnings the three-tree layout
produced.
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sonarqubecloud
Copy link
Copy Markdown

@JE-Chen JE-Chen merged commit cf262cd into main Apr 28, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant