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 1515use Doctrine \RST \ErrorManager ;
1616use Doctrine \RST \Event \PostBuildRenderEvent ;
1717use Doctrine \RST \Event \PreNodeRenderEvent ;
18+ use Doctrine \RST \Event \PreParseDocumentEvent ;
1819use Doctrine \RST \Kernel ;
20+ use SymfonyDocsBuilder \Listener \AdmonitionListener ;
1921use SymfonyDocsBuilder \Listener \AssetsCopyListener ;
2022use SymfonyDocsBuilder \Listener \CopyImagesListener ;
2123
@@ -42,6 +44,11 @@ public function initBuilder(Builder $builder): void
4244
4345 private function initializeListeners (EventManager $ eventManager , ErrorManager $ errorManager )
4446 {
47+ $ eventManager ->addEventListener (
48+ PreParseDocumentEvent::PRE_PARSE_DOCUMENT ,
49+ new AdmonitionListener ()
50+ );
51+
4552 $ eventManager ->addEventListener (
4653 PreNodeRenderEvent::PRE_NODE_RENDER ,
4754 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 99< a href ="https://symfonycasts.com/screencast/symfony " class ="reference external " rel ="external noopener noreferrer " target ="_blank "> Stellar Development with Symfony</ a >
1010screencast series.</ p >
1111</ 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 33 Do you prefer video tutorials? Check out the
44 `Stellar Development with Symfony <https://symfonycasts.com/screencast/symfony >`_
55 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