silverslice/markdown-api

Markdown documentation generator

v0.1.1 2015-08-26 07:50 UTC

This package is auto-updated.

Last update: 2024-04-15 17:23:00 UTC


README

Install

composer require silverslice/markdown-api

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:

generate

Generates markdown documentation for public methods in a specified class

generate($className)

Parameters:

  • string $className - Fully qualified class name

Returns:

  • $this

save

Saves generated documentation to a file

save($fileName)

Parameters:

  • string $fileName - The name of the file

Returns:

  • int - The number of bytes that were written to the file, or false on failure

output

Outputs generated documentation

output()

setTemplate

Sets file path for template of a method

setTemplate($file)

Parameters:

  • string $file - Path to the template

Throws:

  • \InvalidArgumentException - If the file cannot be read