forked from inducer/relate-sample
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent-macros.jinja
35 lines (28 loc) · 1.15 KB
/
content-macros.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{# Make sure to avoid 4-spaces-deep (or deeper) indentation #}
{# The results get of Jinja expansion get fed into Markdown, which #}
{# may do undesired things with such deeply indented content. #}
{% macro youtube(id) -%}
<iframe width="420" height="315" src="//www.youtube.com/embed/{{id}}" frameborder="0" allowfullscreen>
</iframe>
<div class="well" markdown="1">
(This embedded video was brought to you by the `youtube` macro.
See [this macro definition file](https://github.com/inducer/relate-sample/blob/master/macros.jinja)
in the sample content repository for an example of how to do define macros.)
</div>
{%- endmacro %}
{% macro collapsible(title, id="collapsery") -%}
<div class="panel panel-default" markdown="block"><div class="panel-heading" markdown="span">
<h4 class="panel-title" markdown="span">
<a data-toggle="collapse" href="#{{ id }}" markdown="span">
{{ title }}
<span style="font-size:x-small">(click to view)</span>
</a>
</h4>
</div>
<div id="{{ id }}" class="panel-collapse collapse" markdown="block">
<div class="panel-body" markdown="block">
{{ caller() }}
</div>
</div>
</div>
{%- endmacro %}