evert/phpdoc-md
Generates Markdown documentation from PHP source using phpDocumentor-style docblocks. Turn packages and libraries into clean README/API docs with configurable templates and output paths—handy for publishing reference docs to GitHub, wikis, or static sites.
Use Case Alignment: The evert/phpdoc-md package is a PHPDocumentor-to-Markdown converter, ideal for teams using Laravel/PHP where documentation is generated via PHPDoc annotations (e.g., @param, @return, @throws). It bridges the gap between code-level documentation and consumable Markdown (e.g., for GitHub READMEs, wiki pages, or internal knowledge bases).
Integration Points:
artisan, composer scripts) or CI/CD pipelines (GitHub Actions, GitLab CI) for automated doc generation.Low-Coupling Design: The package is a standalone CLI tool (phpdoc-md) and PHP library, requiring minimal Laravel-specific changes.
phpdocumentor/phpdocumentor (already common in PHP ecosystems).composer install) or pre-commit (via Git hooks).Key Integration Paths:
vendor/bin/phpdoc-md generate src --output docs/api.md
composer post-install or a custom artisan command.use Evert\PhpdocMd\Generator;
$generator = new Generator();
$markdown = $generator->generateFromFiles(['src/']);
file_put_contents('docs/api.md', $markdown);
.github/workflows/docs.yml to auto-generate docs on main branch pushes.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| PHPDoc Inconsistency | Medium | Enforce PHPDoc standards via PSR-5 or custom linting (e.g., phpstan). |
| Markdown Output Quality | Low | Preview generated Markdown in PRs or use templates for consistent formatting. |
| Build Tool Conflicts | Low | Isolate to a dedicated docs/ directory to avoid polluting Laravel’s autoloader. |
| Version Compatibility | Medium | Pin phpdocumentor/phpdocumentor version in composer.json to avoid breaking changes. |
.md files) or supplement them?Laravel Compatibility:
php artisan docs:generate).Ecosystem Synergies:
README.md or API.md files in the repo.Assessment Phase:
phpdoc CLI).Pilot Integration:
app/Services/).Full Rollout:
composer.json:
"require-dev": {
"evert/phpdoc-md": "^1.0"
}
// app/Console/Commands/GenerateDocs.php
public function handle() {
$generator = new \Evert\PhpdocMd\Generator();
$markdown = $generator->generateFromFiles([app_path('Services')]);
file_put_contents(public_path('docs/services.md'), $markdown);
}
- name: Generate Docs
run: vendor/bin/phpdoc-md generate app --output docs/
Post-Migration:
.md files where PHPDoc-generated content is sufficient.phpdocumentor/phpdocumentor (v3+). Laravel projects typically already include this.Phase 1 (Week 1):
Phase 2 (Week 2):
Phase 3 (Ongoing):
PHPDoc Upkeep:
roave/security-advisories or phpstan to lint for missing docs.Package Maintenance:
evert/phpdoc-md is MIT-licensed and actively maintained (169 stars, recent commits).phpdocumentor/phpdocumentor.Troubleshooting:
vendor/bin/phpdoc-md --verbose for detailed logs.phpdocumentor config (phpdoc.md.dist.xml) for filters.Team Onboarding:
@method, @property).CONTRIBUTING.md section on doc standards.php-parallel-lint).How can I help you explore Laravel packages today?