@@ -54,3 +54,59 @@ on the page, and its ordering relative to the ``Dash`` instances using updating
5454the page footer - to avoid delaying the main page load - along
5555with other scripts is generally advisable.
5656
57+ The ``plotly_app_identifier `` template tag
58+ -----------------------------------------
59+
60+ This tag provides an identifier for an app, in a form that is suitable for use as a classname or identifier
61+ in HTML:
62+
63+ .. code-block :: jinja
64+
65+ {%load plotly_dash%}
66+
67+ {%plotly_app_identifier name="SimpleExample"%}
68+
69+ {%plotly_app_identifier slug="liveoutput-2" postfix="A"%}
70+
71+ The identifier, if the tag is not passed a ``slug ``, is the result of passing the identifier of the app through
72+ the ``django.utils.text.slugify `` function.
73+
74+ The tag arguments are:
75+
76+ :name = None: The name of the application, as passed to a ``DjangoDash `` constructor.
77+ :slug = None: The slug of an existing ``DashApp `` instance.
78+ :da = None: An existing ``django_plotly_dash.models.DashApp `` model instance.
79+ :postfix = None: An optional string; if specified it is appended to the identifier with a hyphen.
80+
81+ The validity rules for these arguments are the same as those for the ``plotly_app `` template tag.
82+
83+ The ``plotly_class `` template tag
84+ -----------------------------------------
85+
86+ Generate a string of class names, suitable for a ``div `` or other element that wraps around ``django-plotly-dash `` template content.
87+
88+ .. code-block :: jinja
89+
90+ {%load plotly_dash%}
91+
92+ <div class="{%plotly_class slug="liveoutput-2" postfix="A"%}">
93+ {%plotly_app slug="liveoutput-2" ratio="0.5" %}
94+ </div>
95+
96+ The identifier, if the tag is not passed a ``slug ``, is the result of passing the identifier of the app through
97+ the ``django.utils.text.slugify `` function.
98+
99+ The tag arguments are:
100+
101+ :name = None: The name of the application, as passed to a ``DjangoDash `` constructor.
102+ :slug = None: The slug of an existing ``DashApp `` instance.
103+ :da = None: An existing ``django_plotly_dash.models.DashApp `` model instance.
104+ :prefix = None: Optional prefix to use in place of the text ``django-plotly-dash `` in each class name
105+ :postfix = None: An optional string; if specified it is appended to the app-specific identifier with a hyphen.
106+ :template_type = None: Optional text to use in place of ``iframe `` in the template-specific class name
107+
108+ The tag inserts a string with three class names in it. One is just the ``prefix `` argument, one
109+ has the ``template_type `` appended, and the final one has the app identifier (as generated
110+ by the ``plotly_app_identifier `` tag) and any ``postfix `` appended.
111+
112+ The validity rules for these arguments are the same as those for the ``plotly_app `` template tag.
0 commit comments