PHPackages                             ivuorinen/markdowndocs - 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. [CLI &amp; Console](/categories/cli)
4. /
5. ivuorinen/markdowndocs

ActiveLibrary[CLI &amp; Console](/categories/cli)

ivuorinen/markdowndocs
======================

Command line tool for generating markdown-formatted class documentation

4.0.0(1y ago)041↓100%[1 PRs](https://github.com/ivuorinen/markdowndocs/pulls)1MITPHPPHP ^8.2CI passing

Since Feb 4Pushed 1mo agoCompare

[ Source](https://github.com/ivuorinen/markdowndocs)[ Packagist](https://packagist.org/packages/ivuorinen/markdowndocs)[ Docs](https://github.com/ivuorinen/PHP-Markdown-Documentation-Generator)[ RSS](/packages/ivuorinen-markdowndocs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (27)Used By (1)

PHP-Markdown-Documentation-Generator
====================================

[](#php-markdown-documentation-generator)

Documentation is just as important as the code it's referring to. With this command line tool you will be able to write your documentation once, and only once!

This project will write a single-page markdown-formatted API document based on the DocBlock comments in your source code.

### Example

[](#example)

Let's say you have your PHP classes in a directory named "src". Each class has its own file that is named after the class.

```
- src/
  - MyObject.php
  - OtherObject.php

```

Write your code documentation following the standard set by [phpdoc](http://www.phpdoc.org/).

```
namespace Acme;

/**
 * This is a description of this class
 */
class MyObject {

   /**
    * This is a function description
    * @param string $str
    * @param array $arr
    * @return Acme\OtherObject
    */
   public function someFunc($str, $arr=[]) {}
}
```

Then, running `phpdoc-md generate src > api.md` will write your API documentation to the file api.md.

[Here you can see a rendered example](https://github.com/ivuorinen/markdowndocs/blob/main/docs.md)

Only public and protected functions will be a part of the documentation, but you can also add `@ignore` to any function or class to exclude it from the docs. Phpdoc-md will try to guess the return type of functions that don't explicitly declare one. The program uses reflection to get as much information as possible out of the code so that functions that are missing DocBlock comments will still be included in the generated documentation.

### Requirements

[](#requirements)

- PHP version &gt;= 8.2
- Reflection must be enabled in php.ini
- Each class must be defined in its own file with the file name being the same as the class name
- The project should use [Composer](https://getcomposer.org/)

### Installation / Usage

[](#installation--usage)

This command line tool can be installed using [composer](https://getcomposer.org/).

From the local working directory of the project that you would like to document, run:

```
composer require --dev ivuorinen/markdowndocs
```

This will add ivuorinen/markdowndocs to the `require-dev` section of your project's composer.json file. The `phpdoc-md` executable will automatically be copied to your project's `vendor/bin` directory.

##### Generating docs

[](#generating-docs)

The `generate` command generates your project's API documentation file. The command line tool needs to know whether you want to generate docs for a certain class, or if it should process every class in a specified directory search path.

```
# Generate docs for a certain class
./vendor/bin/phpdoc-md generate Acme\\NS\\MyClass

# Generate docs for several classes (comma separated)
./vendor/bin/phpdoc-md generate Acme\\NS\\MyClass,Acme\\OtherNS\\OtherClass

# Generate docs for all classes in a source directory
./vendor/bin/phpdoc-md generate includes/src

# Generate docs for all classes in a source directory and send output to the file api.md
./vendor/bin/phpdoc-md generate includes/src > api.md
```

*Note that any class to be documented must be loadable using the autoloader provided by composer.*

##### Bootstrapping

[](#bootstrapping)

If you are not using the composer autoloader, or if there is something else that needs to be done before your classes can be instantiated, then you may request phpdoc-md to load a php bootstrap file prior to generating the docs

```
./vendor/bin/phpdoc-md generate --bootstrap=includes/init.php includes/src > api.md
```

##### Excluding directories

[](#excluding-directories)

You can tell the command line tool to ignore certain directories in your class path by using the `--ignore` option.

```
./phpdoc-md generate --ignore=test,examples includes/src > api.md
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance65

Regular maintenance activity

Popularity8

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 79.9% 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 ~165 days

Recently: every ~303 days

Total

22

Last Release

635d ago

Major Versions

1.3.8 → 2.0.12021-04-20

2.0.1 → 3.0.02022-02-25

3.0.2 → 4.0.02024-08-15

PHP version history (4 changes)1.2.2PHP &gt;=5.3.2

1.3.1PHP &gt;=5.5.0

3.0.0PHP &gt;=7.4 || ^8.0 || ^8.1

4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf5ed077613c7b9d88b8040e1f9106f16433c946b299d09f219a1a04d9c54dd4?d=identicon)[ivuorinen](/maintainers/ivuorinen)

---

Top Contributors

[![victorjonsson](https://avatars.githubusercontent.com/u/429182?v=4)](https://github.com/victorjonsson "victorjonsson (155 commits)")[![ivuorinen](https://avatars.githubusercontent.com/u/11024?v=4)](https://github.com/ivuorinen "ivuorinen (20 commits)")[![greg-1-anderson](https://avatars.githubusercontent.com/u/612191?v=4)](https://github.com/greg-1-anderson "greg-1-anderson (4 commits)")[![tdely](https://avatars.githubusercontent.com/u/7439391?v=4)](https://github.com/tdely "tdely (3 commits)")[![rhukster](https://avatars.githubusercontent.com/u/1084697?v=4)](https://github.com/rhukster "rhukster (3 commits)")[![siwinski](https://avatars.githubusercontent.com/u/1034024?v=4)](https://github.com/siwinski "siwinski (2 commits)")[![w00fz](https://avatars.githubusercontent.com/u/11734?v=4)](https://github.com/w00fz "w00fz (2 commits)")[![mathroc](https://avatars.githubusercontent.com/u/291531?v=4)](https://github.com/mathroc "mathroc (1 commits)")[![dave-redfern](https://avatars.githubusercontent.com/u/1477147?v=4)](https://github.com/dave-redfern "dave-redfern (1 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (1 commits)")[![lucatume](https://avatars.githubusercontent.com/u/2749650?v=4)](https://github.com/lucatume "lucatume (1 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ivuorinen-markdowndocs/health.svg)

```
[![Health](https://phpackages.com/badges/ivuorinen-markdowndocs/health.svg)](https://phpackages.com/packages/ivuorinen-markdowndocs)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[crazywhalecc/static-php-cli

Build single static PHP binary, with PHP project together, with popular extensions included.

1.8k13.9k](/packages/crazywhalecc-static-php-cli)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)[madewithlove/license-checker

CLI tool to verify allowed licenses for composer dependencies

54449.8k21](/packages/madewithlove-license-checker)[shel/neos-terminal

Neos CMS Ui terminal for running Eel expressions and other commands

1441.3k](/packages/shel-neos-terminal)

PHPackages © 2026

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