PHPackages                             saggre/phpdocumentor-markdown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. saggre/phpdocumentor-markdown

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

saggre/phpdocumentor-markdown
=============================

Markdown template for phpDocumentor3

1.0.0(11mo ago)2297.7k↓21.9%9[3 issues](https://github.com/Saggre/phpDocumentor-markdown/issues)[1 PRs](https://github.com/Saggre/phpDocumentor-markdown/pulls)20MITTwigCI passing

Since Apr 15Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/Saggre/phpDocumentor-markdown)[ Packagist](https://packagist.org/packages/saggre/phpdocumentor-markdown)[ RSS](/packages/saggre-phpdocumentor-markdown/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (12)Used By (20)

phpDocumentor-markdown - Automatically generate Markdown documentation
======================================================================

[](#phpdocumentor-markdown---automatically-generate-markdown-documentation)

Use cases: In-repository documentation, GitHub/GitLab wikis, AI prompt context.

Markdown template for phpDocumentor3
------------------------------------

[](#markdown-template-for-phpdocumentor3)

[![Tests Status](https://github.com/Saggre/phpDocumentor-markdown/workflows/Run%20tests/badge.svg?style=flat-square)](https://github.com/Saggre/phpDocumentor-markdown/workflows/Run%20tests/badge.svg?style=flat-square)[![Generate Docs Status](https://github.com/Saggre/phpDocumentor-markdown/workflows/Generate%20docs/badge.svg?style=flat-square)](https://github.com/Saggre/phpDocumentor-markdown/workflows/Generate%20docs/badge.svg?style=flat-square)

Wish there was an easy way to generate PHP source code documentation?
Using [`phpDocumentor`](https://www.phpdoc.org/) with `phpDocumentor-markdown` template, you can automatically generate GitHub/GitLab-ready Markdown documentation from PHP source code.

This template can be used to document:

NameDescriptionsInheritanceImplementsConstantsPropertiesMethodsInherited methodsClasses✅✅✅✅✅✅✅✅Interfaces✅✅✅➖✅✅✅➖Traits✅✅➖➖✅✅✅➖NameDescriptionsTypes (parameter, return, etc.)Access modifiersFunctions✅✅✅✅Methods✅✅✅✅Properties✅✅✅✅Example
-------

[](#example)

Examples are available in the [.wiki](.wiki/Home.md) directory.

Installation &amp; Usage
------------------------

[](#installation--usage)

- Please refer to [this guide](https://docs.phpdoc.org/guide/getting-started/installing.html) for instructions on installing phpDocumentor.
- Usage instructions assume that `phpdoc` is the phpDocumentor binary.

### Running manually

[](#running-manually)

```
# Run phpDocumentor with --template argument pointed to this directory's markdown template
phpdoc --directory=src --target=docs --template=
```

### Using Composer

[](#using-composer)

#### Installation via Composer

[](#installation-via-composer)

```
# Require this package. You probably want it as a dev dependency
composer require --dev saggre/phpdocumentor-markdown
```

#### Running manually after installing via Composer

[](#running-manually-after-installing-via-composer)

```
# Run phpDocumentor with --template argument pointed to markdown template inside vendor directory
phpdoc --directory=src --target=docs --template="vendor/saggre/phpdocumentor-markdown/themes/markdown"
```

### Installation &amp; Usage tips

[](#installation--usage-tips)

#### Adding a Composer helper script

[](#adding-a-composer-helper-script)

Add this script to your `composer.json` and run `composer create-docs` to generate the documentation.

```
"scripts": {
    "create-docs": "phpdoc --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'"
},
```

#### Using with PhpDocumentor XML config

[](#using-with-phpdocumentor-xml-config)

Add a template element to your phpDocumentor XML config and run `phpDocumentor` to generate the documentation.

```

```

You can also check out the [config file](./phpdoc.dist.xml) used for generating this repository's example documentation for a full example.

#### GitLab wiki

[](#gitlab-wiki)

The output of this template can be used directly as a GitLab wiki.

#### GitHub wiki

[](#github-wiki)

⚠️ GitHub wiki [uses a flat directory structure](https://github.com/orgs/community/discussions/14020) for linking, so the internal links in the resulting documentation will not work as expected.

#### CI pipelines

[](#ci-pipelines)

You can use the [PhpDocumentor Docker image](https://hub.docker.com/r/phpdoc/phpdoc) with this template in your CI pipelines to generate documentation automatically.

#### AI integration

[](#ai-integration)

The generated documentation can be used as prompt context for AI models that work with source code. For other use cases you'll likely want structured data, like JSON.

Running tests
-------------

[](#running-tests)

```
# Clone the repository
git clone git@github.com:Saggre/phpDocumentor-markdown.git

# Go to the cloned repository
cd phpDocumentor-markdown

# Install dependencies
composer install

# Set up PHPUnit configuration
cp phpunit.xml.dist phpunit.xml

# Run PHPUnit in project root directory
composer test
```

Contributing
------------

[](#contributing)

- There are unit tests and functional tests available in the `tests` directory.
    - Unit tests are used to test individual Twig macros
    - Functional tests are used to test the whole documentation generation process

Inspired by:
------------

[](#inspired-by)

- [dmarkic/phpdoc3-template-md](https://github.com/dmarkic/phpdoc3-template-md)
- [cvuorinen/phpdoc-markdown-public](https://github.com/cvuorinen/phpdoc-markdown-public)
- [evert/phpdoc-md](https://github.com/evert/phpdoc-md)
- [heimrichhannot/phpdoc-github-template](https://github.com/heimrichhannot/phpdoc-github-template)

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance49

Moderate activity, may be stable

Popularity43

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~236 days

Recently: every ~295 days

Total

6

Last Release

359d ago

Major Versions

0.1.4 → 1.0.02025-07-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13721842?v=4)[Sakri Koskimies](/maintainers/Saggre)[@Saggre](https://github.com/Saggre)

---

Top Contributors

[![Saggre](https://avatars.githubusercontent.com/u/13721842?v=4)](https://github.com/Saggre "Saggre (84 commits)")[![individual-it](https://avatars.githubusercontent.com/u/2425577?v=4)](https://github.com/individual-it "individual-it (1 commits)")

---

Tags

documentationgithubgitlabmarkdownphpdocphpdocumentorphpdocdocumentationaiphpDocumentormarkdownci

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saggre-phpdocumentor-markdown/health.svg)

```
[![Health](https://phpackages.com/badges/saggre-phpdocumentor-markdown/health.svg)](https://phpackages.com/packages/saggre-phpdocumentor-markdown)
```

###  Alternatives

[cvuorinen/phpdoc-markdown-public

phpDocumentor template that generates Markdown documentation of the public API

3513.9k29](/packages/cvuorinen-phpdoc-markdown-public)[nelson6e65/phpdoc-vuepress

Template for generating your PHP API documentation in a pretty VuePress format.

234.6k2](/packages/nelson6e65-phpdoc-vuepress)[dudo1985/wpdocgen

Documentation Generator for WordPress.

2332.3k](/packages/dudo1985-wpdocgen)[klapaudius/symfony-mcp-server

Build your own LLM tools inside your symfony project by adding to it a Model Context Protocol Server

3023.8k](/packages/klapaudius-symfony-mcp-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
