File: highlight_django.html.dark.html

package info (click to toggle)
kf6-syntax-highlighting 6.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 47,568 kB
  • sloc: xml: 197,750; cpp: 12,850; python: 3,023; sh: 955; perl: 546; ruby: 488; pascal: 393; javascript: 161; php: 150; jsp: 132; lisp: 131; haskell: 124; ada: 119; ansic: 107; makefile: 96; f90: 94; ml: 85; cobol: 81; yacc: 71; csh: 62; erlang: 54; sql: 51; java: 47; objc: 37; awk: 31; asm: 30; tcl: 29; fortran: 18; cs: 10
file content (72 lines) | stat: -rw-r--r-- 4,478 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight_django.html</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Django HTML Template) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
{# Basic extension of a common file #}
<span style="color:#8e44ad">{% extends</span><span style="color:#8e44ad"> </span><span style="color:#f44f4f">"base_file.html"</span><span style="color:#8e44ad"> </span><span style="color:#8e44ad">%}</span>

<span style="color:#8e44ad">{% block</span><span style="color:#8e44ad"> title </span><span style="color:#8e44ad">%}</span><span style="color:#8e44ad">{{ section.title }}</span><span style="color:#8e44ad">{% endblock %}</span>

<span style="color:#8e44ad">{% block</span><span style="color:#8e44ad"> content </span><span style="color:#8e44ad">%}</span>
<span style="font-weight:bold">&lt;h1></span><span style="color:#8e44ad">{{ section.title }}</span><span style="font-weight:bold">&lt;/h1></span>

{# For loop example #}

<span style="color:#8e44ad">{% for</span><span style="color:#8e44ad"> item in item_list </span><span style="color:#8e44ad">%}</span>
<span style="font-weight:bold">&lt;h2></span>
  <span style="font-weight:bold">&lt;a</span><span style="color:#27ae60"> href=</span><span style="color:#f44f4f">"</span><span style="color:#8e44ad">{{ item.get_absolute_url }}</span><span style="color:#f44f4f">"</span><span style="font-weight:bold">></span>
    <span style="color:#8e44ad">{{ item.text }}</span>
    <span style="color:#8e44ad">{{ item.other_text</span><span style="color:#27ae60">|upper </span><span style="color:#8e44ad">}}</span>
  <span style="font-weight:bold">&lt;/a></span>
<span style="font-weight:bold">&lt;/h2></span>
<span style="font-weight:bold">&lt;p></span><span style="color:#8e44ad">{{ story.longer_text</span><span style="color:#27ae60">|truncatewords:</span><span style="color:#f44f4f">"100"</span><span style="color:#27ae60"> </span><span style="color:#8e44ad">}}</span><span style="font-weight:bold">&lt;/p></span>
<span style="color:#8e44ad">{% endfor %}</span>
<span style="color:#8e44ad">{% endblock %}</span>


{# For loop example with specific content if empty #}

<span style="color:#8e44ad">{% for</span><span style="color:#8e44ad"> item in other_list </span><span style="color:#8e44ad">%}</span>
<span style="font-weight:bold">&lt;h2></span>
	<span style="color:#8e44ad">{{ item.text }}</span>
<span style="font-weight:bold">&lt;/h2></span>
<span style="color:#8e44ad">{% else</span><span style="color:#8e44ad"> </span><span style="color:#8e44ad">%}</span>
<span style="font-weight:bold">&lt;h2></span>
	This list is empty
<span style="font-weight:bold">&lt;/h2></span>
<span style="color:#8e44ad">{% endfor %}</span>
<span style="color:#da4453;text-decoration:underline">{% endblock %}</span>


{# if example #}

<span style="color:#8e44ad">{% if</span><span style="color:#8e44ad"> item_list </span><span style="color:#8e44ad">%}</span>
    Number of items: <span style="color:#8e44ad">{{ item_list</span><span style="color:#27ae60">|length </span><span style="color:#8e44ad">}}</span>
<span style="color:#8e44ad">{% elif</span><span style="color:#8e44ad"> some_condition </span><span style="color:#8e44ad">%}</span>
    Show this text
<span style="color:#8e44ad">{% else</span><span style="color:#8e44ad"> </span><span style="color:#8e44ad">%}</span>
    Nothing to process
<span style="color:#8e44ad">{% endif %}</span>

{# This is a comment #} hello comment


{# Translation example #}

<span style="color:#8e44ad">{% translate</span><span style="color:#8e44ad"> </span><span style="color:#f44f4f">"Title"</span><span style="color:#8e44ad"> as title </span><span style="color:#8e44ad">%}</span>
<span style="color:#8e44ad">{% block</span><span style="color:#8e44ad"> content </span><span style="color:#8e44ad">%}</span><span style="color:#8e44ad">{{ title }}</span><span style="color:#8e44ad">{% endblock %}</span>


{# Auto-escaping #}

<span style="color:#8e44ad">{% autoescape</span><span style="color:#8e44ad"> off </span><span style="color:#8e44ad">%}</span>
    Hello <span style="color:#8e44ad">{{ name }}</span>
<span style="color:#8e44ad">{% endautoescape %}</span>


{# Loading custom tags/libraries #}

<span style="color:#8e44ad">{% load</span><span style="color:#8e44ad"> humanize </span><span style="color:#8e44ad">%}</span>
</pre></body></html>