Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
56
vendor/doctrine/rst-parser/lib/Directives/Admonition.php
vendored
Normal file
56
vendor/doctrine/rst-parser/lib/Directives/Admonition.php
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\RST\Directives;
|
||||
|
||||
use Doctrine\RST\Nodes\Node;
|
||||
use Doctrine\RST\Nodes\WrapperNode;
|
||||
use Doctrine\RST\Parser;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
class Admonition extends SubDirective
|
||||
{
|
||||
/** @var string */
|
||||
private $name;
|
||||
|
||||
/** @var string */
|
||||
private $backgroundColor;
|
||||
|
||||
/** @var string */
|
||||
private $textColor;
|
||||
|
||||
/** @var string */
|
||||
private $icon;
|
||||
|
||||
public function __construct(string $name, string $backgroundColor, string $textColor, string $icon)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->backgroundColor = $backgroundColor;
|
||||
$this->textColor = $textColor;
|
||||
$this->icon = $icon;
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/** @param string[] $options */
|
||||
public function processSub(
|
||||
Parser $parser,
|
||||
?Node $document,
|
||||
string $variable,
|
||||
string $data,
|
||||
array $options
|
||||
): ?Node {
|
||||
return new WrapperNode($document, sprintf(
|
||||
'<div class="alert %s-admonition %s %s border"><table width="100%%"><tr><td width="10" class="align-top"><i class="%s mr-2"></i></td><td>',
|
||||
$this->name,
|
||||
$this->backgroundColor,
|
||||
$this->textColor,
|
||||
$this->icon
|
||||
), '</td></tr></table></div>');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue