Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 {# | |
2 # This file is part of the Adblock Plus website, | |
3 # Copyright (C) 2006-2015 Eyeo GmbH | |
4 # | |
5 # Adblock Plus is free software: you can redistribute it and/or modify | |
6 # it under the terms of the GNU General Public License version 3 as | |
7 # published by the Free Software Foundation. | |
8 # | |
9 # Adblock Plus is distributed in the hope that it will be useful, | |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 # GNU General Public License for more details. | |
13 # | |
14 # You should have received a copy of the GNU General Public License | |
15 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | |
16 #} | |
17 {% from "includes/common" import description with context %} | |
18 | |
19 {% macro return_type(return_type) %} | |
20 {% if return_type|truncate(1, True, "") == "I" %} | |
21 {{ return_type|linkify }} | |
22 {{ return_type -}} | |
23 </a> | |
24 {% else %} | |
25 {{ return_type }} | |
26 {% endif %} | |
27 {% endmacro %} | |
28 | |
29 {% macro display_interface(interface, links) %} | |
30 {% set interface=interface|parse_interface %} | |
31 | |
32 <h2>{{ "toc_header"|translate }}</h2> | |
33 <ul> | |
34 {% for property in interface %} | |
35 {% if property.type == "method" %} | |
36 <li> | |
37 {{ return_type(property.return_type) }} | |
38 <a href="#method_{{ property.name }}" class="methodname">{{ property.n ame }}</a> | |
39 ( | |
40 {% for argument in property.arguments %} | |
41 {{ argument.type }} {{argument.name }} | |
42 {%- if not loop.last %},{% endif %} | |
43 {% endfor %} | |
44 ) | |
45 </li> | |
46 {% else %} | |
47 <li> | |
48 {{ property.modifier }} {{ property.type }} | |
49 <a href="#prop_{{ property.name }}" class="propname">{{ property.name }} </a> | |
50 </li> | |
51 {% endif %} | |
52 {% endfor %} | |
53 </ul> | |
54 | |
55 {% for property in interface %} | |
56 <hr> | |
57 {% if property.type == "method" %} | |
58 <p id="method_{{ property.name }}"> | |
59 {{ return_type(property.return_type) }} | |
60 <span class="methodname">{{ property.name }}</span> | |
61 ( | |
62 {% for argument in property.arguments %} | |
63 {{ argument.modifier }} {{ argument.type }} {{ argument.name }} | |
64 {%- if not loop.last %},{% endif %} | |
65 {% endfor %} | |
66 ) | |
67 </p> | |
68 {{ description(property.name + "Description", links, "<p>", "</p>") }} | |
69 <dl> | |
70 {% if property.version %} | |
71 <dt>Version:</dt> | |
72 <dd>{{ property.version }} and higher</dd> | |
73 {% endif %} | |
74 {% if property.arguments|length %} | |
75 <dt>Arguments:</dt> | |
76 {% for argument in property.arguments %} | |
77 <dd> | |
78 <span class="argumentname">{{ argument.name }}</span>: | |
79 {{ description(property.name + "-" + argument.name + "Description" , links) }} | |
80 </dd> | |
81 {% endfor %} | |
82 {% endif %} | |
83 {% if (property.name + "-returnDescription") in localedata %} | |
84 <dt>Returns:</dt> | |
85 {{ description(property.name + "-returnDescription", links, "<dd>", "< /dd>") }} | |
Wladimir Palant
2015/02/26 20:35:03
No, you don't want to create another <dd> block fo
kzar
2015/02/26 21:49:13
Done.
| |
86 {% endif %} | |
87 </dl> | |
88 {% else %} | |
89 <p id="prop_{{ property.name }}"> | |
90 {{ property.modifier }} {{ property.type }} | |
91 <span class="propname">{{ property.name }}</span> | |
92 </p> | |
93 {{ description(property.name + "Description", links, "<p>", "</p>") }} | |
94 {% endif %} | |
95 {% endfor %} | |
96 {% endmacro %} | |
OLD | NEW |