Skip to content

Commit

Permalink
Add container section
Browse files Browse the repository at this point in the history
  • Loading branch information
MancunianSam committed Dec 13, 2024
1 parent 5b904e7 commit c30a917
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/scripts/generate_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ def create_detail(json_path):
signatures = get_signatures(data)
summary_section = env.get_template("details_section.html").render(title="Summary", results=[summary], open=True)
signatures_section = env.get_template("details_section.html").render(title="Signatures", results=signatures)
container_template = env.get_template("container_signature_section.html")
container_content = container_template.render(data=data)
content = details_template.render(name=summary['Name'], summary=summary_section,
signatures=signatures_section)
signatures=signatures_section, containers=container_content)
return index_template.render(content=content)


Expand Down Expand Up @@ -127,3 +129,5 @@ def run():


run()


86 changes: 86 additions & 0 deletions templates/container_signature_section.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{% for container in data['containerSignatures'] %}
<ol class="tna-ol tna-ol--plain">
<li>
<p>{{ container.description }}</p>
<p>{{ container.containerType }}</p>
{% for file in container['files'] %}
<div class="tna-details">
<details class="tna-details__details">
<summary class="tna-details__summary">Files</summary>
<div class="tna-details__content">
<ol class="tna-ol tna-ol--plain">
<li>
<div class="tna-details">
<p><b>Path</b>{{ file['path'] }}</p>
{% if 'byteSequences' in file %}
{% for byte_sequence in file['byteSequences'] %}
<div class="tna-details">
<details class="tna-details__details">
<summary class="tna-details__summary">Byte sequences</summary>
<p><b>Reference</b>{{ byte_sequence['reference'] }}</p>
<div class="tna-details__content">
{% if 'subSequences' in byte_sequence %}
{% for sub_sequence in byte_sequence['subSequences'] %}
<div class="tna-details">
<details class="tna-details__details">
<summary class="tna-details__summary">Sub sequences</summary>
<div class="tna-details__content">
<ol class="tna-ol tna-ol--dashed">
<li><b>Min Frag Length:</b> {{ sub_sequence['minFragLength'] }}</li>
<li><b>Position:</b> {{ sub_sequence['position'] }}</li>
<li><b>Sub sequence min offset:</b> {{ sub_sequence['subSeqMinOffset'] }}</li>
<li><b>Sub sequence max offset:</b> {{ sub_sequence['subSeqMaxOffset'] }}</li>
<li><b>Sequence:</b> {{ sub_sequence['sequence'] }}</li>
{% if 'leftFragment' in sub_sequence %}
<li>
<div class="tna-details">
<details class="tna-details__details">
<summary class="tna-details__summary">Left fragment</summary>
<div class="tna-details__content">
<ol class="tna-ol tna-ol--dashed">
<li><b>Max offset:</b> {{ sub_sequence['leftFragment']['maxOffset'] }}</li>
<li><b>Min offset:</b> {{ sub_sequence['leftFragment']['minOffset'] }}</li>
<li><b>Position:</b> {{ sub_sequence['leftFragment']['position'] }}</li>
</ol>
</div>
</details>
</div>
</li>
{% endif %}
{% if 'rightFragment' in sub_sequence %}
<li>
<div class="tna-details">
<details class="tna-details__details">
<summary class="tna-details__summary">Right fragment</summary>
<div class="tna-details__content">
<ol class="tna-ol tna-ol--dashed">
<li><b>Max offset:</b> {{ sub_sequence['rightFragment']['maxOffset'] }}</li>
<li><b>Min offset:</b> {{ sub_sequence['rightFragment']['minOffset'] }}</li>
<li><b>Position:</b> {{ sub_sequence['rightFragment']['position'] }}</li>
</ol>
</div>
</details>
</div>
</li>
{% endif %}
</ol>
</div>
</details>
</div>
{% endfor %}
{% endif %}
</div>
</details>
</div>
{% endfor %}
{% endif %}
</div>
</li>
</ol>
</div>
</details>
</div>
{% endfor %}
</li>
</ol>
{% endfor %}
14 changes: 14 additions & 0 deletions templates/details.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{% from "components/accordion/macro.html" import tnaAccordion %}
<div class="tna-column tna-column--full tna-!--padding-vertical-s">
<h1 class="tna-heading-m">{{ name }}</h1>
{{ summary|safe }}
{{ signatures|safe }}
{{ tnaAccordion({
'itemHeadingLevel': 1,
'items': [
{
'title': 'Container signatures',
'body': containers|safe,
'open': false

},
],
'group': "group-1"
}) }}

</div>

0 comments on commit c30a917

Please sign in to comment.