40 lines
724 B
PHP
40 lines
724 B
PHP
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace Doctrine\RST\LaTeX\Directives;
|
||
|
|
||
|
use Doctrine\RST\Directives\SubDirective;
|
||
|
use Doctrine\RST\Nodes\Node;
|
||
|
use Doctrine\RST\Parser;
|
||
|
|
||
|
/**
|
||
|
* Wraps a sub document in a div with a given class
|
||
|
*/
|
||
|
final class Wrap extends SubDirective
|
||
|
{
|
||
|
/** @var string */
|
||
|
private $class;
|
||
|
|
||
|
public function __construct(string $class)
|
||
|
{
|
||
|
$this->class = $class;
|
||
|
}
|
||
|
|
||
|
public function getName(): string
|
||
|
{
|
||
|
return $this->class;
|
||
|
}
|
||
|
|
||
|
/** @param string[] $options */
|
||
|
public function processSub(
|
||
|
Parser $parser,
|
||
|
?Node $document,
|
||
|
string $variable,
|
||
|
string $data,
|
||
|
array $options
|
||
|
): ?Node {
|
||
|
return $document;
|
||
|
}
|
||
|
}
|