PHPackages                             hushulin/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. hushulin/markdowndocs

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

hushulin/markdowndocs
=====================

Command line tool for generating markdown-formatted class documentation

1.3.14(5y ago)01.1kMITPHPPHP &gt;=5.5.0

Since Feb 4Pushed 5y agoCompare

[ Source](https://github.com/hushulin/PHP-Markdown-Documentation-Generator)[ Packagist](https://packagist.org/packages/hushulin/markdowndocs)[ Docs](https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator)[ RSS](/packages/hushulin-markdowndocs/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (23)Used By (0)

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

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

Documentation is just as important as the code it's refering 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.

[![Travis](https://camo.githubusercontent.com/bc3b6d77574bc6131e9dc7e2ba7daacfd8c6e5308c2ed4e87c1c145168c94ec3/68747470733a2f2f7472617669732d63692e6f72672f766963746f726a6f6e73736f6e2f5048502d4d61726b646f776e2d446f63756d656e746174696f6e2d47656e657261746f722e737667)](https://camo.githubusercontent.com/bc3b6d77574bc6131e9dc7e2ba7daacfd8c6e5308c2ed4e87c1c145168c94ec3/68747470733a2f2f7472617669732d63692e6f72672f766963746f726a6f6e73736f6e2f5048502d4d61726b646f776e2d446f63756d656e746174696f6e2d47656e657261746f722e737667)

### 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
    */
   function someFunc($str, $arr=array()) {

   }
}
```

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/victorjonsson/PHP-Markdown-Documentation-Generator/blob/master/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;= 5.3.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 victorjonsson/markdowndocs

```

This will add victorjonsson/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

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 89.1% 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 ~108 days

Recently: every ~7 days

Total

22

Last Release

1838d ago

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

1.3.1PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/844adb46276ae11548e44c212f2fbf938cf8b577dc60740dab1bfd1533d53356?d=identicon)[hushulin](/maintainers/hushulin)

---

Top Contributors

[![victorjonsson](https://avatars.githubusercontent.com/u/429182?v=4)](https://github.com/victorjonsson "victorjonsson (155 commits)")[![hushulin](https://avatars.githubusercontent.com/u/4876973?v=4)](https://github.com/hushulin "hushulin (5 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)")[![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)")[![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)")[![dave-redfern](https://avatars.githubusercontent.com/u/1477147?v=4)](https://github.com/dave-redfern "dave-redfern (1 commits)")[![rhukster](https://avatars.githubusercontent.com/u/1084697?v=4)](https://github.com/rhukster "rhukster (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/hushulin-markdowndocs/health.svg)](https://phpackages.com/packages/hushulin-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)[statamic/cli

Statamic CLI Tool

7587.7k](/packages/statamic-cli)

PHPackages © 2026

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