クラス yii\console\Markdown
| 継承 | yii\console\Markdown » cebe\markdown\Parser |
|---|---|
| 使用するトレイト | cebe\markdown\block\FencedCodeTrait, cebe\markdown\inline\CodeTrait, cebe\markdown\inline\EmphStrongTrait, cebe\markdown\inline\StrikeoutTrait |
| 利用可能バージョン | 2.0 |
| ソースコード | https://github.com/yiisoft/yii2/blob/master/framework/console/Markdown.php |
コンソール環境での読みやすさを向上させたMarkdownパーサーです。
cebe/markdownに基づいています。
保護されたメソッド
| メソッド | 説明 | 定義元 |
|---|---|---|
| renderCode() | コードブロックをレンダリングします。 | yii\console\Markdown |
| renderEmph() | 強調表示された要素をレンダリングします。 | yii\console\Markdown |
| renderInlineCode() | インラインコードスパン(`)をレンダリングします。 | yii\console\Markdown |
| renderParagraph() | 段落ブロックをレンダリングします。 | yii\console\Markdown |
| renderStrike() | 取り消し線をレンダリングします。 | yii\console\Markdown |
| renderStrong() | 強調表示された要素をレンダリングします。 | yii\console\Markdown |
プロパティの詳細
メソッドの詳細
コードブロックをレンダリングします。
protected string renderCode ($block) | ||
| $block | array | |
protected function renderCode($block)
{
return Console::ansiFormat($block['content'], [Console::NEGATIVE]) . "\n\n";
}
強調表示された要素をレンダリングします。
protected string renderEmph ($element) | ||
| $element | array | |
protected function renderEmph($element)
{
return Console::ansiFormat($this->renderAbsy($element[1]), [Console::ITALIC]);
}
インラインコードスパン(`)をレンダリングします。
protected string renderInlineCode ($element) | ||
| $element | array | |
protected function renderInlineCode($element)
{
return Console::ansiFormat($element[1], [Console::UNDERLINE]);
}
段落ブロックをレンダリングします。
protected string renderParagraph ($block) | ||
| $block | string | |
protected function renderParagraph($block)
{
return rtrim($this->renderAbsy($block['content'])) . "\n\n";
}
取り消し線をレンダリングします。
| protected string renderStrike ( $element ) | ||
| $element | array | |
protected function renderStrike($element)
{
return Console::ansiFormat($this->parseInline($this->renderAbsy($element[1])), [Console::CROSSED_OUT]);
}
強調表示された要素をレンダリングします。
| protected string renderStrong ( $element ) | ||
| $element | array | |
protected function renderStrong($element)
{
return Console::ansiFormat($this->renderAbsy($element[1]), [Console::BOLD]);
}
サインアップ または ログイン してコメントしてください。