Skip to content

Commit d6ad66f

Browse files
committed
Apply doctor RST changes
1 parent cbb7e26 commit d6ad66f

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

doc/index.rst

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ For example, to render all of the ``script`` and ``link`` tags for a specific
120120
Assuming that ``entry1`` required two files to be included - ``build/vendor~entry1~entry2.js``
121121
and ``build/entry1.js``, then ``encore_entry_script_tags()`` is equivalent to:
122122

123-
.. code-block:: twig
123+
.. code-block:: html+twig
124124

125125
<script src="{{ asset('build/vendor~entry1~entry2.js') }}"></script>
126126
<script src="{{ asset('build/entry1.js') }}"></script>
@@ -144,12 +144,9 @@ during a single request.
144144

145145
In that case, before each render, you'll need to "reset" the internal
146146
cache so that the bundle re-renders CSS or JS files that it previously
147-
rendered. For example, in a controller:
148-
149-
.. code-block:: php
147+
rendered. For example, in a controller::
150148

151149
// src/Controller/SomeController.php
152-
153150
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupInterface;
154151

155152
class SomeController
@@ -182,9 +179,7 @@ different ways:
182179
1. When rendering in Twig - see the ``attributes`` option in the docs above.
183180

184181
1. By listening to the ``Symfony\WebpackEncoreBundle\Event\RenderAssetTagEvent``
185-
event. For example:
186-
187-
.. code-block:: php
182+
event. For example::
188183

189184
namespace App\EventSubscriber;
190185

@@ -220,7 +215,7 @@ See `stimulus-bridge`_ for more details.
220215

221216
For example:
222217

223-
.. code-block:: twig
218+
.. code-block:: html+twig
224219

225220
<div {{ stimulus_controller('chart', { 'name': 'Likes', 'data': [1, 2, 3, 4] }) }}>
226221
Hello
@@ -237,7 +232,7 @@ For example:
237232

238233
If you want to set CSS classes:
239234

240-
.. code-block:: twig
235+
.. code-block:: html+twig
241236

242237
<div {{ stimulus_controller('chart', { 'name': 'Likes', 'data': [1, 2, 3, 4] }, { 'loading': 'spinner' }) }}>
243238
Hello
@@ -264,7 +259,7 @@ values are properly escaped (the string ``&#x5B;`` is an escaped
264259

265260
If you have multiple controllers on the same element, you can chain them as there's also a ``stimulus_controller`` filter:
266261

267-
.. code-block:: twig
262+
.. code-block:: html+twig
268263

269264
<div {{ stimulus_controller('chart', { 'name': 'Likes' })|stimulus_controller('other-controller') }}>
270265
Hello
@@ -283,7 +278,7 @@ The ``stimulus_action()`` Twig function can be used to render `Stimulus Actions`
283278

284279
For example:
285280

286-
.. code-block:: twig
281+
.. code-block:: html+twig
287282

288283
<div {{ stimulus_action('controller', 'method') }}>Hello</div>
289284
<div {{ stimulus_action('controller', 'method', 'click') }}>Hello</div>
@@ -295,7 +290,7 @@ For example:
295290
If you have multiple actions and/or methods on the same element, you can chain them as there's also a
296291
``stimulus_action`` filter:
297292

298-
.. code-block:: twig
293+
.. code-block:: html+twig
299294

300295
<div {{ stimulus_action('controller', 'method')|stimulus_action('other-controller', 'test') }}>
301296
Hello
@@ -314,7 +309,7 @@ You can also retrieve the generated attributes as an array, which can be helpful
314309
315310
You can also pass `parameters`_ to actions:
316311

317-
.. code-block:: twig
312+
.. code-block:: html+twig
318313

319314
<div {{ stimulus_action('hello-controller', 'method', 'click', { 'count': 3 }) }}>Hello</div>
320315

@@ -328,7 +323,7 @@ The ``stimulus_target()`` Twig function can be used to render `Stimulus Targets`
328323

329324
For example:
330325

331-
.. code-block:: twig
326+
.. code-block:: html+twig
332327

333328
<div {{ stimulus_target('controller', 'a-target') }}>Hello</div>
334329
<div {{ stimulus_target('controller', 'a-target second-target') }}>Hello</div>
@@ -339,7 +334,7 @@ For example:
339334

340335
If you have multiple targets on the same element, you can chain them as there's also a `stimulus_target` filter:
341336

342-
.. code-block:: twig
337+
.. code-block:: html+twig
343338

344339
<div {{ stimulus_target('controller', 'a-target')|stimulus_target('other-controller', 'another-target') }}>
345340
Hello

0 commit comments

Comments
 (0)