From c30a91711c890c7f1b21d08fdf27c44378f9dbb2 Mon Sep 17 00:00:00 2001 From: MancunianSam Date: Fri, 13 Dec 2024 13:02:20 +0000 Subject: [PATCH] Add container section --- .github/scripts/generate_pages.py | 6 +- templates/container_signature_section.html | 86 ++++++++++++++++++++++ templates/details.html | 14 ++++ 3 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 templates/container_signature_section.html diff --git a/.github/scripts/generate_pages.py b/.github/scripts/generate_pages.py index 589edc3..35333e2 100644 --- a/.github/scripts/generate_pages.py +++ b/.github/scripts/generate_pages.py @@ -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) @@ -127,3 +129,5 @@ def run(): run() + + diff --git a/templates/container_signature_section.html b/templates/container_signature_section.html new file mode 100644 index 0000000..36ce04f --- /dev/null +++ b/templates/container_signature_section.html @@ -0,0 +1,86 @@ +{% for container in data['containerSignatures'] %} +
    +
  1. +

    {{ container.description }}

    +

    {{ container.containerType }}

    + {% for file in container['files'] %} +
    +
    + Files +
    +
      +
    1. +
      +

      Path{{ file['path'] }}

      + {% if 'byteSequences' in file %} + {% for byte_sequence in file['byteSequences'] %} +
      +
      + Byte sequences +

      Reference{{ byte_sequence['reference'] }}

      +
      + {% if 'subSequences' in byte_sequence %} + {% for sub_sequence in byte_sequence['subSequences'] %} +
      +
      + Sub sequences +
      +
        +
      1. Min Frag Length: {{ sub_sequence['minFragLength'] }}
      2. +
      3. Position: {{ sub_sequence['position'] }}
      4. +
      5. Sub sequence min offset: {{ sub_sequence['subSeqMinOffset'] }}
      6. +
      7. Sub sequence max offset: {{ sub_sequence['subSeqMaxOffset'] }}
      8. +
      9. Sequence: {{ sub_sequence['sequence'] }}
      10. + {% if 'leftFragment' in sub_sequence %} +
      11. +
        +
        + Left fragment +
        +
          +
        1. Max offset: {{ sub_sequence['leftFragment']['maxOffset'] }}
        2. +
        3. Min offset: {{ sub_sequence['leftFragment']['minOffset'] }}
        4. +
        5. Position: {{ sub_sequence['leftFragment']['position'] }}
        6. +
        +
        +
        +
        +
      12. + {% endif %} + {% if 'rightFragment' in sub_sequence %} +
      13. +
        +
        + Right fragment +
        +
          +
        1. Max offset: {{ sub_sequence['rightFragment']['maxOffset'] }}
        2. +
        3. Min offset: {{ sub_sequence['rightFragment']['minOffset'] }}
        4. +
        5. Position: {{ sub_sequence['rightFragment']['position'] }}
        6. +
        +
        +
        +
        +
      14. + {% endif %} +
      +
      +
      +
      + {% endfor %} + {% endif %} +
      +
      +
      + {% endfor %} + {% endif %} +
      +
    2. +
    +
    +
    +
    + {% endfor %} +
  2. +
+{% endfor %} \ No newline at end of file diff --git a/templates/details.html b/templates/details.html index 9c1ab07..b007f1d 100644 --- a/templates/details.html +++ b/templates/details.html @@ -1,5 +1,19 @@ +{% from "components/accordion/macro.html" import tnaAccordion %}

{{ name }}

{{ summary|safe }} {{ signatures|safe }} + {{ tnaAccordion({ + 'itemHeadingLevel': 1, + 'items': [ + { + 'title': 'Container signatures', + 'body': containers|safe, + 'open': false + + }, + ], + 'group': "group-1" + }) }} +
\ No newline at end of file