{% extends "base.html" %} {% block title %}{{ project.name }}{% endblock %} {% block content %}

{{ project.name }}

{{ project.objects | length }} object{{ 's' if project.objects | length != 1 else '' }} — {% set counts = {} %} {% for obj in project.objects %} {% if obj.obj_type not in counts %}{% set _ = counts.update({obj.obj_type: 0}) %}{% endif %} {% set _ = counts.update({obj.obj_type: counts[obj.obj_type] + 1}) %} {% endfor %} {% for type_key, label in [('function_block','function block'), ('program','program'), ('function','function'), ('interface','interface'), ('gvl','GVL'), ('struct','struct'), ('enum','enum')] %} {% if counts.get(type_key, 0) > 0 %} {{ counts[type_key] }} {{ label }}{{ 's' if counts[type_key] != 1 else '' }}  {% endif %} {% endfor %}


{% macro type_badge(obj_type) %} {% if obj_type == 'function_block' %}FB {% elif obj_type == 'program' %}PRG {% elif obj_type == 'function' %}FN {% elif obj_type == 'interface' %}ITF {% elif obj_type == 'gvl' %}GVL {% elif obj_type == 'struct' %}ST {% elif obj_type == 'enum' %}ENUM {% endif %} {% endmacro %} {% for section_type, section_label in [ ('function_block', 'Function Blocks'), ('program', 'Programs'), ('function', 'Functions'), ('interface', 'Interfaces'), ('gvl', 'Global Variable Lists'), ('struct', 'Structures'), ('enum', 'Enumerations'), ] %} {% set objs = project.objects | selectattr('obj_type', 'equalto', section_type) | list %} {% if objs %}

{{ section_label }}

{% for obj in objs %} {% endfor %}
NameDescription
{{ type_badge(obj.obj_type) }} {{ obj.name }} {{ obj.comment.description | truncate(120) if obj.comment.description else '' }}
{% endif %} {% endfor %} {% endblock %}