summaryrefslogtreecommitdiff
path: root/docs/_templates
diff options
context:
space:
mode:
Diffstat (limited to 'docs/_templates')
-rw-r--r--docs/_templates/layout.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
index e0e69520ad..70e029c3ac 100644
--- a/docs/_templates/layout.html
+++ b/docs/_templates/layout.html
@@ -16,6 +16,43 @@
{%- endif %}
{%- endmacro %}
+{% block extrahead %}
+{{ super() }}
+<script type="text/javascript" src="{{ pathto('templatebuiltins.js', 1) }}"></script>
+<script type="text/javascript">
+(function($) {
+ if (!django_template_builtins) {
+ // templatebuiltins.js missing, do nothing.
+ return;
+ }
+ $(document).ready(function() {
+ // Hyperlink Django template tags and filters
+ var base = "{{ pathto('ref/templates/builtins') }}";
+ if (base == "#") {
+ // Special case for builtins.html itself
+ base = "";
+ }
+ // Tags are keywords, class '.k'
+ $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
+ var tagname = $(elem).text();
+ if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
+ var fragment = tagname.replace(/_/, '-');
+ $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
+ }
+ });
+ // Filters are functions, class '.nf'
+ $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
+ var filtername = $(elem).text();
+ if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
+ var fragment = filtername.replace(/_/, '-');
+ $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
+ }
+ });
+ });
+})(jQuery);
+</script>
+{% endblock %}
+
{% block document %}
<div id="custom-doc" class="{% block bodyclass %}{{ 'yui-t6' if pagename != 'index' else '' }}{% endblock %}">
<div id="hd">