|
| 1 | +{% set hasLooped = false %} |
| 2 | +{ |
| 3 | + {% for element in documentationSet.indexes.classes -%} |
| 4 | + {% if loop.first and hasLooped %},{% endif %} |
| 5 | + {% set hasLooped = false %} |
| 6 | + {{ _self.link(project, element) }} |
| 7 | + {% if not loop.last -%}, |
| 8 | + {% else %} |
| 9 | + {% set hasLooped = true %} |
| 10 | + {% endif %} |
| 11 | + {% endfor %} |
| 12 | + |
| 13 | + {% for element in documentationSet.indexes.interfaces -%} |
| 14 | + {% if loop.first and hasLooped %},{% endif %} |
| 15 | + {% set hasLooped = false %} |
| 16 | + {{ _self.link(project, element) }} |
| 17 | + {% if not loop.last -%}, |
| 18 | + {% else %} |
| 19 | + {% set hasLooped = true %} |
| 20 | + {% endif %} |
| 21 | + {% endfor %} |
| 22 | + |
| 23 | + {% for element in documentationSet.indexes.traits -%} |
| 24 | + {% if loop.first and hasLooped %},{% endif %} |
| 25 | + {% set hasLooped = false %} |
| 26 | + {{ _self.link(project, element) }} |
| 27 | + {% if not loop.last -%}, |
| 28 | + {% else %} |
| 29 | + {% set hasLooped = true %} |
| 30 | + {% endif %} |
| 31 | + {% endfor %} |
| 32 | + |
| 33 | + {% for element in documentationSet.indexes.enums -%} |
| 34 | + {% if loop.first and hasLooped %},{% endif %} |
| 35 | + {% set hasLooped = false %} |
| 36 | + {{ _self.link(project, element) }} |
| 37 | + {% if not loop.last -%}, |
| 38 | + {% else %} |
| 39 | + {% set hasLooped = true %} |
| 40 | + {% endif %} |
| 41 | + {% endfor %} |
| 42 | + |
| 43 | + {% for element in documentationSet.indexes.functions -%} |
| 44 | + {% if loop.first and hasLooped %},{% endif %} |
| 45 | + {% set hasLooped = false %} |
| 46 | + {{ _self.link(project, element) }} |
| 47 | + {% if not loop.last -%}, |
| 48 | + {% else %} |
| 49 | + {% set hasLooped = true %} |
| 50 | + {% endif %} |
| 51 | + {% endfor %} |
| 52 | +} |
| 53 | + |
| 54 | +{% macro link(project, element) %} |
| 55 | +"{{ element.fullyQualifiedStructuralElementName|replace({'\\': '\\\\'}) }}": { |
| 56 | +{% set internalTags = element.tags|filter((v,k) => k in ['internal']) %} |
| 57 | + "url": "https://api.typo3.org/{{ parameter.typo3_version }}/{{ element | route('url') }}", |
| 58 | + "short": "{{ element.name|replace({'\\': '\\\\'}) }}", |
| 59 | + "fqn": "{{ element.fullyQualifiedStructuralElementName|replace({'\\': '\\\\'}) }}", |
| 60 | + "github": "{{ parameter.typo3_github_url }}/{{ parameter.typo3_version }}/{{ element.file.path }}", |
| 61 | + "file": "{{ element.file.path }}", |
| 62 | + "type": "{% if element is class %}class{% endif %}{% if element is interface %}interface{% endif %}{% if element is trait %}trait{% endif %}{% if element is enum %}enum{% endif %}", |
| 63 | + "final": "{{ element.isFinal }}", |
| 64 | + "abstract": "{{ element.isAbstract }}", |
| 65 | + "readonly": "{{ element.isReadonly }}", |
| 66 | + "internal": "{% if internalTags|length > 0 and internalTags|first|length > 0 %}1{% endif %}", |
| 67 | + "internal-message": "{% for tag in internalTags %}{{ tag.description|replace({'\\': '\\\\'})|replace({'\n': ' '})|replace({' ': ' '}) }}{% endfor %}", |
| 68 | + "deprecated": "{% if element.deprecated %}1{% endif %}", |
| 69 | + "deprecation": "{% for deprecation in element.deprecations %}{{ deprecation.description|replace({'\\': '\\\\'})|replace({'\n': ' '})|replace({' ': ' '})}} {% endfor %}", |
| 70 | + "extends": "{% if element.parent %}{{ element.parent.fullyQualifiedStructuralElementName|replace({'\\': '\\\\'})|replace({'\n': ' '})|replace({' ': ' '}) }}{% endif %}", |
| 71 | + "implements": "{% if element.interfaces is not empty -%} |
| 72 | +{%- for interface in element.interfaces %}{{ interface.fullyQualifiedStructuralElementName|replace({'\\': '\\\\'})|replace({'\n': ' '})|replace({' ': ' '}) }}{% if not loop.last %}, {% endif %}{% endfor -%} |
| 73 | +{% endif %}", |
| 74 | + "summary": "{{ element.summary|replace({'\\': '\\\\'})|replace({'\n': ' '})|replace({' ': ' '}) }}" |
| 75 | +} |
| 76 | +{% endmacro %} |
0 commit comments