Skip to content

Add workflow and script to auto-generate API docs#208

Merged
1985312383 merged 5 commits intodatawhalechina:mainfrom
1985312383:main
Apr 1, 2026
Merged

Add workflow and script to auto-generate API docs#208
1985312383 merged 5 commits intodatawhalechina:mainfrom
1985312383:main

Conversation

@1985312383
Copy link
Copy Markdown
Collaborator

Pull Request / 拉取请求

What does this PR do? / 这个PR做了什么?

Add a GitHub Actions workflow (.github/workflows/api-docs.yml) that runs on pull requests to main when torch_rechub sources or the generator change. The workflow detects source changes, sets up Python, runs config/generate_api_md.py, and commits generated docs (docs/en/api/api.md and docs/zh/api/api.md) back to the PR branch.

Add config/generate_api_md.py: a script that walks torch_rechub Python files (excluding init.py), extracts functions/classes via the AST, formats signatures and docstrings (with parsing for common sections like Parameters, Returns, Shape, Examples), and emits localized markdown API reference files for English and Chinese.

Type of Change / 变更类型

  • 🐛 Bug fix / Bug修复
  • ✨ New model/feature / 新模型/功能
  • 📝 Documentation / 文档
  • 🔧 Maintenance / 维护

Related Issues / 相关Issues

Fixes #207

Add a GitHub Actions workflow (.github/workflows/api-docs.yml) that runs on pull requests to main when torch_rechub sources or the generator change. The workflow detects source changes, sets up Python, runs config/generate_api_md.py, and commits generated docs (docs/en/api/api.md and docs/zh/api/api.md) back to the PR branch.

Add config/generate_api_md.py: a script that walks torch_rechub Python files (excluding __init__.py), extracts functions/classes via the AST, formats signatures and docstrings (with parsing for common sections like Parameters, Returns, Shape, Examples), and emits localized markdown API reference files for English and Chinese.
@github-actions github-actions bot added documentation Improvements or additions to documentation | 文档更新 enhancement New feature or request | 新功能 ignore-for-release Exclude from release notes | 不计入发布说明 labels Apr 1, 2026
@1985312383 1985312383 marked this pull request as ready for review April 1, 2026 10:29
@1985312383 1985312383 removed the ignore-for-release Exclude from release notes | 不计入发布说明 label Apr 1, 2026
@1985312383 1985312383 merged commit b24992d into datawhalechina:main Apr 1, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation | 文档更新 enhancement New feature or request | 新功能

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Auto genenrate api docs

1 participant