Skip to content

Commit d5bcfc7

Browse files
kartbendleach02
authored andcommitted
doc: extensions: boards: suppress extra blank lines in Jinja templates
Ensure Jinja templates don't have extra blank lines in the output by using the {% -%} syntax to suppress them. This is not incredibly important but this helps keeps the HTML output more readable. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 29798f0 commit d5bcfc7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

doc/_extensions/zephyr/domain/templates/board-card.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55

66
<a
77
class="board-card"
8-
{% if board.doc_page %}
8+
{% if board.doc_page -%}
99
href="../{{ board.doc_page | replace(".rst", ".html") }}"
10-
{% else %}
10+
{% else -%}
1111
href="#"
12-
{% endif %}
12+
{% endif -%}
1313
aria-label="Open the documentation page for {{ board.full_name }}"
1414
data-name="{{ board.full_name}}"
1515
data-arch="{{ board.archs | join(" ") }}"
1616
data-vendor="{{ board.vendor }}"
1717
tabindex="0">
1818
<div class="vendor">{{ catalog.vendors[board.vendor] }}</div>
19-
{% if board.image %}
19+
{% if board.image -%}
2020
<img alt="A picture of the {{ board.name }} board" src="{{ board.image }}" class="picture" />
21-
{% else %}
21+
{% else -%}
2222
<div class="no-picture fa fa-microchip picture"></div>
23-
{% endif %}
23+
{% endif -%}
2424
<div class="board-name">{{ board.full_name }}</div>
2525
<div class="arch">{{ board.archs | join(", ") }}</div>
2626
</a>

doc/_extensions/zephyr/domain/templates/board-catalog.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<option value="" disabled selected>Select a vendor</option>
3939
{# Only show those vendors that have actual boards in the catalog.
4040
Note: as sorting per vendor name is not feasible in Jinja, the option list is sorted in the JavaScript code later #}
41-
{% for vendor in (catalog.boards | items | map(attribute='1.vendor') | unique ) %}
41+
{% for vendor in (catalog.boards | items | map(attribute='1.vendor') | unique ) -%}
4242
<option value="{{ vendor }}">{{ catalog.vendors[vendor] }}</option>
4343
{% endfor %}
4444
</select>
@@ -67,7 +67,7 @@
6767
<div id="nb-matches" style="text-align: center"></div>
6868

6969
<div id="catalog">
70-
{% for board_name, board in catalog.boards | items | sort(attribute='1.full_name') %}
70+
{% for board_name, board in catalog.boards | items | sort(attribute='1.full_name') -%}
7171
{% include "board-card.html" %}
7272
{% endfor %}
7373
</div>

0 commit comments

Comments
 (0)