PHPackages                             gealex/phpdoc-to-rst - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. gealex/phpdoc-to-rst

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gealex/phpdoc-to-rst
====================

Generate Sphinx/ReStructured documentation from PHPDoc

v1.2(6y ago)05AGPL-3.0-or-laterPHP

Since Jul 11Pushed 6y agoCompare

[ Source](https://github.com/gealex/phpdoc-to-rst)[ Packagist](https://packagist.org/packages/gealex/phpdoc-to-rst)[ RSS](/packages/gealex-phpdoc-to-rst/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (7)Used By (0)

phpdoc-to-rst
=============

[](#phpdoc-to-rst)

[![Build Status](https://camo.githubusercontent.com/03c8e6107b9c7fd09169c48292d4ed96debe3bd3aca4a7703f836a1d9d8e98b2/68747470733a2f2f7472617669732d63692e6f72672f61626261646f6e313333342f706870646f632d746f2d7273742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/abbadon1334/phpdoc-to-rst)[![Coverage Status](https://camo.githubusercontent.com/8fb44bdc6ceeb821ab2c03061ff7f6c3086da843dd1393083f5b5c4529986dba/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f61626261646f6e313333342f706870646f632d746f2d7273742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/abbadon1334/phpdoc-to-rst?branch=master)[![Codacy Badge](https://camo.githubusercontent.com/5706d92bcbe07ff03bd2c0cd82220d6152d0d9ae24e2a7c50f9ef9b3b2709782/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3462343236346562333663613439656438316432396635313032613634613339)](https://www.codacy.com/app/abbadon1334/phpdoc-to-rst?utm_source=github.com&utm_medium=referral&utm_content=abbadon1334/phpdoc-to-rst&utm_campaign=Badge_Grade)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/33c1369bd680497babf3bb626eda5347c0349648f937c7dc9899195f87627f43/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61626261646f6e313333342f706870646f632d746f2d7273742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/abbadon1334/phpdoc-to-rst/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/007ead86f3fd0723e3bb7eee011c304a0f643498496ba6c9902f12cd044db950/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61626261646f6e313333342f706870646f632d746f2d7273742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/abbadon1334/phpdoc-to-rst/?branch=master)[![Build Status](https://camo.githubusercontent.com/9894893433559640afd50ea74d44334a161456900814fe3d43133c0f549d5d1b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61626261646f6e313333342f706870646f632d746f2d7273742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/abbadon1334/phpdoc-to-rst/build-status/master)

Forked and refactor by Francesco "Abbadon1334" Danti.

Now working as intended, with good coverage.

\##Generate reStructuredText for Sphinx based documentation from PHPDoc annotations.

This project is heavily based on [phpDocumentor/Reflection](https://github.com/phpDocumentor/Reflection)and makes use of [sphinxcontrib-phpdomain](https://github.com/markstory/sphinxcontrib-phpdomain).

An example for the documentation output can be found in our [own documentation](http://phpdoc-to-rst.readthedocs.io/en/latest/api_docs.html)

Quickstart
----------

[](#quickstart)

Install phpdoc-to-rst to your project directory:

```
composer require --dev abbadon1334/phpdoc-to-rst

```

Command line usage
------------------

[](#command-line-usage)

Run the command line tool to parse the folders containing your PHP tree and render the reStructuredText files to the output directory:

```
php vendor/bin/phpdoc-to-rst generate --repo-base "$PWD" --repo-github https://github.com/abbadon1334/phpdoc-to-rst -t docs/rst/ src/

```

Programatically usage to generate documentation rst
---------------------------------------------------

[](#programatically-usage-to-generate-documentation-rst)

```
    // your source path or multiple path to be parsed
    $src = [__DIR__.'/../src'];

    // destination path for the documentation
    $dst = __DIR__.'/../docs/api';

    $apiDocBuilder = new ApiDocBuilder($src, $dst);

    // DEBUG FATURES : optional
    // optional : activate verbosity
    $apiDocBuilder->setVerboseOutput(true);
    // optional : activate debug
    $apiDocBuilder->setDebugOutput(true);

    // EXTENSIONS : optional

    /**
     * Do not render classes marked with phpDoc internal tag
     * Do only render public methods/properties.
     */
    $apiDocBuilder->addExtension(PublicOnlyExtension::class);

    /**
     * Do not render classes marked with phpDoc internal tag
     * Do only render public methods/properties.
     */
    $apiDocBuilder->addExtension(NoPrivateExtension::class);

    /**
     * This extension will render a list of methods  for easy access
     * at the beginning of classes, interfaces and traits.
     */
    $apiDocBuilder->addExtension(TocExtension::class);

    /**
     * This extension adds a link to the source at github to all elements.
     *
     * Arguments
     * 0 => Url to the github repo (required)
     * 1 => Path to the git repository (required)
     * 2 => Branch to link to (default=master)
     */
    $apiDocBuilder->addExtension(GithubLocationExtension::class, [
        __DIR__.'/../src',
        'http://github.com/abbadon1334/phpdoc-to-rst/',
    ]);

    // Build documentation
    $apiDocBuilder->build();
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 56.6% 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 ~37 days

Total

3

Last Release

2418d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11295288?v=4)[gealex](/maintainers/gealex)[@gealex](https://github.com/gealex)

---

Top Contributors

[![juliusknorr](https://avatars.githubusercontent.com/u/3404133?v=4)](https://github.com/juliusknorr "juliusknorr (64 commits)")[![abbadon1334](https://avatars.githubusercontent.com/u/5801824?v=4)](https://github.com/abbadon1334 "abbadon1334 (43 commits)")[![stuba](https://avatars.githubusercontent.com/u/818066?v=4)](https://github.com/stuba "stuba (3 commits)")[![qury](https://avatars.githubusercontent.com/u/1764676?v=4)](https://github.com/qury "qury (2 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gealex-phpdoc-to-rst/health.svg)

```
[![Health](https://phpackages.com/badges/gealex-phpdoc-to-rst/health.svg)](https://phpackages.com/packages/gealex-phpdoc-to-rst)
```

###  Alternatives

[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

4743.5k9](/packages/phel-lang-phel-lang)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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