File tree Expand file tree Collapse file tree 4 files changed +48
-0
lines changed
expected/blocks/directives Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 15
15
use Doctrine \RST \ErrorManager ;
16
16
use Doctrine \RST \Event \PostBuildRenderEvent ;
17
17
use Doctrine \RST \Event \PreNodeRenderEvent ;
18
+ use Doctrine \RST \Event \PreParseDocumentEvent ;
18
19
use Doctrine \RST \Kernel ;
20
+ use SymfonyDocsBuilder \Listener \AdmonitionListener ;
19
21
use SymfonyDocsBuilder \Listener \AssetsCopyListener ;
20
22
use SymfonyDocsBuilder \Listener \CopyImagesListener ;
21
23
@@ -42,6 +44,11 @@ public function initBuilder(Builder $builder): void
42
44
43
45
private function initializeListeners (EventManager $ eventManager , ErrorManager $ errorManager )
44
46
{
47
+ $ eventManager ->addEventListener (
48
+ PreParseDocumentEvent::PRE_PARSE_DOCUMENT ,
49
+ new AdmonitionListener ()
50
+ );
51
+
45
52
$ eventManager ->addEventListener (
46
53
PreNodeRenderEvent::PRE_NODE_RENDER ,
47
54
new CopyImagesListener ($ this ->buildConfig , $ errorManager )
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ /*
6
+ * This file is part of the Docs Builder package.
7
+ * (c) Ryan Weaver <ryan@symfonycasts.com>
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace SymfonyDocsBuilder \Listener ;
13
+
14
+ use Doctrine \RST \Event \PreParseDocumentEvent ;
15
+
16
+ final class AdmonitionListener
17
+ {
18
+ public function preParseDocument (PreParseDocumentEvent $ event )
19
+ {
20
+ // TODO: remove this temporary fix when Symfony Docs are updated to use the new '.. screencast::' directive
21
+ $ event ->setContents (str_replace ('.. admonition:: Screencast ' , '.. screencast:: ' , $ event ->getContents ()));
22
+ }
23
+ }
Original file line number Diff line number Diff line change 9
9
< a href ="https://symfonycasts.com/screencast/symfony " class ="reference external " rel ="external noopener noreferrer " target ="_blank "> Stellar Development with Symfony</ a >
10
10
screencast series.</ p >
11
11
</ div >
12
+
13
+ < div class ="admonition admonition-screencast ">
14
+ < p class ="admonition-title ">
15
+ < svg xmlns ="http://www.w3.org/2000/svg " fill ="none " width ="24 " height ="24 " viewbox ="0 0 24 24 " stroke ="currentColor ">
16
+ < 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 >
17
+ </ svg >
18
+ < span > Screencast</ span >
19
+ </ p >
20
+ < p > Do you prefer video tutorials? Check out the
21
+ < a href ="https://symfonycasts.com/screencast/symfony " class ="reference external " rel ="external noopener noreferrer " target ="_blank "> Stellar Development with Symfony</ a >
22
+ screencast series.</ p >
23
+ </ div >
Original file line number Diff line number Diff line change 3
3
Do you prefer video tutorials? Check out the
4
4
`Stellar Development with Symfony <https://symfonycasts.com/screencast/symfony >`_
5
5
screencast series.
6
+
7
+ .. admonition :: Screencast
8
+
9
+ Do you prefer video tutorials? Check out the
10
+ `Stellar Development with Symfony <https://symfonycasts.com/screencast/symfony >`_
11
+ screencast series.
You can’t perform that action at this time.
0 commit comments