diff --git a/src/Directive/ScreencastDirective.php b/src/Directive/ScreencastDirective.php new file mode 100644 index 0000000..cd2a795 --- /dev/null +++ b/src/Directive/ScreencastDirective.php @@ -0,0 +1,18 @@ + + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SymfonyDocsBuilder\Directive; + +class ScreencastDirective extends AbstractAdmonitionDirective +{ + public function __construct() + { + parent::__construct('screencast', 'Screencast'); + } +} diff --git a/src/KernelFactory.php b/src/KernelFactory.php index 14cef5f..ce99fcd 100644 --- a/src/KernelFactory.php +++ b/src/KernelFactory.php @@ -86,6 +86,7 @@ private static function getDirectives(): array new SymfonyDirectives\RoleDirective(), new SymfonyDirectives\NoteDirective(), new SymfonyDirectives\RstClassDirective(new ClassDirective()), + new SymfonyDirectives\ScreencastDirective(), new SymfonyDirectives\SeeAlsoDirective(), new SymfonyDirectives\SidebarDirective(), new SymfonyDirectives\TipDirective(), diff --git a/src/Templates/default/html/directives/admonition.html.twig b/src/Templates/default/html/directives/admonition.html.twig index 9913be3..485e3b9 100644 --- a/src/Templates/default/html/directives/admonition.html.twig +++ b/src/Templates/default/html/directives/admonition.html.twig @@ -13,6 +13,8 @@ {% elseif name in ['seealso'] %} + {% elseif name in ['screencast'] %} + {% endif %} {{ text }}

diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 7bf7737..5b47034 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -148,6 +148,10 @@ public function parserUnitBlockProvider() 'blockName' => 'directives/note-code-block-nested', ]; + yield 'screencast' => [ + 'blockName' => 'directives/screencast', + ]; + yield 'seealso' => [ 'blockName' => 'directives/seealso', ]; diff --git a/tests/fixtures/expected/blocks/directives/screencast.html b/tests/fixtures/expected/blocks/directives/screencast.html new file mode 100644 index 0000000..eddd89d --- /dev/null +++ b/tests/fixtures/expected/blocks/directives/screencast.html @@ -0,0 +1,11 @@ +
+

+ + + + Screencast +

+

Do you prefer video tutorials? Check out the +Stellar Development with Symfony +screencast series.

+
diff --git a/tests/fixtures/source/blocks/directives/screencast.rst b/tests/fixtures/source/blocks/directives/screencast.rst new file mode 100644 index 0000000..f44b2fa --- /dev/null +++ b/tests/fixtures/source/blocks/directives/screencast.rst @@ -0,0 +1,5 @@ +.. screencast:: + + Do you prefer video tutorials? Check out the + `Stellar Development with Symfony `_ + screencast series.