Tiny library for generating API documentation for your class
Install
composer require silverslice/markdown-api, (*1)
Live example
require __DIR__ . '/../vendor/autoload.php';
$g = new Silverslice\MarkdownApi\Generator();
$g->generate('Silverslice\MarkdownApi\Generator')->output();
This code generates following documentation for class \Silverslice\MarkdownApi\Generator:, (*2)
generate
Generates markdown documentation for public methods in a specified class, (*3)
generate($className)
Parameters:
- string $className - Fully qualified class name, (*4)
Returns:
- $this, (*5)
save
Saves generated documentation to a file, (*6)
save($fileName)
Parameters:
- string $fileName - The name of the file, (*7)
Returns:
- int - The number of bytes that were written to the file, or false on failure, (*8)
output
Outputs generated documentation, (*9)
output()
setTemplate
Sets file path for template of a method, (*10)
setTemplate($file)
Parameters:
- string $file - Path to the template, (*11)
Throws:, (*12)
-
\InvalidArgumentException - If the file cannot be read