Skip to content

Commit 641e6ce

Browse files
committed
Add a few additional links for the tips on htmx and Turbo.
Providing the links to the libraries' documentation may eventually go stale, but it should help the developer understand what's actually happening.
1 parent 58b558b commit 641e6ce

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

docs/configuration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ Toolbar options
9898

9999
The toolbar keeps up to this many results in memory.
100100

101+
.. _ROOT_TAG_EXTRA_ATTRS:
102+
101103
* ``ROOT_TAG_EXTRA_ATTRS``
102104

103105
Default: ``''``

docs/tips.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ Working with htmx and Turbo
2525

2626
Libraries such as `htmx <https://htmx.org/>`_ and
2727
`Turbo <https://turbo.hotwired.dev/>`_ need additional configuration to retain
28-
the toolbar handle through page renders.
28+
the toolbar handle element through page renders. This can be done by
29+
configuring the :ref:`ROOT_TAG_EXTRA_ATTRS <ROOT_TAG_EXTRA_ATTRS>` to include
30+
the relevant JavaScript library's attribute.
2931

3032
htmx
3133
~~~~
3234

33-
In ``settings.py``, add::
35+
The attribute `htmx <https://htmx.org/>`_ uses is
36+
`hx-preserve <https://htmx.org/attributes/hx-preserve/>`_.
37+
38+
Update your settings to include:
39+
40+
.. code-block:: python
3441
3542
DEBUG_TOOLBAR_CONFIG = {
3643
"ROOT_TAG_EXTRA_ATTRS": "hx-preserve"
@@ -39,7 +46,12 @@ In ``settings.py``, add::
3946
Hotwire Turbo
4047
~~~~~~~~~~~~~
4148

42-
In ``settings.py``, add::
49+
The attribute `Turbo <https://turbo.hotwired.dev/>`_ uses is
50+
`data-turbo-permanent <https://turbo.hotwired.dev/reference/attributes>`_
51+
52+
Update your settings to include:
53+
54+
.. code-block:: python
4355
4456
DEBUG_TOOLBAR_CONFIG = {
4557
"ROOT_TAG_EXTRA_ATTRS": "data-turbo-permanent"

0 commit comments

Comments
 (0)