Skip to content

Commit

Permalink
[FEATURE] Create a rst theme to convert markdown
Browse files Browse the repository at this point in the history
Convert basic mark-down into restructured Text

* blockquote
  • Loading branch information
linawolf committed Oct 12, 2024
1 parent d6130ac commit 8b9b825
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 16 deletions.
44 changes: 42 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
use phpDocumentor\Guides\RstTheme\Twig\RstExtension;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

return static function (ContainerConfigurator $container): void {
$container->services()
->defaults()
Expand All @@ -31,7 +29,6 @@
)

->set(RstExtension::class)
->arg('$nodeRenderer', service('phpdoc.guides.output_node_renderer'))
->tag('twig.extension')
->autowire();
};
10 changes: 0 additions & 10 deletions packages/guides-theme-rst/src/RstTheme/Twig/RstExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@

namespace phpDocumentor\Guides\RstTheme\Twig;

use phpDocumentor\Guides\NodeRenderers\NodeRenderer;
use phpDocumentor\Guides\Nodes\Node;
use phpDocumentor\Guides\Nodes\TitleNode;
use phpDocumentor\Guides\RstTheme\Configuration\HeaderSyntax;
use phpDocumentor\Guides\Twig\GlobalMenuExtension;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
Expand All @@ -33,13 +30,6 @@

final class RstExtension extends AbstractExtension
{
/** @param NodeRenderer<Node> $nodeRenderer */
public function __construct(
private readonly NodeRenderer $nodeRenderer,
) {
$this->menuExtension = new GlobalMenuExtension($this->nodeRenderer);
}

/** @return TwigFunction[] */
public function getFunctions(): array
{
Expand Down
2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.24.0@462c80e31c34e58cc4f750c656be3927e80e550e">
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<file src="packages/guides-cli/src/Config/Configuration.php">
<UndefinedMethod>
<code><![CDATA[ignoreExtraKeys]]></code>
Expand Down

0 comments on commit 8b9b825

Please sign in to comment.