Skip to content

Commit dcbf1bd

Browse files
committed
-
1 parent b525d45 commit dcbf1bd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

frontend/encore/simple-example.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ To build the assets, run the following if you use the Yarn package manager:
7575
$ yarn dev-server
7676
# or
7777
$ npm run dev-server
78-
78+
7979
# compile assets once
8080
$ yarn dev
8181
# or
@@ -229,7 +229,7 @@ to initialize Stimulus and automatically load any "controllers" from the
229229

230230
Let's look at a simple Stimulus example. In a Twig template, suppose you have:
231231

232-
.. code-block:: twig
232+
.. code-block:: html+twig
233233

234234
<div {{ stimulus_controller('say-hello') }}>
235235
<input type="text" {{ stimulus_target('say-hello', 'name') }}>

mercure.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ Subscribing
261261

262262
Subscribing to updates in JavaScript from a Twig template is straightforward:
263263

264-
.. code-block:: twig
264+
.. code-block:: html+twig
265265

266266
<script>
267267
const eventSource = new EventSource("{{ mercure('https://example.com/books/1')|escape('js') }}");
@@ -278,7 +278,7 @@ parameters corresponding to the topics passed as first argument.
278278
If you want to access to this URL from an external JavaScript file, generate the
279279
URL in a dedicated HTML element:
280280

281-
.. code-block:: twig
281+
.. code-block:: html+twig
282282

283283
<script type="application/json" id="mercure-url">
284284
{{ mercure('https://example.com/books/1')|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_HEX_TAG'))|raw }}
@@ -296,7 +296,7 @@ Mercure also allows subscribing to several topics,
296296
and to use URI Templates or the special value ``*`` (matched by all topics)
297297
as patterns:
298298

299-
.. code-block:: twig
299+
.. code-block:: html+twig
300300

301301
<script>
302302
{# Subscribe to updates of several Book resources and to all Review resources matching the given pattern #}
@@ -427,7 +427,7 @@ passed by the browsers to the Mercure hub if the ``withCredentials`` attribute
427427
of the ``EventSource`` class is set to ``true``. Then, the Hub verifies the
428428
validity of the provided JWT, and extract the topic selectors from it.
429429

430-
.. code-block:: twig
430+
.. code-block:: html+twig
431431

432432
<script>
433433
const eventSource = new EventSource("{{ mercure('https://example.com/books/1', { subscribe: 'https://example.com/books/1' })|escape('js') }}", {
@@ -455,7 +455,7 @@ is the way to go.
455455
The native implementation of EventSource doesn't allow specifying headers.
456456
For example, authorization using a Bearer token. In order to achieve that, use `a polyfill`_
457457

458-
.. code-block:: twig
458+
.. code-block:: html+twig
459459

460460
<script>
461461
const es = new EventSourcePolyfill("{{ mercure('https://example.com/books/1') }}", {

0 commit comments

Comments
 (0)