bhenk / doc2rst
PHPDocs to reStructuredText generator
Requires
- php: >=8.1
- ext-mbstring: *
- psr/container: ^2.0.2
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-04-04 21:21:45 UTC
README
PHPDoc to reStructuredText
Doc2rst generates reStructuredText from PHP-source trees. The generated reStructuredText than again can act as a source for Sphinx, the versatile tool that builds -amongst others- html.
Doc2rst is written in PHP.
Requirement: php >=8.1
Documentation: https://doc2rst.readthedocs.io/en/latest/index.html
Run as phar
Download the latest phar-file and place it in your project root folder. Supposing your documentation folder is called docs, issue the quickstart command:
./doc2rst.phar -q ./docs
This will place 3 configuration files in your docs folder. Inspect and correct docs/d2r-conf.php than run
./doc2rst.phar -r ./docs
This will generate the reStructuredText files in your docs/api folder.
Run as requirement
As you probably only need doc2rst during development you can add the –dev option to the composer command:
composer require --dev bhenk/doc2rst
Supposing your documentation folder is called docs, run quickstart to install the configuration files in your docs folder:
$process = new ProcessManager("path/to/docs");
$process->quickStart();
This will place 3 configuration files in your docs folder. Inspect and correct docs/d2r-conf.php than run
$process = new ProcessManager("path/to/docs");
$process->run();
This will generate the reStructuredText files in your docs/api folder.
Configuration
For a detailed discussion on configuration options see run configuration (RC enum).