diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index e4507563..44f75294 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -20,7 +20,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
coverage: none
- php-version: 8.3
+ php-version: 8.4
tools: composer:v2
ini-values: date.timezone=UTC
@@ -37,7 +37,7 @@ jobs:
# add here only the PHP versions and OS used in GitHub CI (for tests)
# and on the symfony.com server (where the Symfony Docs are built)
operating-system: ['ubuntu-latest']
- php-version: ['8.3', '8.4']
+ php-version: ['8.4', '8.5']
steps:
- name: 'Checkout code'
@@ -51,8 +51,8 @@ jobs:
tools: composer:v2
ini-values: date.timezone=UTC
- - name: Install Composer Dependencies
- run: composer install --no-progress
+ - name: Install Composer Dependencies
+ run: composer install --no-progress
- - name: PHPUnit
- run: vendor/bin/simple-phpunit
+ - name: PHPUnit
+ run: composer test
diff --git a/.gitignore b/.gitignore
index 793daca2..2ca70321 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,11 @@
+!tools/*/composer.lock
/vendor/
/tests/_output
/tests/_cache
/var/
/docs.phar
/.env
+/.php-cs-fixer.cache
/.phpunit.result.cache
+/.phpunit.cache
/composer.lock
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
new file mode 100644
index 00000000..2e788d47
--- /dev/null
+++ b/.php-cs-fixer.dist.php
@@ -0,0 +1,34 @@
+setRules([
+ '@PHP71Migration' => true,
+ '@PHPUnit75Migration:risky' => true,
+ '@Symfony' => true,
+ '@Symfony:risky' => true,
+ 'protected_to_private' => false,
+ 'native_constant_invocation' => ['strict' => false],
+ 'no_superfluous_phpdoc_tags' => [
+ 'remove_inheritdoc' => true,
+ 'allow_unused_params' => true, // for future-ready params, to be replaced with https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7377
+ ],
+ 'header_comment' => ['header' => $fileHeaderComment],
+ 'modernize_strpos' => true,
+ 'get_class_to_class_keyword' => true,
+ 'nullable_type_declaration' => true,
+ ])
+ ->setRiskyAllowed(true)
+ ->setFinder(
+ (new PhpCsFixer\Finder())
+ ->in(__DIR__.'/src')
+ )
+;
diff --git a/LICENSE b/LICENSE
index e5de20ca..333a5070 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,7 @@
The MIT license
Copyright (c) 2018-present Ryan Weaver
+Copyright (c) 2023-present Wouter de Jong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/bin/docs-builder b/bin/docs-builder
deleted file mode 100755
index be6975a7..00000000
--- a/bin/docs-builder
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env php
-getParameterOption(['--symfony-version'], false === getenv('SYMFONY_VERSION') ? 'master' : getenv('SYMFONY_VERSION'));
-
-if (!$version) {
- throw new \Exception('Please pass a --symfony-version= flag or set a SYMFONY_VERSION environment variable to 4.0, master, etc.');
-}
-
-$application = new Application($version);
-$application->run($input);
diff --git a/composer.json b/composer.json
index aceb20a5..983de84f 100644
--- a/composer.json
+++ b/composer.json
@@ -5,33 +5,53 @@
"license": "MIT",
"autoload": {
"psr-4": {
+ "SymfonyTools\\DocsBuilder\\GuidesExtension\\": "src/GuidesExtension/src",
"SymfonyDocsBuilder\\": "src"
}
},
"autoload-dev": {
"psr-4": {
+ "SymfonyTools\\DocsBuilder\\Tests\\": "tests",
"SymfonyDocsBuilder\\Tests\\": "tests"
}
},
"require": {
- "php": ">=8.3",
+ "php": ">=8.4",
"ext-json": "*",
"ext-curl": "*",
- "doctrine/rst-parser": "^0.5",
- "scrivo/highlight.php": "^9.18.1",
- "symfony/filesystem": "^5.2 || ^6.0 || ^7.0 || ^8.0",
- "symfony/finder": "^5.2 || ^6.0 || ^7.0 || ^8.0",
- "symfony/dom-crawler": "^5.2 || ^6.0 || ^7.0 || ^8.0",
- "symfony/css-selector": "^5.2 || ^6.0 || ^7.0 || ^8.0",
- "symfony/console": "^5.2 || ^6.0 || ^7.0 || ^8.0",
- "symfony/http-client": "^5.2 || ^6.0 || ^7.0 || ^8.0",
- "twig/twig": "^2.14 || ^3.3"
+ "phpdocumentor/guides": "^1.9",
+ "phpdocumentor/guides-cli": "^1.9",
+ "phpdocumentor/guides-code": "^1.7",
+ "phpdocumentor/guides-restructured-text": "^1.10@dev",
+ "scrivo/highlight.php": "^9.12.0",
+ "symfony/config": "^8.0",
+ "symfony/filesystem": "^8.0",
+ "symfony/finder": "^8.0",
+ "symfony/event-dispatcher": "^8.0",
+ "symfony/dependency-injection": "^8.0",
+ "symfony/dom-crawler": "^8.0",
+ "symfony/css-selector": "^8.0",
+ "symfony/console": "^8.0",
+ "symfony/http-client": "^8.0",
+ "symfony/string": "^8.0",
+ "twig/twig": "^3.3",
+ "twig/string-extra": "^3.6"
},
"require-dev": {
- "gajus/dindent": "^2.0",
- "symfony/phpunit-bridge": "^5.2 || ^6.0 || ^7.0 || ^8.0",
- "symfony/process": "^5.2 || ^6.0 || ^7.0 || ^8.0",
- "masterminds/html5": "^2.7"
+ "league/flysystem-memory": "^3.0",
+ "symfony/phpunit-bridge": "^8.0",
+ "symfony/process": "^8.0",
+ "symfony/var-dumper": "^8.0"
},
- "bin": ["bin/docs-builder"]
+ "scripts": {
+ "test": "SYMFONY_PHPUNIT_VERSION=12 simple-phpunit",
+ "psalm": [
+ "composer update --no-scripts --working-dir=tools/psalm",
+ "./tools/psalm/vendor/bin/psalm"
+ ],
+ "cs": [
+ "composer update --no-scripts --working-dir=tools/php-cs-fixer",
+ "./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix"
+ ]
+ }
}
diff --git a/phpunit.xml b/phpunit.xml
new file mode 100644
index 00000000..145c9f34
--- /dev/null
+++ b/phpunit.xml
@@ -0,0 +1,31 @@
+
+
+ {{- line_numbers -}}
+
+
+ {{- code|raw -}}
+
+ | 1 %} colspan="{{ column.colspan }}"{% endif %}> + {%- for child in column.children -%} + {{- renderNode(child) -}} + {% endfor %} | + {% endfor %} +
|---|
| 1 %} colspan="{{ column.colSpan }}"{% endif %}{% if column.rowSpan > 1 %} rowspan="{{ column.rowSpan }}"{% endif %}> + {%- for child in column.children -%} + {{- renderNode(child) -}} + {% endfor %} | + {% endfor %} +
{{ name|raw }}
+ {{ renderNode(node) }} ++ {{ node.versionModified }} +
+ {{ renderNode(node.value) }} +{{ node.value|e|fqcn }}
diff --git a/src/GuidesExtension/resources/templates/symfonycom/html/inline/ref.html.twig b/src/GuidesExtension/resources/templates/symfonycom/html/inline/ref.html.twig
new file mode 100644
index 00000000..04701ab3
--- /dev/null
+++ b/src/GuidesExtension/resources/templates/symfonycom/html/inline/ref.html.twig
@@ -0,0 +1 @@
+{{- include('inline/link.html.twig') -}}
diff --git a/src/GuidesExtension/resources/templates/symfonycom/html/structure/header-title.html.twig b/src/GuidesExtension/resources/templates/symfonycom/html/structure/header-title.html.twig
new file mode 100644
index 00000000..eb2d6ae6
--- /dev/null
+++ b/src/GuidesExtension/resources/templates/symfonycom/html/structure/header-title.html.twig
@@ -0,0 +1 @@
+ properly, so we inject a
+ // `` (word-break HTML tag) after some characters to help break those
+ // We only do this for very long (4 or more \\) to not break short
+ // and common `` such as App\Entity\Something
+ if (substr_count($fqcn, '\\') >= 4) {
+ // breaking before the backslask is what Firefox browser does
+ $fqcn = str_replace('\\', '\\', $fqcn);
+ }
+
+ return $fqcn;
+ }
+}
diff --git a/src/GuidesExtension/src/Twig/UrlExtension.php b/src/GuidesExtension/src/Twig/UrlExtension.php
new file mode 100644
index 00000000..5a7685e8
--- /dev/null
+++ b/src/GuidesExtension/src/Twig/UrlExtension.php
@@ -0,0 +1,65 @@
+isSafeUrl(...)),
+ ];
+ }
+
+ #[\Override]
+ public function getFilters(): array
+ {
+ return [
+ new TwigFilter('replace_version', $this->replaceSymfonyVersion(...)),
+ ];
+ }
+
+ private function replaceSymfonyVersion(string $url): string
+ {
+ return u($url)->replace('{version}', $this->buildConfig->symfonyVersion)->toString();;
+ }
+
+ /*
+ * If the URL is considered safe, it's opened in the same browser tab;
+ * otherwise it's opened in a new tab and with some strict security options.
+ */
+ private function isSafeUrl(string $url): bool
+ {
+ // The following are considered Symfony URLs:
+ // * https://symfony.com/[...]
+ // * https://[...].symfony.com/ (e.g. insight.symfony.com, etc.)
+ // * https://symfony.wip/[...] (used for internal/local development)
+ $url = u($url);
+ $isSymfonyUrl = $url->match('{^http(s)?://(.*\.)?symfony.(com|wip)}');
+ $isRelativeUrl = !$url->startsWith('http://') && !$url->startsWith('https://');
+
+ return $isSymfonyUrl || $isRelativeUrl;
+ }
+}
diff --git a/tests/AbstractIntegrationTest.php b/tests/AbstractIntegrationTest.php
deleted file mode 100644
index 0c7819ec..00000000
--- a/tests/AbstractIntegrationTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-remove(__DIR__.'/_output');
-
- return (new BuildConfig())
- ->setSymfonyVersion('4.0')
- ->setContentDir($sourceDir)
- ->disableBuildCache()
- ->setOutputDir(__DIR__.'/_output')
- ;
- }
-}
diff --git a/tests/Command/BuildDocsCommandTest.php b/tests/Command/BuildDocsCommandTest.php
index d1cfaa37..b5e1d057 100644
--- a/tests/Command/BuildDocsCommandTest.php
+++ b/tests/Command/BuildDocsCommandTest.php
@@ -21,6 +21,11 @@
class BuildDocsCommandTest extends TestCase
{
+ protected function setUp(): void
+ {
+ $this->markTestSkipped('Old Doctrine RST based tests');
+ }
+
public function testBuildDocsDefault()
{
$buildConfig = $this->createBuildConfig();
diff --git a/tests/GuidesExtension/Highlighter/SymfonyHighlighterTest.php b/tests/GuidesExtension/Highlighter/SymfonyHighlighterTest.php
new file mode 100644
index 00000000..ce134c54
--- /dev/null
+++ b/tests/GuidesExtension/Highlighter/SymfonyHighlighterTest.php
@@ -0,0 +1,54 @@
+
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace SymfonyTools\DocsBuilder\Tests\GuidesExtension\Highlighter;
+
+use Highlight\Highlighter;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\TestCase;
+use Psr\Log\NullLogger;
+use SymfonyTools\DocsBuilder\GuidesExtension\Highlighter\SymfonyHighlighter;
+use phpDocumentor\Guides\Code\Highlighter\HighlightPhpHighlighter;
+
+class SymfonyHighlighterTest extends TestCase
+{
+ public static function setUpBeforeClass(): void
+ {
+ Highlighter::registerLanguage('php', dirname(__DIR__, 3).'/src/GuidesExtension/resources/highlight.php/php.json', true);
+ Highlighter::registerLanguage('twig', dirname(__DIR__, 3).'/src/GuidesExtension/resources/highlight.php/twig.json', true);
+ }
+
+ #[DataProvider('getRenderingTests')]
+ public function testCustomRendering(string $language, string $inputFile, string $outputFile): void
+ {
+ $highlighter = new SymfonyHighlighter(new HighlightPhpHighlighter(new Highlighter(), new NullLogger()));
+ $actual = $highlighter(
+ $language,
+ file_get_contents(__DIR__.'/fixtures/'.$inputFile),
+ []
+ )->code;
+
+ $this->assertSame(file_get_contents(__DIR__.'/fixtures/'.$outputFile), $actual);
+ }
+
+ public static function getRenderingTests(): iterable
+ {
+ yield 'php' => [
+ 'php',
+ 'php.input.txt',
+ 'php.output.html',
+ ];
+
+ yield 'twig' => [
+ 'twig',
+ 'twig.input.txt',
+ 'twig.output.html',
+ ];
+ }
+}
diff --git a/tests/Templates/fixtures/php.input.txt b/tests/GuidesExtension/Highlighter/fixtures/php.input.txt
similarity index 100%
rename from tests/Templates/fixtures/php.input.txt
rename to tests/GuidesExtension/Highlighter/fixtures/php.input.txt
diff --git a/tests/Templates/fixtures/php.output.html b/tests/GuidesExtension/Highlighter/fixtures/php.output.html
similarity index 100%
rename from tests/Templates/fixtures/php.output.html
rename to tests/GuidesExtension/Highlighter/fixtures/php.output.html
diff --git a/tests/Templates/fixtures/twig.input.txt b/tests/GuidesExtension/Highlighter/fixtures/twig.input.txt
similarity index 100%
rename from tests/Templates/fixtures/twig.input.txt
rename to tests/GuidesExtension/Highlighter/fixtures/twig.input.txt
diff --git a/tests/Templates/fixtures/twig.output.html b/tests/GuidesExtension/Highlighter/fixtures/twig.output.html
similarity index 100%
rename from tests/Templates/fixtures/twig.output.html
rename to tests/GuidesExtension/Highlighter/fixtures/twig.output.html
diff --git a/tests/HtmlIntegrationTest.php b/tests/HtmlIntegrationTest.php
new file mode 100644
index 00000000..efb0e4ef
--- /dev/null
+++ b/tests/HtmlIntegrationTest.php
@@ -0,0 +1,120 @@
+get(DocBuilder::class)->buildString(file_get_contents($sourceFile));
+ $generated = new \DOMDocument();
+ $generated->loadHTML($generatedContents, \LIBXML_NOERROR);
+ $generated->preserveWhiteSpace = false;
+ $generatedHtml = self::sanitizeHTML($generated->saveHTML());
+
+ $expected = new \DOMDocument();
+ $expectedContents = "\n\n\n".$expectedContents."\n\n";
+ $expected->loadHTML($expectedContents, \LIBXML_NOERROR);
+ $expected->preserveWhiteSpace = false;
+ $expectedHtml = self::sanitizeHTML($expected->saveHTML());
+
+ $this->assertEquals($expectedHtml, $generatedHtml);
+ } catch (ExpectationFailedException $e) {
+ if (false !== $skip) {
+ $this->markTestIncomplete($skip);
+ }
+
+ throw $e;
+ }
+
+ $this->assertFalse($skip, 'Test passes while marked as SKIP.');
+ }
+
+ public static function provideBlocks(): iterable
+ {
+ foreach ((new Finder())->files()->in(__DIR__.'/fixtures/source/blocks') as $file) {
+ yield $file->getRelativePathname() => [$file->getRealPath(), __DIR__.'/fixtures/expected/blocks/'.str_replace('.rst', '.html', $file->getRelativePathname())];
+ }
+ }
+
+ #[DataProvider('provideProjects')]
+ public function testProjects(string $directory)
+ {
+ $buildEnvironment = new DynamicBuildEnvironment(new LocalFilesystemAdapter(__DIR__.'/fixtures/source/'.$directory));
+
+ $kernel = DocsKernel::create([new TestExtension()]);
+ $kernel->get(DocBuilder::class)->build($buildEnvironment);
+
+ $expectedDirectory = __DIR__.'/fixtures/expected/'.$directory;
+ $skip = false;
+ if (file_exists($expectedDirectory.'/skip')) {
+ $skip = file_get_contents($expectedDirectory.'/skip');
+ }
+
+ try {
+ foreach ((new Finder())->files()->notName('skip')->in($expectedDirectory) as $file) {
+ $expected = self::sanitizeHTML($file->getContents());
+ $actual = self::sanitizeHTML($buildEnvironment->getOutputFilesystem()->read($file->getRelativePathname()));
+
+ $this->assertEquals($expected, $actual, 'File: '.$file->getRelativePathname());
+ }
+ } catch (ExpectationFailedException $e) {
+ if (false !== $skip) {
+ $this->markTestIncomplete($skip);
+ }
+
+ throw $e;
+ }
+
+ $this->assertFalse($skip, 'Test passes while marked as SKIP.');
+ }
+
+ public static function provideProjects(): iterable
+ {
+ foreach ((new Finder())->directories()->in(__DIR__.'/fixtures/source')->exclude(['build-pdf', 'json'])->depth(0) as $dir) {
+ if ('blocks' === $dir->getBasename()) {
+ continue;
+ }
+
+ yield $dir->getBasename() => [$dir->getBasename()];
+ }
+ }
+
+ private static function sanitizeHTML(string $html): string
+ {
+ $html = implode("\n", array_map('trim', explode("\n", $html)));
+ $html = preg_replace('# +#', ' ', $html);
+ $html = preg_replace('#(? (?!\w)#', '>', $html);
+ $html = preg_replace('#\R+#', "\n", $html);
+
+ $html = substr($html, strpos($html, '') + 6);
+ $html = substr($html, 0, strpos($html, ''));
+
+ return trim($html);
+ }
+}
diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php
deleted file mode 100644
index 07f37338..00000000
--- a/tests/IntegrationTest.php
+++ /dev/null
@@ -1,375 +0,0 @@
-
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace SymfonyDocsBuilder\Tests;
-
-use Doctrine\RST\Builder;
-use Doctrine\RST\Configuration;
-use Doctrine\RST\Parser;
-use Gajus\Dindent\Indenter;
-use Symfony\Component\DomCrawler\Crawler;
-use Symfony\Component\Finder\Finder;
-use SymfonyDocsBuilder\DocBuilder;
-use SymfonyDocsBuilder\KernelFactory;
-use SymfonyDocsBuilder\Renderers\TitleNodeRenderer;
-
-class IntegrationTest extends AbstractIntegrationTest
-{
- /**
- * @dataProvider integrationProvider
- */
- public function testIntegration(string $folder)
- {
- $buildConfig = $this->createBuildConfig(sprintf('%s/fixtures/source/%s', __DIR__, $folder));
- $builder = new DocBuilder();
- $builder->build($buildConfig);
-
- $finder = new Finder();
- $finder->in(sprintf('%s/fixtures/expected/%s', __DIR__, $folder))
- ->files()
- ->depth('>=0');
-
- $indenter = $this->createIndenter();
- foreach ($finder as $expectedFile) {
- $relativePath = $expectedFile->getRelativePathname();
- $actualFilename = $buildConfig->getOutputDir().'/'.$relativePath;
- $this->assertFileExists($actualFilename);
-
- $this->assertSame(
- // removes odd trailing space the indenter is adding
- str_replace(" \n", "\n", $indenter->indent($expectedFile->getContents())),
- str_replace(" \n", "\n", $indenter->indent(file_get_contents($actualFilename))),
- sprintf('File %s is not equal', $relativePath)
- );
- }
-
- foreach ($finder as $htmlFile) {
- $relativePath = $htmlFile->getRelativePathname();
- $actualFilename = $buildConfig->getOutputDir().'/'.str_replace('.html', '.fjson', $relativePath);
- $this->assertFileExists($actualFilename);
-
- $jsonData = json_decode(file_get_contents($actualFilename), true);
- $crawler = new Crawler($htmlFile->getContents());
-
- $this->assertSame(
- str_replace(" \n", "\n", $indenter->indent($crawler->filter('body')->html())),
- str_replace(" \n", "\n", $indenter->indent($jsonData['body']))
- );
- $this->assertSame($crawler->filter('h1')->first()->text(), $jsonData['title']);
- }
- }
-
- public function integrationProvider()
- {
- yield 'main' => [
- 'folder' => 'main',
- ];
-
- yield 'toctree' => [
- 'folder' => 'toctree',
- ];
-
- yield 'ref-reference' => [
- 'folder' => 'ref-reference',
- ];
-
- yield 'doc-reference' => [
- 'folder' => 'doc-reference',
- ];
- }
-
- /**
- * @dataProvider parserUnitBlockProvider
- */
- public function testParseUnitBlock(string $blockName)
- {
- $configuration = new Configuration();
- $configuration->setCustomTemplateDirs([__DIR__.'/Templates']);
-
- $kernel = KernelFactory::createKernel($this->createBuildConfig(sprintf('%s/fixtures/source/blocks', __DIR__)));
- // necessary because this initializes some listeners on the kernel
- $builder = new Builder($kernel);
- $parser = new Parser($kernel);
-
- $sourceFile = sprintf('%s/fixtures/source/blocks/%s.rst', __DIR__, $blockName);
-
- $actualHtml = $parser->parseFile($sourceFile)->renderDocument();
- $expectedHtml = file_get_contents(sprintf('%s/fixtures/expected/blocks/%s.html', __DIR__, $blockName));
- if (false === stripos($expectedHtml, ''.$expectedHtml.'';
- }
-
- $actualCrawler = new Crawler($actualHtml);
- $expectedCrawler = new Crawler($expectedHtml);
- $indenter = $this->createIndenter();
-
- $expected = trim($expectedCrawler->filter('body')->html());
- // you can add notes to a test file via
- // we remove them here for comparing
- $expected = preg_replace('/<\!\-\- REMOVE(.)+\-\->/', '', $expected);
-
- $this->assertSame(
- $this->normalize($indenter->indent($expected)),
- $this->normalize($indenter->indent(trim($actualCrawler->filter('body')->html())))
- );
- }
-
- public function parserUnitBlockProvider()
- {
- yield 'tables' => [
- 'blockName' => 'nodes/tables',
- ];
-
- yield 'literal' => [
- 'blockName' => 'nodes/literal',
- ];
-
- yield 'list' => [
- 'blockName' => 'nodes/list',
- ];
-
- yield 'figure' => [
- 'blockName' => 'nodes/figure',
- ];
-
- yield 'span-link' => [
- 'blockName' => 'nodes/span-link',
- ];
-
- yield 'text' => [
- 'blockName' => 'nodes/text',
- ];
-
- yield 'title' => [
- 'blockName' => 'nodes/title',
- ];
-
- yield 'caution' => [
- 'blockName' => 'directives/caution',
- ];
-
- yield 'note' => [
- 'blockName' => 'directives/note',
- ];
-
- yield 'admonition' => [
- 'blockName' => 'directives/admonition',
- ];
-
- yield 'danger' => [
- 'blockName' => 'directives/danger',
- ];
-
- yield 'note-code-block-nested' => [
- 'blockName' => 'directives/note-code-block-nested',
- ];
-
- yield 'screencast' => [
- 'blockName' => 'directives/screencast',
- ];
-
- yield 'seealso' => [
- 'blockName' => 'directives/seealso',
- ];
-
- yield 'tip' => [
- 'blockName' => 'directives/tip',
- ];
-
- yield 'topic' => [
- 'blockName' => 'directives/topic',
- ];
-
- yield 'best-practice' => [
- 'blockName' => 'directives/best-practice',
- ];
-
- yield 'deprecated' => [
- 'blockName' => 'directives/deprecated',
- ];
-
- yield 'versionadded' => [
- 'blockName' => 'directives/versionadded',
- ];
-
- yield 'class' => [
- 'blockName' => 'directives/class',
- ];
-
- yield 'configuration-block' => [
- 'blockName' => 'directives/configuration-block',
- ];
-
- yield 'sidebar' => [
- 'blockName' => 'directives/sidebar',
- ];
-
- yield 'sidebar-code-block-nested' => [
- 'blockName' => 'directives/sidebar-code-block-nested',
- ];
-
- yield 'tabs' => [
- 'blockName' => 'directives/tabs',
- ];
-
- yield 'class-reference' => [
- 'blockName' => 'references/class',
- ];
-
- yield 'namespace-reference' => [
- 'blockName' => 'references/namespace',
- ];
-
- yield 'method-reference' => [
- 'blockName' => 'references/method',
- ];
-
- yield 'php-class-reference' => [
- 'blockName' => 'references/php-class',
- ];
-
- yield 'php-function-reference' => [
- 'blockName' => 'references/php-function',
- ];
-
- yield 'php-method-reference' => [
- 'blockName' => 'references/php-method',
- ];
-
- yield 'reference-and-code' => [
- 'blockName' => 'references/reference-and-code',
- ];
-
- yield 'code-block-caption' => [
- 'blockName' => 'code-blocks/code-caption',
- ];
-
- yield 'code-block-php' => [
- 'blockName' => 'code-blocks/php',
- ];
-
- yield 'code-block-html' => [
- 'blockName' => 'code-blocks/html',
- ];
-
- yield 'code-block-twig' => [
- 'blockName' => 'code-blocks/twig',
- ];
-
- yield 'code-block-html-twig' => [
- 'blockName' => 'code-blocks/html-twig',
- ];
-
- yield 'code-block-xml' => [
- 'blockName' => 'code-blocks/xml',
- ];
-
- yield 'code-block-yaml' => [
- 'blockName' => 'code-blocks/yaml',
- ];
-
- yield 'code-block-ini' => [
- 'blockName' => 'code-blocks/ini',
- ];
-
- yield 'code-block-bash' => [
- 'blockName' => 'code-blocks/bash',
- ];
-
- yield 'code-block-diff' => [
- 'blockName' => 'code-blocks/diff',
- ];
-
- yield 'code-block-html-php' => [
- 'blockName' => 'code-blocks/html-php',
- ];
-
- yield 'code-block-php-annotations' => [
- 'blockName' => 'code-blocks/php-annotations',
- ];
-
- yield 'code-block-php-attributes' => [
- 'blockName' => 'code-blocks/php-attributes',
- ];
-
- yield 'code-block-php-nested-comments' => [
- 'blockName' => 'code-blocks/php-nested-comments',
- ];
-
- yield 'code-block-text' => [
- 'blockName' => 'code-blocks/text',
- ];
-
- yield 'code-block-terminal' => [
- 'blockName' => 'code-blocks/terminal',
- ];
- }
-
- public function testParseString()
- {
- $rstString = <<`_ consequat.
-Duis aute irure dolor in reprehenderit in voluptate `velit esse`_.
-
-Cillum dolore eu fugiat nulla pariatur
---------------------------------------
-
-Excepteur sint occaecat cupidatat non proident, sunt in
-culpa qui *officia deserunt* mollit anim id est laborum.
-
-.. _`velit esse`: https://github.com
-RST;
-
- $htmlString = <<
-Lorem ipsum dolor sit amet
-Consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-
- - Ut enim ad minim veniam
-- Quis nostrud exercitation
-- Ullamco laboris nisi ut
-
-Aliquip ex ea commodo consequat.
-Duis aute irure dolor in reprehenderit in voluptate velit esse.
-
-Cillum dolore eu fugiat nulla pariatur
-Excepteur sint occaecat cupidatat non proident, sunt in
-culpa qui officia deserunt mollit anim id est laborum.
-
-
-HTML;
-
- $this->assertSame($htmlString, (new DocBuilder())->buildString($rstString)->getStringResult());
- }
-
- private function normalize(string $str): string
- {
- return preg_replace('/\s+$/m', '', $str);
- }
-
- private function createIndenter(): Indenter
- {
- $indenter = new Indenter();
- // indent spans - easier to debug failures
- $indenter->setElementType('span', Indenter::ELEMENT_TYPE_BLOCK);
-
- return $indenter;
- }
-}
diff --git a/tests/JsonIntegrationTest.php b/tests/JsonIntegrationTest.php
index b9ab0924..802edbc9 100644
--- a/tests/JsonIntegrationTest.php
+++ b/tests/JsonIntegrationTest.php
@@ -1,41 +1,40 @@
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
+namespace SymfonyTools\DocsBuilder\GuidesExtension\Tests;
-namespace SymfonyDocsBuilder\Tests;
+use League\Flysystem\Local\LocalFilesystemAdapter;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\TestCase;
+use SymfonyTools\DocsBuilder\GuidesExtension\Build\BuildConfig;
+use SymfonyTools\DocsBuilder\GuidesExtension\Build\DynamicBuildEnvironment;
+use SymfonyTools\DocsBuilder\GuidesExtension\DocBuilder;
+use SymfonyTools\DocsBuilder\GuidesExtension\DocsKernel;
+use phpDocumentor\Guides\DependencyInjection\TestExtension;
-use SymfonyDocsBuilder\DocBuilder;
-use SymfonyDocsBuilder\Renderers\TitleNodeRenderer;
-
-class JsonIntegrationTest extends AbstractIntegrationTest
+class JsonIntegrationTest extends TestCase
{
- /**
- * @dataProvider getJsonTests
- */
+ #[DataProvider('getJsonTests')]
public function testJsonGeneration(string $filename, array $expectedData)
{
- $buildConfig = $this->createBuildConfig(__DIR__ . '/fixtures/source/json');
- $builder = new DocBuilder();
- $buildResult = $builder->build($buildConfig);
- $fJsons = $buildResult->getJsonResults();
+ $kernel = DocsKernel::create([new TestExtension()]);
+
+ $kernel->get(BuildConfig::class)->outputFormat = 'json';
- $actualFileData = $fJsons[$filename];
+ $buildEnvironment = new DynamicBuildEnvironment(new LocalFilesystemAdapter(__DIR__.'/fixtures/source/json'));
+ $kernel->get(DocBuilder::class)->build($buildEnvironment);
+
+ $actualFileData = json_decode($buildEnvironment->getOutputFilesystem()->read($filename.'.fjson'), true);
+ $this->assertSame($expectedData, array_intersect_key($actualFileData, $expectedData), sprintf('Invalid data in file "%s"', $filename));
foreach ($expectedData as $key => $expectedKeyData) {
$this->assertArrayHasKey($key, $actualFileData, sprintf('Missing key "%s" in file "%s"', $key, $filename));
- $this->assertSame($expectedKeyData, $actualFileData[$key], sprintf('Invalid data for key "%s" in file "%s"', $key, $filename));
}
}
- public function getJsonTests()
+ public static function getJsonTests()
{
yield 'index' => [
- 'file' => 'index',
- 'data' => [
+ 'filename' => 'index',
+ 'expectedData' => [
'parents' => [],
'prev' => null,
'next' => [
@@ -47,8 +46,8 @@ public function getJsonTests()
];
yield 'dashboards' => [
- 'file' => 'dashboards',
- 'data' => [
+ 'filename' => 'dashboards',
+ 'expectedData' => [
'parents' => [],
'prev' => [
'title' => 'JSON Generation Test',
@@ -63,8 +62,8 @@ public function getJsonTests()
];
yield 'design' => [
- 'file' => 'design',
- 'data' => [
+ 'filename' => 'design',
+ 'expectedData' => [
'parents' => [],
'prev' => [
'title' => 'Dashboards',
@@ -128,54 +127,41 @@ public function getJsonTests()
];
yield 'crud' => [
- 'file' => 'crud',
- 'data' => [
- 'parents' => [
- [
- 'title' => 'Design',
- 'link' => 'design.html',
- ],
- ],
+ 'filename' => 'crud',
+ 'expectedData' => [
+ 'parents' => [],
'prev' => [
'title' => 'Design',
'link' => 'design.html',
],
'next' => [
- 'title' => 'Design Sub-Page',
- 'link' => 'design/sub-page.html',
+ 'title' => 'Fields',
+ 'link' => 'fields.html',
],
'title' => 'CRUD',
]
];
yield 'design/sub-page' => [
- 'file' => 'design/sub-page',
- 'data' => [
+ 'filename' => 'design/sub-page',
+ 'expectedData' => [
'parents' => [
[
'title' => 'Design',
'link' => '../design.html',
],
],
- 'prev' => [
- 'title' => 'CRUD',
- 'link' => '../crud.html',
- ],
- 'next' => [
- 'title' => 'Fields',
- 'link' => '../fields.html',
- ],
'title' => 'Design Sub-Page',
]
];
yield 'fields' => [
- 'file' => 'fields',
- 'data' => [
+ 'filename' => 'fields',
+ 'expectedData' => [
'parents' => [],
'prev' => [
- 'title' => 'Design Sub-Page',
- 'link' => 'design/sub-page.html',
+ 'title' => 'CRUD',
+ 'link' => 'crud.html',
],
'next' => null,
'title' => 'Fields',
@@ -183,8 +169,8 @@ public function getJsonTests()
];
yield 'orphan' => [
- 'file' => 'orphan',
- 'data' => [
+ 'filename' => 'orphan',
+ 'expectedData' => [
'parents' => [],
'prev' => null,
'next' => null,
diff --git a/tests/Renderers/CodeNodeRendererTest.php b/tests/Renderers/CodeNodeRendererTest.php
index 1606463b..b79274d6 100644
--- a/tests/Renderers/CodeNodeRendererTest.php
+++ b/tests/Renderers/CodeNodeRendererTest.php
@@ -14,6 +14,11 @@
class CodeNodeRendererTest extends TestCase
{
+ protected function setUp(): void
+ {
+ $this->markTestSkipped('Old Doctrine RST based tests');
+ }
+
/**
* @dataProvider getSupportedLanguageTests
*/
diff --git a/tests/Templates/HighlightJsIntegrationTest.php b/tests/Templates/HighlightJsIntegrationTest.php
deleted file mode 100644
index 0e25a815..00000000
--- a/tests/Templates/HighlightJsIntegrationTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace SymfonyDocsBuilder\Tests\Templates;
-
-use Highlight\Highlighter;
-use PHPUnit\Framework\TestCase;
-
-class HighlightJsIntegrationTest extends TestCase
-{
- public static function setUpBeforeClass(): void
- {
- Highlighter::registerLanguage('php', __DIR__.'/../../src/Templates/highlight.php/php.json', true);
- Highlighter::registerLanguage('twig', __DIR__.'/../../src/Templates/highlight.php/twig.json', true);
- }
-
- /**
- * @dataProvider getRenderingTests
- */
- public function testCustomRendering(string $language, string $inputFile, string $outputFile)
- {
- $highlighter = new Highlighter();
- $actual = $highlighter->highlight(
- $language,
- file_get_contents(__DIR__.'/fixtures/'.$inputFile)
- )->value;
-
- $this->assertSame(file_get_contents(__DIR__.'/fixtures/'.$outputFile), $actual);
- }
-
- public function getRenderingTests()
- {
- yield 'php' => [
- 'php',
- 'php.input.txt',
- 'php.output.html',
- ];
-
- yield 'twig' => [
- 'twig',
- 'twig.input.txt',
- 'twig.output.html',
- ];
- }
-}
diff --git a/tests/fixtures/expected/blocks/code-blocks/code-caption.html b/tests/fixtures/expected/blocks/code-blocks/code-caption.html
index a4eaf9d7..24d5b798 100644
--- a/tests/fixtures/expected/blocks/code-blocks/code-caption.html
+++ b/tests/fixtures/expected/blocks/code-blocks/code-caption.html
@@ -2,14 +2,7 @@
config/routes.php
1
-
-
-
- $
- foo
- =
- 'bar';
-
+ $foo = 'bar';
@@ -17,28 +10,18 @@
config/routes.php
1
-
-
-
- $
- foo
- =
- 'bar';
-
+ $foo = 'bar';
-
-
- 1
+
+ patch_file
+
+ 1
2
3
-
-
- --- a/src/Controller/DefaultController.php
+ --- a/src/Controller/DefaultController.php
+++ b/src/Controller/DefaultController.php
- @@ -2,7 +2,9 @@
-
-
+ @@ -2,7 +2,9 @@
diff --git a/tests/fixtures/expected/blocks/code-blocks/diff.html b/tests/fixtures/expected/blocks/code-blocks/diff.html
index 0a020cf4..f00f497a 100644
--- a/tests/fixtures/expected/blocks/code-blocks/diff.html
+++ b/tests/fixtures/expected/blocks/code-blocks/diff.html
@@ -5,15 +5,11 @@
3
4
5
-
-
- + Added line
- - Removed line
- Normal line
-- Removed line
- + Added line
-
-
+ + Added line
+ - Removed line
+ Normal line
+ - Removed line
+ + Added line
@@ -25,15 +21,11 @@
4
5
6
-
-
- Normal line
-+ Added line
- - Removed line
- Normal line
-- Removed line
- + Added line
-
-
+ Normal line
+ + Added line
+ - Removed line
+ Normal line
+ - Removed line
+ + Added line
diff --git a/tests/fixtures/expected/blocks/code-blocks/html-php.html b/tests/fixtures/expected/blocks/code-blocks/html-php.html
index d77a92ef..e7b564e0 100644
--- a/tests/fixtures/expected/blocks/code-blocks/html-php.html
+++ b/tests/fixtures/expected/blocks/code-blocks/html-php.html
@@ -1,4 +1,4 @@
-
+
1
2
@@ -23,6 +23,5 @@
<body>
<?php echo 'body'; ?>
</body>
-</html>
-
+</html>
diff --git a/tests/fixtures/expected/blocks/code-blocks/html-twig.html b/tests/fixtures/expected/blocks/code-blocks/html-twig.html
index dbe31018..6e17a7d9 100644
--- a/tests/fixtures/expected/blocks/code-blocks/html-twig.html
+++ b/tests/fixtures/expected/blocks/code-blocks/html-twig.html
@@ -3,7 +3,6 @@
1
2
{# some code #}
-<!-- some code -->
-
+<!-- some code -->
diff --git a/tests/fixtures/expected/blocks/code-blocks/html.html b/tests/fixtures/expected/blocks/code-blocks/html.html
index f35e7e3e..09d9b41d 100644
--- a/tests/fixtures/expected/blocks/code-blocks/html.html
+++ b/tests/fixtures/expected/blocks/code-blocks/html.html
@@ -1,6 +1,5 @@
-
+
1
- <!-- some code -->
-
+ <!-- some code -->
diff --git a/tests/fixtures/expected/blocks/code-blocks/php-attributes.html b/tests/fixtures/expected/blocks/code-blocks/php-attributes.html
index 1d6bce0b..d6f7135b 100644
--- a/tests/fixtures/expected/blocks/code-blocks/php-attributes.html
+++ b/tests/fixtures/expected/blocks/code-blocks/php-attributes.html
@@ -65,97 +65,70 @@
63
64
65
-
-
- // src/SomePath/SomeClass.php
+// src/SomePath/SomeClass.php
namespace App\SomePath;
- useSymfony\Component\Validator\Constraints as Assert;
-
- class
- SomeClass
-
- {
- #[AttributeName]
- private
-
- $ property1
- ;
- #[AttributeName()]
- private
-
- $ property2
- ;
- #[AttributeName('value')]
- private
-
- $ property3
- ;
- #[AttributeName('value', option: 'value')]
- private
-
- $ property4
- ;
- #[AttributeName(['value' => 'value'])]
- private
-
- $ property5
- ;
- #[AttributeName(
- 'value',
- option: 'value'
- )]
- private
-
- $ property6
- ;
- #[Assert\AttributeName('value')]
- private
-
- $ property7
- ;
- #[Assert\AttributeName(
- 'value',
- option: 'value'
- )]
- private
-
- $ property8
- ;
- #[Route('/blog/{page<\d+>}', name: 'blog_list')]
- private
-
- $ property9
- ;
- #[Assert\GreaterThanOrEqual(
- value: 18,
- )]
- private
-
- $ property10
- ;
- #[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
- private
-
- $ property11
- ;
- #[Assert\AtLeastOneOf([
- new Assert\Regex('/#/'),
- new Assert\Length(min: 10),
- ])]
- private
-
- $ property12
- ;
- public function __construct(
- #[TaggedIterator('app.handlers')]
- iterable $handlers,
- ){
- }
- #[AsController]
- public functionsomeAction(#[CurrentUser, AttributeName('value')] User $user)
- {
- }
+useSymfony\Component\Validator\Constraints as Assert;
+
+classSomeClass
+{
+ #[AttributeName]
+ private $property1;
+
+ #[AttributeName()]
+ private $property2;
+
+ #[AttributeName('value')]
+ private $property3;
+
+ #[AttributeName('value', option: 'value')]
+ private $property4;
+
+ #[AttributeName(['value' => 'value'])]
+ private $property5;
+
+ #[AttributeName(
+ 'value',
+ option: 'value'
+ )]
+ private $property6;
+
+ #[Assert\AttributeName('value')]
+ private $property7;
+
+ #[Assert\AttributeName(
+ 'value',
+ option: 'value'
+ )]
+ private $property8;
+
+ #[Route('/blog/{page<\d+>}', name: 'blog_list')]
+ private $property9;
+
+ #[Assert\GreaterThanOrEqual(
+ value: 18,
+ )]
+ private $property10;
+
+ #[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
+ private $property11;
+
+ #[Assert\AtLeastOneOf([
+ new Assert\Regex('/#/'),
+ new Assert\Length(min: 10),
+ ])]
+ private $property12;
+
+ public function __construct(
+ #[TaggedIterator('app.handlers')]
+ iterable $handlers,
+ ){
+ }
+
+ #[AsController]
+ public functionsomeAction(#[CurrentUser, AttributeName('value')] User $user)
+ {
+ }
}
diff --git a/tests/fixtures/expected/blocks/code-blocks/php-nested-comments.html b/tests/fixtures/expected/blocks/code-blocks/php-nested-comments.html
index e1f7078f..ee55b522 100644
--- a/tests/fixtures/expected/blocks/code-blocks/php-nested-comments.html
+++ b/tests/fixtures/expected/blocks/code-blocks/php-nested-comments.html
@@ -11,62 +11,15 @@
8
9
10
-
-
- use
- Symfony
- \
- Component
- \
- Messenger
- \
- MessageBusInterface
- ;
- use
- Symfony
- \
- Component
- \
- Messenger
- \
- Stamp
- \
- DelayStamp
- ;
- public
-
- function
- index
-
- (MessageBusInterface
-
- $
- bus
-
- )
-
-
- {
-
- $
- bus
-
- ->
- dispatch
- (
- new
- SmsNotification
- (
- '...'
- ), [
- // wait 5 seconds before processing
- new
- DelayStamp
- (
- 5000
- ), ]);
-}
-
-
+ use Symfony\Component\Messenger\MessageBusInterface;
+use Symfony\Component\Messenger\Stamp\DelayStamp;
+
+public function index(MessageBusInterface $bus)
+{
+ $bus->dispatch(new SmsNotification('...'), [
+ // wait 5 seconds before processing
+ new DelayStamp(5000),
+ ]);
+}
diff --git a/tests/fixtures/expected/blocks/code-blocks/php.html b/tests/fixtures/expected/blocks/code-blocks/php.html
index 163de59a..71e79f0f 100644
--- a/tests/fixtures/expected/blocks/code-blocks/php.html
+++ b/tests/fixtures/expected/blocks/code-blocks/php.html
@@ -12,9 +12,9 @@
// config/routes.php
namespace Symfony\Component\Routing\Loader\Configurator;
- use App\Controller\CompanyController;
+use App\Controller\CompanyController;
-return static function (RoutingConfigurator $routes): void {
+return static function (RoutingConfigurator $routes):void {
$routes->add('about_us', ['nl' => '/over-ons', 'en' => '/about-us'])
->controller(CompanyController::class.'::about');
};
@@ -38,15 +38,14 @@
14
15
16
-
-enum TextAlign: string implements TranslatableInterface
-{
+ enum TextAlign: string implements TranslatableInterface
+{
case Left = 'Left aligned';
case Center = 'Center aligned';
case Right = 'Right aligned';
- public function trans(TranslatorInterface $translator, ?string $locale = null): string
- {
+ public function trans(TranslatorInterface $translator, ?string $locale = null): string
+ {
// Translate enum using custom labels
return match ($this) {
self::Left => $translator->trans('text_align.left.label', locale: $locale),
@@ -54,9 +53,7 @@
self::Right => $translator->trans('text_align.right.label', locale: $locale),
};
}
-}
-
-
+}
@@ -77,9 +74,8 @@
14
15
16
-
-public function getUserBadgeFrom(string $accessToken): UserBadge
-{
+ public function getUserBadgeFrom(string $accessToken): UserBadge
+{
// get the data from the token
$payload = ...;
@@ -93,8 +89,7 @@
$payload->getUserId(),
$this->loadUser(...)
);
-}
-
+}
@@ -103,11 +98,9 @@
2
3
4
-
-public function __construct(
+ public function __construct(
private string $username
) {
-}
-
+}
diff --git a/tests/fixtures/expected/blocks/code-blocks/terminal.html b/tests/fixtures/expected/blocks/code-blocks/terminal.html
index 4567fdb7..548e3078 100644
--- a/tests/fixtures/expected/blocks/code-blocks/terminal.html
+++ b/tests/fixtures/expected/blocks/code-blocks/terminal.html
@@ -1,22 +1,15 @@
1
- git clone git@github.com:symfony/symfony.git
+ git clone git@github.com:symfony/symfony.git
1
2
-
-
- $ cowsay
- 'eat more chicken'
- $ cowsay
- 'mmmm'
-
-
+ $ cowsay 'eat more chicken'
+ $ cowsay 'mmmm'
@@ -25,24 +18,14 @@
1
2
3
-
-
- C:\> CIV
- # Civilization for DOS - my first computer game!
-
-
+ C:\> CIV
+ # Civilization for DOS - my first computer game!
diff --git a/tests/fixtures/expected/blocks/code-blocks/twig.html b/tests/fixtures/expected/blocks/code-blocks/twig.html
index 83c841cf..31404752 100644
--- a/tests/fixtures/expected/blocks/code-blocks/twig.html
+++ b/tests/fixtures/expected/blocks/code-blocks/twig.html
@@ -9,22 +9,14 @@
7
8
9
-
-
- {# some code #}
-
-
- {%
- set some_var = 'some value' # some inline comment
- %}
-
-
- {{
- # another inline comment
- 'Lorem Ipsum'|uppercase
- # final inline comment
- }}
-
-
+ {# some code #}
+{%
+ set some_var = 'some value' # some inline comment
+%}
+{{
+ # another inline comment
+ 'Lorem Ipsum'|uppercase
+ # final inline comment
+}}
diff --git a/tests/fixtures/expected/blocks/code-blocks/xml.html b/tests/fixtures/expected/blocks/code-blocks/xml.html
index 47722577..02ffe4e8 100644
--- a/tests/fixtures/expected/blocks/code-blocks/xml.html
+++ b/tests/fixtures/expected/blocks/code-blocks/xml.html
@@ -1,7 +1,6 @@
1
- <!-- some code -->
-
+ <!-- some code -->
diff --git a/tests/fixtures/expected/blocks/code-blocks/yaml.html b/tests/fixtures/expected/blocks/code-blocks/yaml.html
index 2de3b7b2..02e1a86f 100644
--- a/tests/fixtures/expected/blocks/code-blocks/yaml.html
+++ b/tests/fixtures/expected/blocks/code-blocks/yaml.html
@@ -10,27 +10,15 @@
8
9
10
-
-
- # some code
- parameters:
- credit_card_number:
- 1234_5678_9012_3456
- long_number:
- 10_000_000_000
- pi:
- 3.14159_26535_89793
- hex_words:
- 0x_CAFE_F00D
- canonical:
- 2001-12-15T02:59:43.1Z
- iso8601:
- 2001-12-14t21:59:43.10-05:00
- spaced:
- 2001-12-14 21:59:43.10 -5
- date:
- 2002-12-14
-
-
+# some code
+parameters:
+ credit_card_number: 1234_5678_9012_3456
+ long_number: 10_000_000_000
+ pi: 3.14159_26535_89793
+ hex_words: 0x_CAFE_F00D
+ canonical: 2001-12-15T02:59:43.1Z
+ iso8601: 2001-12-14t21:59:43.10-05:00
+ spaced: 2001-12-14 21:59:43.10 -5
+ date: 2002-12-14
diff --git a/tests/fixtures/expected/blocks/directives/admonition.html b/tests/fixtures/expected/blocks/directives/admonition.html
index f8f22804..ebdef057 100644
--- a/tests/fixtures/expected/blocks/directives/admonition.html
+++ b/tests/fixtures/expected/blocks/directives/admonition.html
@@ -1,5 +1,6 @@
-
+
Some Admonition
-
Do you prefer admonitions? Well then... enjoy this one!
+
+ Do you prefer admonitions? Well then... enjoy this one!
diff --git a/tests/fixtures/expected/blocks/directives/best-practice.html b/tests/fixtures/expected/blocks/directives/best-practice.html
index a23604d2..cb2bfdb8 100644
--- a/tests/fixtures/expected/blocks/directives/best-practice.html
+++ b/tests/fixtures/expected/blocks/directives/best-practice.html
@@ -1,5 +1,6 @@
-
+
Best Practice
-
Use the bcrypt encoder for hashing your users' passwords.
+
+ Use the bcrypt encoder for hashing your users' passwords.
diff --git a/tests/fixtures/expected/blocks/directives/caution.html b/tests/fixtures/expected/blocks/directives/caution.html
index 717c09f2..09712a67 100644
--- a/tests/fixtures/expected/blocks/directives/caution.html
+++ b/tests/fixtures/expected/blocks/directives/caution.html
@@ -1,6 +1,7 @@
-
+
Caution
-
Using too many sidebars or caution directives can be distracting!
+
+ Using too many sidebars or caution directives can be distracting!
diff --git a/tests/fixtures/expected/blocks/directives/class.html b/tests/fixtures/expected/blocks/directives/class.html
index 22c16352..9d8466c9 100644
--- a/tests/fixtures/expected/blocks/directives/class.html
+++ b/tests/fixtures/expected/blocks/directives/class.html
@@ -1,6 +1,7 @@
-- list-item-1
-- list-item-2
-- list-item-3
+
+ - list-item-1
+ - list-item-2
+ - list-item-3
some text
diff --git a/tests/fixtures/expected/blocks/directives/configuration-block.html b/tests/fixtures/expected/blocks/directives/configuration-block.html
index 4b940ce5..aa101992 100644
--- a/tests/fixtures/expected/blocks/directives/configuration-block.html
+++ b/tests/fixtures/expected/blocks/directives/configuration-block.html
@@ -1,10 +1,14 @@
-
-
+
+
-
+
1
@@ -13,7 +17,7 @@
-