Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: includes/interface.tmpl

Issue 5636796054503424: Issue 1170 - [adblockplus.org Anwiki to CMS migration] Migrate content (Closed)
Patch Set: Addressed palant's feedback. Created Feb. 26, 2015, 7:48 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: includes/interface.tmpl
diff --git a/includes/interface.tmpl b/includes/interface.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..9af3f9c8afcf733027f54cbc1e715cee8f1f031a
--- /dev/null
+++ b/includes/interface.tmpl
@@ -0,0 +1,96 @@
+{#
+ # This file is part of the Adblock Plus website,
+ # Copyright (C) 2006-2015 Eyeo GmbH
+ #
+ # Adblock Plus is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License version 3 as
+ # published by the Free Software Foundation.
+ #
+ # Adblock Plus is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+ #}
+{% from "includes/common" import description with context %}
+
+{% macro return_type(return_type) %}
+ {% if return_type|truncate(1, True, "") == "I" %}
+ {{ return_type|linkify }}
+ {{ return_type -}}
+ </a>
+ {% else %}
+ {{ return_type }}
+ {% endif %}
+{% endmacro %}
+
+{% macro display_interface(interface, links) %}
+ {% set interface=interface|parse_interface %}
+
+ <h2>{{ "toc_header"|translate }}</h2>
+ <ul>
+ {% for property in interface %}
+ {% if property.type == "method" %}
+ <li>
+ {{ return_type(property.return_type) }}
+ <a href="#method_{{ property.name }}" class="methodname">{{ property.name }}</a>
+ (
+ {% for argument in property.arguments %}
+ {{ argument.type }} {{argument.name }}
+ {%- if not loop.last %},{% endif %}
+ {% endfor %}
+ )
+ </li>
+ {% else %}
+ <li>
+ {{ property.modifier }} {{ property.type }}
+ <a href="#prop_{{ property.name }}" class="propname">{{ property.name }}</a>
+ </li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+
+ {% for property in interface %}
+ <hr>
+ {% if property.type == "method" %}
+ <p id="method_{{ property.name }}">
+ {{ return_type(property.return_type) }}
+ <span class="methodname">{{ property.name }}</span>
+ (
+ {% for argument in property.arguments %}
+ {{ argument.modifier }} {{ argument.type }} {{ argument.name }}
+ {%- if not loop.last %},{% endif %}
+ {% endfor %}
+ )
+ </p>
+ {{ description(property.name + "Description", links, "<p>", "</p>") }}
+ <dl>
+ {% if property.version %}
+ <dt>Version:</dt>
+ <dd>{{ property.version }} and higher</dd>
+ {% endif %}
+ {% if property.arguments|length %}
+ <dt>Arguments:</dt>
+ {% for argument in property.arguments %}
+ <dd>
+ <span class="argumentname">{{ argument.name }}</span>:
+ {{ description(property.name + "-" + argument.name + "Description", links) }}
+ </dd>
+ {% endfor %}
+ {% endif %}
+ {% if (property.name + "-returnDescription") in localedata %}
+ <dt>Returns:</dt>
+ {{ 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.
+ {% endif %}
+ </dl>
+ {% else %}
+ <p id="prop_{{ property.name }}">
+ {{ property.modifier }} {{ property.type }}
+ <span class="propname">{{ property.name }}</span>
+ </p>
+ {{ description(property.name + "Description", links, "<p>", "</p>") }}
+ {% endif %}
+ {% endfor %}
+{% endmacro %}

Powered by Google App Engine
This is Rietveld