\Dewdrop\Cli\RendererMarkdown

Render output as Markdown. For more information, see:

http://daringfireball.net/projects/markdown/

Summary

Methods
Properties
Constants
__construct()
title()
subhead()
text()
table()
success()
warn()
error()
unorderedList()
newline()
ask()
secret()
select()
confirm()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$console
N/A

Properties

$console

$console : \Zend\Console\Adapter\AbstractAdapter

The console adapter used for rendering color output.

Type

\Zend\Console\Adapter\AbstractAdapter

Methods

__construct()

__construct(\Zend\Console\Adapter\AbstractAdapter  $console = null) 

Create console instance for color output of success/failure messages.

Parameters

\Zend\Console\Adapter\AbstractAdapter $console

title()

title(string  $title) 

Display the primary title for the output using the "=" Markdown syntax:

Title
=====

Parameters

string $title

subhead()

subhead(string  $subhead) 

Display a subhead, or 2nd-level header using the "hyphen" Markdown syntax:

Subhead
-------

Parameters

string $subhead

text()

text(string  $text) 

Display a single line or block of text.

Parameters

string $text

table()

table(array  $rows) 

Display a table. The supplied array should have the row title as the keys and the descriptions as the array values.

This doesn't actually use any Markdown extenstion syntax for tables, so it might be worth looking into that possibility, if we do plan to transform the Markdown to HTML at some point.

Parameters

array $rows

success()

success(string  $message) 

Display a success message using green color on the console to make it easier to spot at a glance.

Parameters

string $message

warn()

warn(string  $warning) 

Display a warning message using yellow color on the console to make it easier to spot at a glance.

Parameters

string $warning

error()

error(string  $error) 

Display an error message using red color on the console to make it easier to spot.

Parameters

string $error

unorderedList()

unorderedList(array  $items) : \Dewdrop\Cli\Renderer\RendererInterface

Display an unordered (bulleted) list.

Parameters

array $items

Returns

\Dewdrop\Cli\Renderer\RendererInterface

newline()

newline() 

Display a newline/line break.

ask()

ask(  $promptText, boolean  $allowEmpty = false) : string

Ask the user for a line of input.

Parameters

$promptText
boolean $allowEmpty

Returns

string

secret()

secret(  $promptText, boolean  $allowEmpty = false) : string

Ask the user for a line of input and don't display that input as they're typing. Ideal for passwords, etc.

Parameters

$promptText
boolean $allowEmpty

Returns

string

select()

select(  $promptText, array  $options, boolean  $allowEmpty = false) : string

Request that the user select an option from a list.

Parameters

$promptText
array $options
boolean $allowEmpty

Returns

string

confirm()

confirm(  $promptText,   $echo = true) : boolean

Ask the user to answer a yes/no confirmation prompt.

Parameters

$promptText
$echo

Returns

boolean