Download the PHP package ivuorinen/markdowndocs without Composer
On this page you can find all versions of the php package ivuorinen/markdowndocs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ivuorinen/markdowndocs
More information about ivuorinen/markdowndocs
Files in ivuorinen/markdowndocs
Package markdowndocs
Short Description Command line tool for generating markdown-formatted class documentation
License MIT
Homepage https://github.com/ivuorinen/PHP-Markdown-Documentation-Generator
Informations about the package markdowndocs
PHP-Markdown-Documentation-Generator
Documentation is just as important as the code it's referring 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.
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.
Write your code documentation following the standard set by phpdoc.
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
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
- PHP version >= 8.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
Installation / Usage
This command line tool can be installed using composer.
From the local working directory of the project that you would like to document, run:
This will add ivuorinen/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
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.
Note that any class to be documented must be loadable using the autoloader provided by composer.
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
Excluding directories
You can tell the command line tool to ignore certain directories in your class path by using the --ignore
option.