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[1 issues](https://github.com/ivuorinen/markdowndocs/issues)[1 PRs](https://github.com/ivuorinen/markdowndocs/pulls)1MITPHPPHP ^8.2CI passing

Since Feb 4Pushed 3d 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 2d 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)

By default, functions that are public, protected, abstract or final will be a part of the documentation — private functions are never included. Use `--visibility`to narrow that set. 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 8.3, 8.4 or 8.5 — every branch currently supported by php.net. Each one is exercised by CI on every push.
- Reflection must be enabled in php.ini
- Each class, interface, trait or enum must be defined in its own `.php` file, with the file name being the same as the type name. Files with another extension are not scanned
- 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.*

##### Options

[](#options)

OptionDefaultEffect`--bootstrap`, `-b`nonePHP file to require before generating documentation`--ignore`, `-i`noneComma-separated directory names to skip, at any depth. Matched whole: `--ignore=test` skips `test/`, not `latest/``--visibility``public,protected,abstract,final`Comma-separated method visibilities to include. Unknown values are rejected; `private` is not supported`--methodRegex`noneFull regular expression a method name must match to be included`--tableGenerator``default`Slug or fully-qualified class name of a `PHPDocsMD\TableGenerator` implementation. Unknown values are rejected`--see`offInclude `@see` entries in the generated markdown`--no-internal`offSkip classes and functions tagged `@internal``--no-examples`offOmit `@example` blocks that would otherwise follow each function table```
# Only public methods, only those named like a getter, including @see references
./vendor/bin/phpdoc-md generate --visibility=public --methodRegex='/^get/' --see includes/src > api.md
```

##### 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

48

—

FairBetter than 94% of packages

Maintenance69

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 77.5% 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

726d 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://avatars.githubusercontent.com/u/11024?v=4)[Ismo Vuorinen](/maintainers/ivuorinen)[@ivuorinen](https://github.com/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 (22 commits)")[![greg-1-anderson](https://avatars.githubusercontent.com/u/612191?v=4)](https://github.com/greg-1-anderson "greg-1-anderson (4 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (4 commits)")[![rhukster](https://avatars.githubusercontent.com/u/1084697?v=4)](https://github.com/rhukster "rhukster (3 commits)")[![tdely](https://avatars.githubusercontent.com/u/7439391?v=4)](https://github.com/tdely "tdely (3 commits)")[![w00fz](https://avatars.githubusercontent.com/u/11734?v=4)](https://github.com/w00fz "w00fz (2 commits)")[![siwinski](https://avatars.githubusercontent.com/u/1034024?v=4)](https://github.com/siwinski "siwinski (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.

13046.6M7.2k](/packages/illuminate-console)

PHPackages © 2026

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