Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 {% macro description(key_name, open="<p>", close="</p>") %} | |
2 {% for i in range(100) %} | |
3 {% if i == 0 and key_name in localedata %} | |
4 {{open |safe}}{{ key_name |translate(None, links[key_name])|unescape|safe }}{{close |safe}} | |
Sebastian Noack
2015/02/13 17:51:49
If you output the "open" and "close" variables out
kzar
2015/02/20 14:55:18
Both the unescape and safe filters are required he
Sebastian Noack
2015/02/20 15:32:59
I think I figured out the issue here. It look like
| |
5 {% elif (key_name + i|string) in localedata %} | |
Sebastian Noack
2015/02/13 17:51:49
Maybe using {% set %} instead duplicating the logi
kzar
2015/02/20 14:55:18
Done.
| |
6 {{open |safe}}{{ (key_name + i|string) |translate(None, links[key_name])|u nescape|safe }}{{close |safe}} | |
7 {% endif %} | |
8 {% endfor %} | |
9 {% endmacro %} | |
10 | |
11 {% macro return_type(return_type) %} | |
12 {% if return_type |truncate(1, True, "") == "I" %} | |
13 {{ return_type |linkify }} | |
14 {{ return_type -}} | |
15 </a> | |
16 {% else %} | |
17 {{ return_type }} | |
18 {% endif %} | |
19 {% endmacro %} | |
20 | |
21 {% block body %} | |
22 {% set interface=interface|parse_interface %} | |
23 | |
24 <h2>{{ "methods_and_properties" |translate }}</h2> | |
25 <ul> | |
26 {% for property in interface %} | |
27 {% if property.type == "method" %} | |
28 <li> | |
29 {{ return_type(property.return_type) }} | |
30 <a href="#method_{{ property.name }}" class="methodname">{{ property.n ame }}</a> | |
31 ( | |
32 {% for argument in property.arguments %} | |
33 {{ argument.type }} {{argument.name }} | |
34 {%- if not loop.last %},{% endif %} | |
35 {% endfor %} | |
36 ) | |
37 </li> | |
38 {% else %} | |
39 <li> | |
40 {{ property.modifier }} {{ property.type }} | |
41 <a href="#prop_{{ property.name }}" class="propname">{{ property.name }} </a> | |
42 </li> | |
43 {% endif %} | |
44 {% endfor %} | |
45 </ul> | |
46 | |
47 {% for property in interface %} | |
48 {% if property.type == "method" %} | |
49 <hr> | |
50 <p id="method_{{ property.name }}"> | |
51 {{ return_type(property.return_type) }} | |
52 <span class="methodname">{{ property.name }}</span> | |
53 ( | |
54 {% for argument in property.arguments %} | |
55 {{ argument.modifier }} {{ argument.type }} {{ argument.name }} | |
56 {%- if not loop.last %},{% endif %} | |
57 {% endfor %} | |
58 ) | |
59 </p> | |
60 {{ description(property.name + "Description") }} | |
61 <dl> | |
62 {% if property.version %} | |
63 <dt>Version:</dt> | |
64 <dd>{{ property.version }} and higher</dd> | |
65 {% endif %} | |
66 {% if property.arguments |length %} | |
67 <dt>Arguments:</dt> | |
68 {% for argument in property.arguments %} | |
69 <dd> | |
70 <span class="argumentname">{{ argument.name }}</span>: | |
71 {{ description(property.name + "Argument" + argument.name + "Descr iption", "", "") }} | |
72 </dd> | |
73 {% endfor %} | |
74 {% endif %} | |
75 {% if (property.name + "ReturnDescription") in localedata %} | |
76 <dt>Returns:</dt> | |
77 <dd>{{ (property.name + "ReturnDescription") |translate(None, links[pr operty.name + "ReturnDescription"])|unescape|safe }}</dd> | |
78 {% endif %} | |
79 </dl> | |
80 {% else %} | |
81 <hr> | |
82 <p id="prop_{{ property.name }}"> | |
83 {{ property.modifier }} {{ property.type }} | |
84 <span class="propname">{{ property.name }}</span> | |
85 </p> | |
86 <p>{{ description(property.name + "Description") }}</p> | |
Sebastian Noack
2015/02/13 17:51:49
Mind that the "description" macro is already gener
kzar
2015/02/20 14:55:18
Done.
| |
87 {% endif %} | |
88 {% endfor %} | |
89 {% endblock %} | |
OLD | NEW |