Skip to content

Commit d2e44be

Browse files
committed
Add the screencast admonition
1 parent 3e4ad95 commit d2e44be

File tree

6 files changed

+41
-0
lines changed

6 files changed

+41
-0
lines changed

src/Directive/ScreencastDirective.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Docs Builder package.
5+
* (c) Ryan Weaver <ryan@symfonycasts.com>
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*/
9+
10+
namespace SymfonyDocsBuilder\Directive;
11+
12+
class ScreencastDirective extends AbstractAdmonitionDirective
13+
{
14+
public function __construct()
15+
{
16+
parent::__construct('screencast', 'Screencast');
17+
}
18+
}

src/KernelFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ private static function getDirectives(): array
8686
new SymfonyDirectives\RoleDirective(),
8787
new SymfonyDirectives\NoteDirective(),
8888
new SymfonyDirectives\RstClassDirective(new ClassDirective()),
89+
new SymfonyDirectives\ScreencastDirective(),
8990
new SymfonyDirectives\SeeAlsoDirective(),
9091
new SymfonyDirectives\SidebarDirective(),
9192
new SymfonyDirectives\TipDirective(),

src/Templates/default/html/directives/admonition.html.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"></path></svg>
1414
{% elseif name in ['seealso'] %}
1515
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" /></svg>
16+
{% elseif name in ['screencast'] %}
17+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>
1618
{% endif %}
1719
<span>{{ text }}</span>
1820
</p>

tests/IntegrationTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ public function parserUnitBlockProvider()
148148
'blockName' => 'directives/note-code-block-nested',
149149
];
150150

151+
yield 'screencast' => [
152+
'blockName' => 'directives/screencast',
153+
];
154+
151155
yield 'seealso' => [
152156
'blockName' => 'directives/seealso',
153157
];
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="admonition admonition-screencast ">
2+
<p class="admonition-title">
3+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewbox="0 0 24 24" stroke="currentColor">
4+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
5+
</svg>
6+
<span>Screencast</span>
7+
</p>
8+
<p>Do you prefer video tutorials? Check out the
9+
<a href="https://symfonycasts.com/screencast/symfony" class="reference external" rel="external noopener noreferrer" target="_blank">Stellar Development with Symfony</a>
10+
screencast series.</p>
11+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. screencast::
2+
3+
Do you prefer video tutorials? Check out the
4+
`Stellar Development with Symfony <https://symfonycasts.com/screencast/symfony>`_
5+
screencast series.

0 commit comments

Comments
 (0)