Update website

This commit is contained in:
Guilhem Lavaux 2024-11-19 08:02:04 +01:00
parent 4413528994
commit 1d90fbf296
6865 changed files with 1091082 additions and 0 deletions

View file

@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Doctrine\RST\Formats;
use Doctrine\RST\Directives\Directive;
use Doctrine\RST\Renderers\NodeRendererFactory;
interface Format
{
public const HTML = 'html';
public const LATEX = 'tex';
public function getFileExtension(): string;
/** @return Directive[] */
public function getDirectives(): array;
/** @return NodeRendererFactory[] */
public function getNodeRendererFactories(): array;
}

View file

@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace Doctrine\RST\Formats;
use Doctrine\RST\Directives\Directive;
use Doctrine\RST\Renderers\NodeRendererFactory;
final class InternalFormat implements Format
{
/** @var Format */
private $format;
/** @var Directive[]|null */
private $directives;
/** @var NodeRendererFactory[]|null */
private $nodeRendererFactories;
public function __construct(Format $format)
{
$this->format = $format;
}
public function getFileExtension(): string
{
return $this->format->getFileExtension();
}
/** @return Directive[] */
public function getDirectives(): array
{
if ($this->directives === null) {
$this->directives = $this->format->getDirectives();
}
return $this->directives;
}
/** @return NodeRendererFactory[] */
public function getNodeRendererFactories(): array
{
if ($this->nodeRendererFactories === null) {
$this->nodeRendererFactories = $this->format->getNodeRendererFactories();
}
return $this->nodeRendererFactories;
}
}