<div class="main">
{# todo: update this template #}
<div id="sourceContainer" class="source-file__source">
  {%- if view_object.pygmented_source_file_lines|length > 0 -%}
  <div id="source" class="source">
    {%- for line in view_object.pygmented_source_file_lines -%}
      <div id="line-{{ loop.index }}" class="source__line-number"><pre>{{ loop.index }}</pre></div>
      <div data-line={{ loop.index }} class="source__line-content">
        {%- if line.__class__.__name__ == "tuple" -%}
          {%- set replacement_before, replacement_after, pragma = line -%}
          {# Note: Cannot format HTML/Jinja blocks within 'pre' tags! #}
          <pre class="sdoc-comment">{{ replacement_before }}{%- for req in pragma.reqs_objs -%}
              <a
                class="pointer"
                data-reqid="{{ req.uid }}"
                data-begin="{{ pragma.ng_range_line_begin }}"
                data-end="{{ pragma.ng_range_line_end }}"
                data-traceability-file-type="this_file"
                href="{{ view_object.link_renderer.render_requirement_in_source_file_range_link_using_id(req.uid, view_object.source_file.in_doctree_source_file_rel_path_posix, view_object.source_file, pragma) }}"
                >{%- if pragma.is_end() -%}/{%- endif -%}{{ req.uid }}</a>{%- if not loop.last -%}, {% endif -%}
            {%- endfor -%}{{ replacement_after }}</pre>
      {%- elif line != "" -%}
        {# <!-- Pygments --> #}
        <pre class="highlight">{{ line }}</pre>
      {%- else -%}
        <pre data-state="empty" style="user-select: none">&nbsp;</pre>
      {%- endif -%}
      </div>
    {%- endfor -%}
  </div>
  {%- else -%}
  <div style="text-align: center">
    Source file is empty.
  </div>
  {%- endif -%}
</div>
</div>{# /.main #}
