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
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.
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.
For a detailed discussion on configuration options see run configuration (RC enum).