Skip to content

Commit 15fae36

Browse files
committed
Split examples in terms.tmpl, style as list-group if more than one
In CSS, make the list group flush (on the left/right) with other elements in the table
1 parent 4500389 commit 15fae36

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

build/terms.tmpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ For more information on `UseWithIRI`, see [Section 2.5 of the RDF Guide](https:/
5050
<span id="{{ term.label }}"></span>
5151
{% endif %}
5252
</p>
53+
{% set examples = term.examples.split("; ") %}
5354
<table class="table">
5455
<tbody>
5556
<tr class="table-secondary"><th colspan="2">{{ term.label }}</th></tr>
5657
<tr><td>Identifier</td><td><a href="{{ term.iri }}">{{ term.iri }}</a></td></tr>
5758
<tr><td>Definition</td><td>{{ term.definition }}</td></tr>
5859
<tr><td>Comments</td><td>{{ term.comments }}</td></tr>
59-
<tr><td>Examples</td><td>{{ term.examples }}</td></tr>
60+
<tr><td>Examples</td><td>{% if examples | length == 1 %}{{ examples | first }}{% else %}<ul class="list-group list-group-flush">{% for example in examples %}<li class="list-group-item">{{ example }}</li>{% endfor %}</ul>{% endif %}</td></tr>
6061
</tbody>
6162
</table>
6263
{% endfor %}

docs/_sass/_custom.scss

+4
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@
55
td:first-of-type {
66
width: 120px; // Label column, long words will still push this wider
77
}
8+
9+
.list-group-item {
10+
padding: 0.5rem 0; // Examples
11+
}
812
}
913
}

0 commit comments

Comments
 (0)