This repository provides a Markdown theme for phpDocumentor that generates API documentation in Markdown format. It also creates a navigation.yaml
file, making it easy to integrate the generated documentation into MkDocs and then into Backstage or other documentation platforms.
- Markdown-based Output: Generates API documentation as Markdown files.
navigation.yaml
Generation: Automatically creates anavigation.yaml
file for use with MkDocs.- Backstage-Friendly: The Markdown structure and navigation file integrate seamlessly with Backstage.
- phpDocumentor (Nightly/Unstable Release):
Note: This theme relies on extension functionality that is currently only available in the nightly (unstable) release of phpDocumentor. Installation guide
- Theme Extension: phpdoc-backstage-markdown-extension
-
Clone or download this repository to a location accessible by your project.
-
Copy the
phpdoc-backstage-markdown-theme
folder to your project's.phpdoc/themes
directory (or another location of your choosing). -
Copy the
phpdoc-backstage-markdown-extension
folder to your project's.phpdoc/extensions
directory. -
Generate the documentation using Docker:
docker run --rm \ -v "$(pwd):/data" \ phpdoc/phpdoc:3-unstable \ --template=".phpdoc/themes/phpdoc-backstage-markdown-theme" #This command mounts your current working directory into the Docker container and tells phpDocumentor to use the phpdoc-backstage-markdown-theme.
-
Known Issue: Some generated files may have the
.html
extension instead of.md
. To fix this, run the following command (replacingdocs-dir
with your actual output folder):find docs-dir -type f -name "*.html" -exec bash -c 'mv "$0" "${0%.html}.md"' {} \;