Skip to content

Commit 9681f22

Browse files
Merge pull request #54 from weber-s/doc_tag_plotly
[DOC] Add plotly_header and plotly_footer in doc Addresses #49
2 parents feabacb + 31d5efb commit 9681f22

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/template_tags.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,40 @@ This tag should not appear more than once on a page. This rule however is not en
7070

7171
.. _plotly_message_pipe:
7272

73+
74+
The ``plotly_header`` and ``plotly_footer`` template tag
75+
--------------------------------------------------------
76+
77+
``DjangoDash`` allows you to inject directly the html generated by ``Dash`` in
78+
the DOM of the page (without iframe). To include your app CSS and JS, you have
79+
to include 2 tags in your template ``plotly_header`` and ``plotly_footer``, as
80+
folllows:
81+
82+
.. code-block:: jinja
83+
84+
<!-- templates/base.html -->
85+
<!DOCTYPE html>
86+
<html>
87+
<head>
88+
...
89+
{% load plotly_dash%}
90+
...
91+
{% plotly_header %}
92+
...
93+
</head>
94+
<body>
95+
...
96+
{%plotly_direct name="SimpleExample"%}
97+
...
98+
</body>
99+
...
100+
{% plotly_footer %}
101+
</html>
102+
103+
This part in mandatory if you want to use ``plotly_direct`` tag.
104+
105+
106+
73107
The ``plotly_message_pipe`` template tag
74108
----------------------------------------
75109

0 commit comments

Comments
 (0)