Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Feb 13, 2014
1 parent 7e7e4be commit 9c792e0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
25 changes: 25 additions & 0 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,31 @@ $this->taskChangelog()
* change(Parameter #0 [ <required> $change ])
* getChanges()

### GenMarkdownDocTask

Simple documentation generator from source files.
Takes docblocks from classes and methods and generates markdown file.

``` php
$this->taskGenDoc('models.md')
->docClass('Model\User')
->docClass('Model\Post')
->filterMethods(function(\ReflectionMethod $r) {
return $r->isPublic(); // process only public methods
})->processClass(function(\ReflectionClass $r, $text) {
return "Class ".$r->getName()."\n\n$text\n\n###Methods\n";
})->run();
```

* docClass(string $classname)
* filterMethods(\Closure $func)
* filterClasses(\Closure $func)
* processMethod(\Closure $func)
* processClass(\Closure $func)
* reorder(\Closure $func)
* prepend(string $text)
* append(string $text)

## Exec

``` use Robo\Task\Exec;```
Expand Down
20 changes: 10 additions & 10 deletions src/Task/Development.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected function taskChangelog($filename = 'CHANGELOG.md')

protected function taskGenDoc($filename)
{
return new GenMarkdownDoc($filename);
return new GenMarkdownDocTask($filename);
}

}
Expand Down Expand Up @@ -139,16 +139,16 @@ public function run()
* })->run();
* ```
*
* @method GenMarkdownDoc docClass(string $classname)
* @method GenMarkdownDoc filterMethods(\Closure $func)
* @method GenMarkdownDoc filterClasses(\Closure $func)
* @method GenMarkdownDoc processMethod(\Closure $func)
* @method GenMarkdownDoc processClass(\Closure $func)
* @method GenMarkdownDoc reorder(\Closure $func)
* @method GenMarkdownDoc prepend(string $text)
* @method GenMarkdownDoc append(string $text)
* @method GenMarkdownDocTask docClass(string $classname)
* @method GenMarkdownDocTask filterMethods(\Closure $func)
* @method GenMarkdownDocTask filterClasses(\Closure $func)
* @method GenMarkdownDocTask processMethod(\Closure $func)
* @method GenMarkdownDocTask processClass(\Closure $func)
* @method GenMarkdownDocTask reorder(\Closure $func)
* @method GenMarkdownDocTask prepend(string $text)
* @method GenMarkdownDocTask append(string $text)
*/
class GenMarkdownDoc implements TaskInterface
class GenMarkdownDocTask implements TaskInterface
{
use DynamicConfig;
use Output;
Expand Down

0 comments on commit 9c792e0

Please sign in to comment.