{%- from 'macro.jinja2' import output_display with context -%}

{%- if 'hide' not in option -%}
{%- if 'hide-input' not in option -%}
<div class="cell jupyter input"><div class="code"><pre><code class="{{ language }}">{{ code }}{% if 'inspect' in option %}?{% endif %}</code></pre></div>
<div class="report"><p><span class="count">[{{ report.count }}]</span>
<span class="start">{{ report.start }}</span> (<span class="time">{{ report.time }}</span>)
<span class="right">{%- if option -%}<span class="option">({{ ' '.join(option) }})</span> {% endif -%}
<span class="kernel">{{ kernel_name }}</span> (<span class="total">{{ report.total }}</span>)</span></p></div></div>
{%- endif -%}
{%- for output in outputs if output.type != 'display_data' -%}
  {%- if output.type == 'error' -%}
      <div class="cell jupyter error"><div class="code"><pre><code class="nohighlight">{{ output.ename }}: {{ output.evalue }}</code></pre></div>
      <div class="report"><pre><code class="nohighlight">{{ output.traceback }}</code></pre></div></div>
  {%- elif output.type == 'stream' -%}
      <div class="cell jupyter {{ output.name }}"><div class="code">
      <pre><code class="{% if output.name == 'source' %}{{ language }}{% else %}nohighlight{% endif %}">{{ output.text }}</code></pre></div></div>
  {%- elif 'text/plain' in output.data -%}
      <div class="cell jupyter output"><div class="code"><pre><code class="nohighlight">{{ output.data['text/plain'] }}</code></pre></div></div>
  {%- endif -%}
{%- endfor -%}
{%- for output in outputs -%}{{ output_display(output, false) }}{%- endfor -%}
{%- endif -%}
