PHPackages                             diversen/php-markdown-docs - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. diversen/php-markdown-docs

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

diversen/php-markdown-docs
==========================

Generate Markdown documentation from PHP source files. Useful for generating README.md for e.g. github.com

v1.0.8(9y ago)31.3kMITPHPPHP &gt;=5.4.0

Since Jun 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/diversen/php-markdown-docs)[ Packagist](https://packagist.org/packages/diversen/php-markdown-docs)[ Docs](https://github.com/diversen/php-markdown-docs)[ RSS](/packages/diversen-php-markdown-docs/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (10)Used By (0)

- [About](#about)
- [Install](#install)
- [Usage (lib)](#usage-lib)
- [Usage (binary)](#usage-binary)
- [Class: diversen\\markdownDocs](#class-diversenmarkdowndocs)
    - [Properties](#properties)
    - [Methods](#methods)
        - [public classToMD](#public-classtomd)
        - [public getOutput](#public-getoutput)

### About

[](#about)

Simple and easy to use documentation system for PHP classes, which generates Markdown output. It works easy with e.g. github.com, as you will be able to include documentation for your classes in `README.md` files - like the one you probably are looking at now. Best suited for small code libs with maybe a couple of classes.

### Install

[](#install)

```
composer require diversen/php-markdown-docs

```

### Usage (lib)

[](#usage-lib)

```
    use diversen\markdownDocs;

    $md = new markdownDocs();
    // Class to be generate documentaiton for
    $class = 'diversen\markdownDocs';
    $md->classToMD($class);

    echo $md->getOutput();
```

### Usage (binary)

[](#usage-binary)

When the lib is installed you have access to the `markdown-docs` binary, and you can use in a way similar to this:

```
./vendor/bin/markdown-docs --public 'diversen\markdownDocs'

```

This will just output the markdown documentation to `stdout`, so you will need to redirect it, e.g. to a file.

If you want both `private, public, and protected` methods in the documentation, you can remove the `--public` flag. This flag means that only `public` properties and methods will be included in the output.

You can run it on any class that is autoloaded with `composer` `autoload.php`

### Class: diversen\\markdownDocs

[](#class-diversenmarkdowndocs)

---

Simple class that generates `markdown` from `php` source files (using phpdocs format) The real work is done through `Nette\Reflection`. See:

#### Properties

[](#properties)

---

#### Methods

[](#methods)

---

##### public classToMD

[](#public-classtomd)

```
Generates markdown output for a specified class

@param string $class e.g. `PDO` or a user class like `diversen\markdownDocs`

@return void the method adds to $output

```

##### public getOutput

[](#public-getoutput)

```
Returns the markdown phpdocs

@return string $output the final markdown output

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

9

Last Release

3619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23ed91d104f16d10414811ecdafbd5c80a660e658d80ccaadf84f512cfb50629?d=identicon)[diversen](/maintainers/diversen)

---

Top Contributors

[![diversen](https://avatars.githubusercontent.com/u/142675?v=4)](https://github.com/diversen "diversen (54 commits)")

---

Tags

markdownphpdocs

### Embed Badge

![Health badge](/badges/diversen-php-markdown-docs/health.svg)

```
[![Health](https://phpackages.com/badges/diversen-php-markdown-docs/health.svg)](https://phpackages.com/packages/diversen-php-markdown-docs)
```

###  Alternatives

[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

2.9k404.0M702](/packages/league-commonmark)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[league/html-to-markdown

An HTML-to-markdown conversion helper for PHP

1.9k28.6M199](/packages/league-html-to-markdown)[cebe/markdown

A super fast, highly extensible markdown parser for PHP

1.0k32.5M136](/packages/cebe-markdown)[erusev/parsedown-extra

An extension of Parsedown that adds support for Markdown Extra.

84314.8M192](/packages/erusev-parsedown-extra)

PHPackages © 2026

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