bear/api-doc
Composer 安装命令:
composer require bear/api-doc
包简介
README 文档
README
Your application is the documentation.
- ApiDoc HTML: Developer documentation
- OpenAPI 3.1: Tool chain integration
- JSON Schema: Information model
- ALPS: Vocabulary semantics for AI understanding
- llms.txt: AI-readable application overview
Semantic Depth
The same document reveals different insights depending on your perspective:
| Depth | What You See |
|---|---|
| Surface | Remote function list (API reference) |
| Middle | Resources and operations (REST design) |
| Deep | Application semantics (ALPS three layers) |
A developer sees endpoints to call. An architect sees state transitions. An AI extracts Ontology, Taxonomy, and Choreography. One document, multiple layers of understanding.
This is a semantic application document, not just an API reference. It describes what the application is, not just how to call it.
Demo
Installation
composer require bear/api-doc ^1.0
Quick Start
Generate configuration file:
./vendor/bin/apidoc init
This creates apidoc.xml from your composer.json.
Generate documentation:
./vendor/bin/apidoc
This writes the API documentation and its term usage index for human-readable formats, for example index.html and terms.html.
Generate the documentation quality report:
./vendor/bin/apidoc audit
Each finding in the HTML audit carries a machine-readable findingType, so the report is a worklist, not just a list to read: the bear-audit-fix skill reads audit.html and closes the gaps it reports (PHPDoc summaries, JSON Schema, #[Alps]).
Usage
See the API doc documentation.
GitHub Actions
You can use the reusable workflow to generate and publish API documentation automatically.
name: API Docs on: push: branches: [main] jobs: docs: uses: bearsunday/BEAR.ApiDoc/.github/workflows/apidoc.yml@v1 with: format: 'html,openapi,alps,audit,llms' alps-profile: 'alps.json'
Inputs
| Input | Default | Description |
|---|---|---|
php-version |
'8.2' |
PHP version |
format |
'html,openapi,llms' |
Comma-separated: html (apidoc), md, openapi, alps, llms, audit |
alps-profile |
'' |
ALPS profile path (required for alps format) |
docs-path |
'docs/api' |
Output directory |
publish-to |
'github-pages' |
github-pages or artifact-only |
Output Structure
docs/
├── index.html # API documentation
├── terms.html # Term usage index for HTML docs
├── audit.html # Documentation coverage report (HTML, ALPS-profiled)
├── audit.md # Documentation coverage report (Markdown, for CLI/tooling)
├── llms.txt # AI-readable overview
├── openapi.json # OpenAPI spec
├── alps/ # ALPS report profiles (terms.xml, audit.xml)
└── schemas/
└── *.json # JSON Schema
Development
git clone https://github.com/bearsunday/BEAR.ApiDoc.git cd BEAR.ApiDoc composer install composer docs # Generate docs with external CSS composer docs-dev # Generate docs with inline CSS for development composer docs-md # Generate Markdown docs composer docs-openapi # Generate OpenAPI spec composer docs-audit # Generate documentation audit report composer docs-terms # Generate legacy Markdown term usage index
Application as Documentation.
bear/api-doc 适用场景与选型建议
bear/api-doc 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 297.96k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bear/api-doc 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bear/api-doc 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 297.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 17
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-17