{% mbd_token as token %}

<header class="mbd-grid-lcr mbd-file">
	<strong>{% if uri %}File <code>{{ uri|mbd_basename }}</code>{% else %}{{ title|default:"Data" }}{% endif %}</strong>
	<span></span>
	<nav>
		<ul>
			{% if content is not None %}
				<li>
					<a class="mbd-clipboard" data-clipboard-target="#{{ token }}">
						<img class="mbd-icon" src="{% static 'icons/copy.svg' %}" alt="Copy to clipboard" title="Copy to clipboard">
					</a>
				</li>
			{% endif %}
			{% if uri %}
				<li><a href="{{ uri }}" download><img class="mbd-icon" src="{% static 'icons/download.svg' %}" alt="Download" title="{{ uri }}"></li></a>
			{% endif %}
		</ul>
	</nav>
</header>

{% if toc %}
	<details class="mbd-file-toc" open>
		<summary>Table Of Contents</summary>
		<ul>
			{% for entry in toc %}
				<li><a class="{{ entry.class }}" href="#{{ entry.token }}">{{ entry.title }}</a></li>
			{% endfor %}
		</ul>
	</details>
{% endif %}

{% if content is None %}
	<div class="mbd-info">No filter -- content will not be displayed.</div>
{% else %}
	<pre id="{{ token }}" class="mbd-file-content">{{ content }}</pre>
{% endif %}
