From 8441ec3eafc794bbac30959469e9513f3e11bc55 Mon Sep 17 00:00:00 2001 From: seb-jean Date: Fri, 3 Jan 2025 19:40:42 +0100 Subject: [PATCH 1/3] Document --- src/Turbo/doc/index.rst | 186 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 180 insertions(+), 6 deletions(-) diff --git a/src/Turbo/doc/index.rst b/src/Turbo/doc/index.rst index 4618bd701c2..ab1619ccc6b 100644 --- a/src/Turbo/doc/index.rst +++ b/src/Turbo/doc/index.rst @@ -394,19 +394,193 @@ Let's discover how to use Turbo Streams to enhance your `Symfony forms`_:: {# bottom of new.html.twig #} {% block success_stream %} - - + {% endblock %} Supported actions are ``append``, ``prepend``, ``replace``, ``update``, ``remove``, ``before``, ``after`` and ``refresh``. `Read the Turbo Streams documentation for more details`_. +Stream Messages and Actions +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To render a ```` element, we recommend using the ```` Twig Component to avoid typos. + +Append +"""""" + +.. code-block:: html+twig + + + Content to append to container designated with the dom_id. + + + {# renders as: #} + + + + +For more info, see: `Turbo Streams - Append `_. + +Prepend +""""""" + +.. code-block:: html+twig + + + Content to prepend to container designated with the dom_id. + + + {# renders as: #} + + + + +For more info, see: `Turbo Streams - Prepend `_. + +Replace +""""""" + +.. code-block:: html+twig + + + Content to replace the element designated with the dom_id. + + + {# renders as: #} + + + + +.. code-block:: html+twig + + {# with morphing #} + + Content to replace the element. + + + {# renders as: #} + + + + +For more info, see: `Turbo Streams - Replace `_. + +Update +"""""" + +.. code-block:: html+twig + + + Content to update to container designated with the dom_id. + + + {# renders as: #} + + + + +.. code-block:: html+twig + + {# with morphing #} + + Content to replace the element. + + + {# renders as: #} + + + + +For more info, see: `Turbo Streams - Update `_. + +Remove +"""""" + +.. code-block:: html+twig + + + + {# renders as: #} + + +For more info, see: `Turbo Streams - Remove `_. + +Before +"""""" + +.. code-block:: html+twig + + + Content to place before the element designated with the dom_id. + + + {# renders as: #} + + + + +For more info, see: `Turbo Streams - Before `_. + +After +""""" + +.. code-block:: html+twig + + + Content to place after the element designated with the dom_id. + + + {# renders as: #} + + + + +For more info, see: `Turbo Streams - After `_. + +Refresh +""""""" + +.. code-block:: html+twig + + {# without [request-id] #} + + + {# renders as: #} + + +.. code-block:: html+twig + + {# debounced with [request-id] #} + + + {# renders as: #} + + +For more info, see: `Turbo Streams - Refresh `_. + Resetting the Form ~~~~~~~~~~~~~~~~~~ From 79a01807bc46e9bdf81339f63e4080f11e03eae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sun, 9 Feb 2025 03:40:35 +0100 Subject: [PATCH 2/3] Remove too many links --- src/Turbo/doc/index.rst | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/Turbo/doc/index.rst b/src/Turbo/doc/index.rst index ab1619ccc6b..a3d46f55fc5 100644 --- a/src/Turbo/doc/index.rst +++ b/src/Turbo/doc/index.rst @@ -428,8 +428,6 @@ Append -For more info, see: `Turbo Streams - Append `_. - Prepend """"""" @@ -446,8 +444,6 @@ Prepend -For more info, see: `Turbo Streams - Prepend `_. - Replace """"""" @@ -478,8 +474,6 @@ Replace -For more info, see: `Turbo Streams - Replace `_. - Update """""" @@ -510,8 +504,6 @@ Update -For more info, see: `Turbo Streams - Update `_. - Remove """""" @@ -522,8 +514,6 @@ Remove {# renders as: #} -For more info, see: `Turbo Streams - Remove `_. - Before """""" @@ -540,8 +530,6 @@ Before -For more info, see: `Turbo Streams - Before `_. - After """"" @@ -558,8 +546,6 @@ After -For more info, see: `Turbo Streams - After `_. - Refresh """"""" @@ -579,8 +565,6 @@ Refresh {# renders as: #} -For more info, see: `Turbo Streams - Refresh `_. - Resetting the Form ~~~~~~~~~~~~~~~~~~ From f572ab5e78afd7183910d232243b4cb146c3d64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Sat, 22 Feb 2025 01:55:32 +0100 Subject: [PATCH 3/3] Update src/Turbo/doc/index.rst --- src/Turbo/doc/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Turbo/doc/index.rst b/src/Turbo/doc/index.rst index a3d46f55fc5..4f71c9119a9 100644 --- a/src/Turbo/doc/index.rst +++ b/src/Turbo/doc/index.rst @@ -410,7 +410,7 @@ Supported actions are ``append``, ``prepend``, ``replace``, ``update``, Stream Messages and Actions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -To render a ```` element, we recommend using the ```` Twig Component to avoid typos. +To render a ```` element, this bundle provides a set of ```` Twig Components. These components make it easy to inject content directly into the ``