[Console] MarkdownDescriptor: Link to commands anchors

This commit is contained in:
Maxime STEINHAUSSER 2016-12-13 14:05:04 +01:00 committed by Maxime Steinhausser
parent 0abe862761
commit fc2395e237
4 changed files with 13 additions and 13 deletions

View File

@ -133,8 +133,8 @@ class MarkdownDescriptor extends Descriptor
}
$this->write("\n\n");
$this->write(implode("\n", array_map(function ($commandName) {
return '* `'.$commandName.'`';
$this->write(implode("\n", array_map(function ($commandName) use ($description) {
return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName()));
}, $namespace['commands'])));
}

View File

@ -1,8 +1,8 @@
Console Tool
============
* `help`
* `list`
* [`help`](#help)
* [`list`](#list)
`help`
------

View File

@ -1,15 +1,15 @@
My Symfony application <info>v1.0</info>
========================================
* `alias1`
* `alias2`
* `help`
* `list`
* [`alias1`](#descriptorcommand1)
* [`alias2`](#descriptorcommand1)
* [`help`](#help)
* [`list`](#list)
**descriptor:**
* `descriptor:command1`
* `descriptor:command2`
* [`descriptor:command1`](#descriptorcommand1)
* [`descriptor:command2`](#descriptorcommand2)
`help`
------

View File

@ -1,12 +1,12 @@
MbString åpplicätion
====================
* `help`
* `list`
* [`help`](#help)
* [`list`](#list)
**descriptor:**
* `descriptor:åèä`
* [`descriptor:åèä`](#descriptoråèä)
`help`
------